Package org.hibernate.reactive.context
Interface Context
-
- All Superinterfaces:
java.util.concurrent.Executor
,java.io.Serializable
,org.hibernate.service.Service
- All Known Implementing Classes:
VertxContext
public interface Context extends java.util.concurrent.Executor, org.hibernate.service.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(java.lang.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(java.lang.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.- Specified by:
execute
in interfacejava.util.concurrent.Executor
-
-