| Modifier and Type | Field and Description |
|---|---|
| public static final ContextLocal |
| Modifier and Type | Method and Description |
|---|---|
| public default void | |
| public default ContextInternal | Returns: the previous context that shall be restored after ornull if there is noneBegin the execution of a task on this context. |
| public ClassLoader | |
| public Future | Returns: a future signalling close completionClose this context, cleanup close future hooks then dispose pending ordered task queue. |
| public CloseFuture | |
| public ConcurrentMap | |
| public static ContextInternal | |
| public default String | deploymentID()
Implements io. If the context is associated with a Verticle deployment, this returns the deployment ID of that deployment. |
| public default void | |
| public default void | |
| public default <E> void | |
| public ContextInternal | Returns: a duplicate of this contextReturns a context sharing with this context
|
| public <T> void | emit(T
the argument, Handler<T> task argumentthe handler to execute with the task)event argumentEmit the given |
| public default void | |
| public default void | endDispatch(ContextInternal
the previous context to restore or previous)null if there is noneEnd the execution of a task on this context, see
You should not use this API directly, instead you should use |
| public default void | |
| public void | |
| public <T> void | |
| public default <T> void | executeBlocking(Handler<Promise<T>> blockingCodeHandler, TaskQueue queue, Handler<AsyncResult<T>> resultHandler)
Deprecated
instead use
executeBlocking(Callable, TaskQueue)
Like |
| public <T> Future | executeBlocking(Handler<Promise<T>> blockingCodeHandler, TaskQueue queue)
Deprecated
Like |
| public <T> Future | |
| public default <T> void | executeBlocking(Handler<Promise<T>>
handler representing the blocking code to run blockingCodeHandler, boolean if true then if executeBlocking is called several times on the same context, the executions
for that context will be executed serially, not in parallel. if false then they will be no ordering
guarantees ordered, Handler<AsyncResult<T>> handler that will be called when the blocking code is complete resultHandler)Implements io. Safely execute some blocking code. |
| public default <T> void | executeBlockingInternal(Handler<Promise<T>> action, Handler<AsyncResult<T>> resultHandler)
Deprecated
Execute an internal task on the internal blocking ordered executor. |
| public default <T> void | executeBlockingInternal(Handler<Promise<T>> action, boolean ordered, Handler<AsyncResult<T>> resultHandler)
Deprecated
|
| public <T> Future | executeBlockingInternal(Handler<Promise<T>> action)
Like |
| public <T> Future | |
| public <T> Future | executeBlockingInternal(Handler<Promise<T>> action, boolean ordered)
Like |
| public <T> Future | |
| public Executor | Returns: an executor that schedule a task on this context, the thread executing the task will not be associated with this context
|
| public default <T> Future | |
| public default <T> Future | |
| public default <T> T | get(Object
the key of the data key)Implements io. Get some data from the context. |
| public Deployment | |
| public default int | |
| public default < the type of the data T> T | Returns: the local datathe key of the data key)Get some local data from the context. |
| public < the type of the data T> T | Returns: the local datathe key of the data key, AccessMode accessMode)Get some local data from the context. |
| public < the type of the data T> T | Returns: the local datathe key of the data key, AccessMode accessMode, Supplier<? extends T> the supplier of the initial value optionally called initialValueSupplier)Get some local data from the context, when it does not exist the |
| public default <T> T | getLocal(Object
the key of the data key)Implements io.
Deprecated
Get some local data from the context. |
| public boolean | |
| public default boolean | |
| public default boolean | Returns: true if this context is a duplicated context, false otherwise.Returns |
| public default boolean | |
| public default ConcurrentMap | |
| public EventLoop | |
| public VertxInternal | |
| public default <T> PromiseInternal | |
| public default <T> PromiseInternal | Returns: aPromise associated with this context or the handler
if that handler is already an instance of PromiseInternal
|
| public default void | put(Object
the key of the data key, Object the data value)Implements io. Put some data in the context. |
| public <T> void | putLocal(ContextLocal<T>
the key of the data key, AccessMode accessMode, T the data value)Put some local data in the context. |
| public default void | putLocal(Object
the key of the data key, Object the data value)Implements io.
Deprecated
Put some local data in the context. |
| public default boolean | remove(Object
the key to remove key)Implements io. Remove some data from the context. |
| public default void | |
| public default <T> void | removeLocal(ContextLocal<T>
the key to remove key, AccessMode accessMode)Remove some local data from the context. |
| public default boolean | removeLocal(Object
the key to remove key)Implements io.
Deprecated
Remove some local data from the context. |
| public void | reportException(Throwable
the exception to report t)Report an exception to this context synchronously. |
| public default void | runOnContext(Handler<Void>
the action to run action)Implements io. Run the specified action asynchronously on the same context, some time after the current execution has completed. |
| public default long | setPeriodic(long delay, Handler<Long> handler)
Like |
| public default long | setTimer(long delay, Handler<Long> handler)
Like |
| public default <T> Future | |
| public default <T> Future | |
| public VertxTracer | |
| public default ContextInternal | Returns: the wrapped contextReturns the original context, a duplicate context returns the wrapped context otherwise this instance is returned. |
| public WorkerPool |
| LOCAL_MAP | back to summary |
|---|---|
| public static final ContextLocal<ConcurrentMap<Object, Object>> LOCAL_MAP | |
| addCloseHook | back to summary |
|---|---|
| public default void addCloseHook(Closeable hook) Add a close hook. The
| |
| beginDispatch | back to summary |
|---|---|
| public default ContextInternal beginDispatch() Begin the execution of a task on this context. The task execution is monitored by the blocked thread checker. This context is thread-local associated during the task execution.
You should not use this API directly, instead you should use
| |
| classLoader | back to summary |
|---|---|
public ClassLoader classLoader()
| |
| close | back to summary |
|---|---|
| public Future Close this context, cleanup close future hooks then dispose pending ordered task queue. | |
| closeFuture | back to summary |
|---|---|
| public CloseFuture closeFuture() | |
| contextData | back to summary |
|---|---|
public ConcurrentMap
| |
| current | back to summary |
|---|---|
public static ContextInternal current()
| |
| deploymentID | back to summary |
|---|---|
| public default String deploymentID() Implements io. Doc from io. If the context is associated with a Verticle deployment, this returns the deployment ID of that deployment.
| |
| dispatch | back to summary |
|---|---|
public default void dispatch(Runnable handler)
| |
| dispatch | back to summary |
|---|---|
public default void dispatch(Handler<Void> handler)
| |
| dispatch | back to summary |
|---|---|
| public default <E> void dispatch(E event, Handler<E> handler) Dispatch an The handler is executed directly by the caller thread which must be a context thread. The handler execution is monitored by the blocked thread checker. This context is thread-local associated during the task execution.
| |
| duplicate | back to summary |
|---|---|
| public ContextInternal duplicate() Returns a context sharing with this context
The duplicate context has its own
| |
| emit | back to summary |
|---|---|
| public <T> void emit(T argument, Handler<T> task) Emit the given
| |
| emit | back to summary |
|---|---|
public default void emit(Handler<Void> task)
| |
| endDispatch | back to summary |
|---|---|
| public default void endDispatch(ContextInternal previous) End the execution of a task on this context, see
You should not use this API directly, instead you should use
| |
| execute | back to summary |
|---|---|
public default void execute(Handler<Void> task)
| |
| execute | back to summary |
|---|---|
| public void execute(Runnable task) Execute the
| |
| execute | back to summary |
|---|---|
| public <T> void execute(T argument, Handler<T> task) Execute a
| |
| executeBlocking | back to summary |
|---|---|
| public default <T> void executeBlocking(Handler<Promise<T>> blockingCodeHandler, TaskQueue queue, Handler<AsyncResult<T>> resultHandler)
Deprecated instead use Like
| |
| executeBlocking | back to summary |
|---|---|
| public <T> Future Deprecated
Like
| |
| executeBlocking | back to summary |
|---|---|
| public <T> Future | |
| executeBlocking | back to summary |
|---|---|
| public default <T> void executeBlocking(Handler<Promise<T>> blockingCodeHandler, boolean ordered, Handler<AsyncResult<T>> resultHandler) Implements io. Doc from io. Safely execute some blocking code.
Executes the blocking code in the handler The returned future will be completed with the result on the original context (i.e. on the original event loop of the caller) or failed when the handler throws an exception.
A The blocking code should block for a reasonable amount of time (i.e no more than a few seconds). Long blocking operations or polling operations (i.e a thread that spin in a loop polling events in a blocking fashion) are precluded. When the blocking operation lasts more than the 10 seconds, a message will be printed on the console by the blocked thread checker.
Long blocking operations should use a dedicated thread managed by the application, which can interact with
verticles using the event-bus or
| |
| executeBlockingInternal | back to summary |
|---|---|
| public default <T> void executeBlockingInternal(Handler<Promise<T>> action, Handler<AsyncResult<T>> resultHandler)
Deprecated
Execute an internal task on the internal blocking ordered executor.
| |
| executeBlockingInternal | back to summary |
|---|---|
| public default <T> void executeBlockingInternal(Handler<Promise<T>> action, boolean ordered, Handler<AsyncResult<T>> resultHandler)
Deprecated
| |
| executeBlockingInternal | back to summary |
|---|---|
| public <T> Future Like | |
| executeBlockingInternal | back to summary |
|---|---|
| public <T> Future | |
| executeBlockingInternal | back to summary |
|---|---|
| public <T> Future Like | |
| executeBlockingInternal | back to summary |
|---|---|
| public <T> Future | |
| executor | back to summary |
|---|---|
public Executor executor()
| |
| failedFuture | back to summary |
|---|---|
| public default <T> Future | |
| failedFuture | back to summary |
|---|---|
| public default <T> Future | |
| get | back to summary |
|---|---|
| public default <T> T get(Object key) Implements io. Doc from io. Get some data from the context.
| |
| getDeployment | back to summary |
|---|---|
public Deployment getDeployment()
| |
| getInstanceCount | back to summary |
|---|---|
| public default int getInstanceCount() Implements io.
| |
| getLocal | back to summary |
|---|---|
| public default <T> T getLocal(ContextLocal<T> key) Get some local data from the context.
| |
| getLocal | back to summary |
|---|---|
| public <T> T getLocal(ContextLocal<T> key, AccessMode accessMode) Get some local data from the context.
| |
| getLocal | back to summary |
|---|---|
| public <T> T getLocal(ContextLocal<T> key, AccessMode accessMode, Supplier<? extends T> initialValueSupplier) Get some local data from the context, when it does not exist the The
| |
| getLocal | back to summary |
|---|---|
| public default <T> T getLocal(Object key) Implements io. Doc from io. Deprecated
Get some local data from the context.
| |
| inThread | back to summary |
|---|---|
| public boolean inThread() | |
| isDeployment | back to summary |
|---|---|
public default boolean isDeployment()
| |
| isDuplicate | back to summary |
|---|---|
| public default boolean isDuplicate() Returns
| |
| isRunningOnContext | back to summary |
|---|---|
public default boolean isRunningOnContext()
| |
| localContextData | back to summary |
|---|---|
public default ConcurrentMap
| |
| nettyEventLoop | back to summary |
|---|---|
| public EventLoop nettyEventLoop() Return the Netty EventLoop used by this Context. This can be used to integrate a Netty Server with a Vert.x runtime, specially the Context part.
| |
| owner | back to summary |
|---|---|
| public VertxInternal owner() Redeclares io.
| |
| promise | back to summary |
|---|---|
public default <T> PromiseInternal
| |
| promise | back to summary |
|---|---|
public default <T> PromiseInternal
| |
| put | back to summary |
|---|---|
| public default void put(Object key, Object value) Implements io. Doc from io. Put some data in the context. This can be used to share data between different handlers that share a context | |
| putLocal | back to summary |
|---|---|
| public <T> void putLocal(ContextLocal<T> key, AccessMode accessMode, T value) Put some local data in the context. This can be used to share data between different handlers that share a context
| |
| putLocal | back to summary |
|---|---|
| public default void putLocal(Object key, Object value) Implements io. Doc from io. Deprecated
Put some local data in the context. This can be used to share data between different handlers that share a context
| |
| remove | back to summary |
|---|---|
| public default boolean remove(Object key) Implements io. Doc from io. Remove some data from the context. | |
| removeCloseHook | back to summary |
|---|---|
| public default void removeCloseHook(Closeable hook) Remove a close hook. This is called when the resource is released explicitly and does not need anymore a managed close.
| |
| removeLocal | back to summary |
|---|---|
| public default <T> void removeLocal(ContextLocal<T> key, AccessMode accessMode) Remove some local data from the context.
| |
| removeLocal | back to summary |
|---|---|
| public default boolean removeLocal(Object key) Implements io. Doc from io. Deprecated
Remove some local data from the context.
| |
| reportException | back to summary |
|---|---|
| public void reportException(Throwable t) Report an exception to this context synchronously. The exception handler will be called when there is one, otherwise the exception will be logged.
| |
| runOnContext | back to summary |
|---|---|
| public default void runOnContext(Handler<Void> action) Implements io. Doc from io. Run the specified action asynchronously on the same context, some time after the current execution has completed. | |
| setPeriodic | back to summary |
|---|---|
| public default long setPeriodic(long delay, Handler<Long> handler) Like | |
| setTimer | back to summary |
|---|---|
| public default long setTimer(long delay, Handler<Long> handler) Like | |
| succeededFuture | back to summary |
|---|---|
| public default <T> Future | |
| succeededFuture | back to summary |
|---|---|
| public default <T> Future | |
| tracer | back to summary |
|---|---|
public VertxTracer
| |
| unwrap | back to summary |
|---|---|
| public default ContextInternal unwrap() Returns the original context, a duplicate context returns the wrapped context otherwise this instance is returned.
| |
| workerPool | back to summary |
|---|---|
public WorkerPool workerPool()
| |