Package org.hibernate.reactive.context
Interface Context
-
- All Superinterfaces:
Executor
,Serializable
,Service
public interface Context extends Executor, Service
Abstracts away from the Vert.xContext
object, enabling alternative strategies for associating state with the current reactive stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Context.Key<T>
An object that identifies something we store in the Vert.x local context, usually aSession
orStatelessSession
, but in principle anything at all.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
execute(Runnable runnable)
Run the given command in a context.<T> T
get(Context.Key<T> key)
Get a value associated with the current reactive stream, or return null.<T> void
put(Context.Key<T> key, T instance)
Associate a value with the current reactive stream.void
remove(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.
-
-