Package org.hibernate.reactive.context
Interface Context
-
- All Superinterfaces:
Executor,Serializable,Service
public interface Context extends Executor, Service
Abstracts away from the Vert.xContextobject, enabling alternative strategies for associating state with the current reactive stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceContext.Key<T>An object that identifies something we store in the Vert.x local context, usually aSessionorStatelessSession, but in principle anything at all.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidexecute(Runnable runnable)Run the given command in a context.<T> Tget(Context.Key<T> key)Get a value associated with the current reactive stream, or return null.<T> voidput(Context.Key<T> key, T instance)Associate a value with the current reactive stream.voidremove(Context.Key<?> key)Remove a value associated with the current reactive stream.
-
-
-
Method Detail
-
put
<T> void put(Context.Key<T> key, T instance)
Associate a value with the current reactive stream.
-
get
<T> T get(Context.Key<T> key)
Get a value associated with the current reactive stream, or return null.
-
remove
void remove(Context.Key<?> key)
Remove a value associated with the current reactive stream.
-
execute
void execute(Runnable runnable)
Run the given command in a context. If there is a context already associated with the call, use that one. Otherwise, create a new context and execute the command in the new context. In case a new context is created, it will ensure a local context is created.
-
-