public interface ContextInternal extends Context
| Modifier and Type | Method and Description |
|---|---|
void |
addCloseHook(Closeable hook)
Add a close hook.
|
ContextInternal |
beginDispatch()
Begin the execution of a task on this context.
|
ClassLoader |
classLoader() |
ConcurrentMap<Object,Object> |
contextData() |
static ContextInternal |
current() |
<E> void |
dispatch(E event,
Handler<E> handler)
Dispatch an
event to the handler on this context. |
void |
dispatch(Handler<Void> handler) |
void |
dispatch(Runnable handler) |
ContextInternal |
duplicate()
Returns a context sharing with this context
the same concurrency
the same exception handler
the same context data
the same deployment
the same config
the same classloader
|
void |
emit(Handler<Void> task) |
<T> void |
emit(T argument,
Handler<T> task)
Emit the given
argument event to the task and switch on this context if necessary, this also associates the
current thread with the current context so Vertx.currentContext() returns this context. |
void |
endDispatch(ContextInternal previous)
End the execution of a task on this context, see
beginDispatch() |
void |
execute(Handler<Void> task) |
void |
execute(Runnable task)
Execute the
task on this context, it will be executed according to the
context concurrency model. |
<T> void |
execute(T argument,
Handler<T> task)
Execute a
task on this context, the task will be executed according to the
context concurrency model. |
<T> Future<T> |
executeBlocking(Handler<Promise<T>> blockingCodeHandler,
TaskQueue queue)
Like
Context.executeBlocking(Handler, boolean) but uses the queue to order the tasks instead
of the internal queue of this context. |
<T> void |
executeBlocking(Handler<Promise<T>> blockingCodeHandler,
TaskQueue queue,
Handler<AsyncResult<T>> resultHandler)
Like
Context.executeBlocking(Handler, boolean, Handler) but uses the queue to order the tasks instead
of the internal queue of this context. |
<T> Future<T> |
executeBlockingInternal(Handler<Promise<T>> action)
Like
executeBlockingInternal(Handler, Handler) but returns a Future of the asynchronous result |
<T> Future<T> |
executeBlockingInternal(Handler<Promise<T>> action,
boolean ordered)
Like
executeBlockingInternal(Handler, boolean, Handler) but returns a Future of the asynchronous result |
<T> void |
executeBlockingInternal(Handler<Promise<T>> action,
boolean ordered,
Handler<AsyncResult<T>> resultHandler) |
<T> void |
executeBlockingInternal(Handler<Promise<T>> action,
Handler<AsyncResult<T>> resultHandler)
Execute an internal task on the internal blocking ordered executor.
|
<T> Future<T> |
failedFuture(String message) |
<T> Future<T> |
failedFuture(Throwable failure) |
Deployment |
getDeployment() |
boolean |
isDeployment() |
boolean |
isRunningOnContext() |
ConcurrentMap<Object,Object> |
localContextData() |
io.netty.channel.EventLoop |
nettyEventLoop()
Return the Netty EventLoop used by this Context.
|
VertxInternal |
owner() |
<T> PromiseInternal<T> |
promise() |
<T> PromiseInternal<T> |
promise(Handler<AsyncResult<T>> handler) |
void |
removeCloseHook(Closeable hook)
Remove a close hook.
|
void |
reportException(Throwable t)
Report an exception to this context synchronously.
|
long |
setPeriodic(long delay,
Handler<Long> handler)
Like
Vertx.setPeriodic(long, Handler) except the periodic timer will fire on this context. |
long |
setTimer(long delay,
Handler<Long> handler)
Like
Vertx.setTimer(long, Handler) except the timer will fire on this context. |
<T> Future<T> |
succeededFuture() |
<T> Future<T> |
succeededFuture(T result) |
VertxTracer |
tracer() |
WorkerPool |
workerPool() |
config, deploymentID, exceptionHandler, exceptionHandler, executeBlocking, executeBlocking, executeBlocking, executeBlocking, get, getInstanceCount, getLocal, isEventLoopContext, isOnEventLoopThread, isOnVertxThread, isOnWorkerThread, isWorkerContext, processArgs, put, putLocal, remove, removeLocal, runOnContextstatic ContextInternal current()
io.netty.channel.EventLoop nettyEventLoop()
<T> PromiseInternal<T> promise()
Promise associated with this context<T> PromiseInternal<T> promise(Handler<AsyncResult<T>> handler)
Promise associated with this context or the handler
if that handler is already an instance of PromiseInternal<T> Future<T> succeededFuture()
Future associated with this context<T> Future<T> succeededFuture(T result)
Future of the result associated with this context<T> Future<T> failedFuture(Throwable failure)
Future failed with the failure associated with this context<T> Future<T> failedFuture(String message)
Future failed with the message associated with this context<T> void executeBlocking(Handler<Promise<T>> blockingCodeHandler, TaskQueue queue, Handler<AsyncResult<T>> resultHandler)
Context.executeBlocking(Handler, boolean, Handler) but uses the queue to order the tasks instead
of the internal queue of this context.<T> Future<T> executeBlocking(Handler<Promise<T>> blockingCodeHandler, TaskQueue queue)
Context.executeBlocking(Handler, boolean) but uses the queue to order the tasks instead
of the internal queue of this context.<T> void executeBlockingInternal(Handler<Promise<T>> action, Handler<AsyncResult<T>> resultHandler)
<T> void executeBlockingInternal(Handler<Promise<T>> action, boolean ordered, Handler<AsyncResult<T>> resultHandler)
<T> Future<T> executeBlockingInternal(Handler<Promise<T>> action)
executeBlockingInternal(Handler, Handler) but returns a Future of the asynchronous result<T> Future<T> executeBlockingInternal(Handler<Promise<T>> action, boolean ordered)
executeBlockingInternal(Handler, boolean, Handler) but returns a Future of the asynchronous resultDeployment getDeployment()
nullVertxInternal owner()
<T> void emit(T argument,
Handler<T> task)
argument event to the task and switch on this context if necessary, this also associates the
current thread with the current context so Vertx.currentContext() returns this context.
execute(v -> dispatch(argument, task))argument - the task argumenttask - the handler to execute with the event argumentvoid emit(Handler<Void> task)
emit(Object, Handler)void execute(Handler<Void> task)
execute(Object, Handler)void execute(Runnable task)
task on this context, it will be executed according to the
context concurrency model.task - the task to execute<T> void execute(T argument,
Handler<T> task)
task on this context, the task will be executed according to the
context concurrency model.argument - the task argumenttask - the task to executeboolean isRunningOnContext()
void dispatch(Runnable handler)
dispatch(Handler)void dispatch(Handler<Void> handler)
dispatch(Object, Handler)<E> void dispatch(E event,
Handler<E> handler)
event to the handler on this context.
The handler is executed directly by the caller thread which must be a VertxThread or a FastThreadLocalThread.
The handler execution is monitored by the blocked thread checker.
This context is thread-local associated during the task execution.
event - the event for the handlerhandler - the handler to execute with the eventContextInternal beginDispatch()
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 dispatch(Object, Handler)
null if there is noneIllegalStateException - when the current thread of execution cannot execute this taskvoid endDispatch(ContextInternal previous)
beginDispatch()
You should not use this API directly, instead you should use dispatch(Object, Handler)
previous - the previous context to restore or null if there is noneIllegalStateException - when the current thread of execution cannot execute this taskvoid reportException(Throwable t)
The exception handler will be called when there is one, otherwise the exception will be logged.
t - the exception to reportConcurrentMap<Object,Object> contextData()
ConcurrentMap used to store context dataContext.get(String),
Context.put(String, Object)ConcurrentMap<Object,Object> localContextData()
ConcurrentMap used to store local context dataClassLoader classLoader()
WorkerPool workerPool()
VertxTracer tracer()
ContextInternal duplicate()
The duplicate context has its own
long setPeriodic(long delay,
Handler<Long> handler)
Vertx.setPeriodic(long, Handler) except the periodic timer will fire on this context.long setTimer(long delay,
Handler<Long> handler)
Vertx.setTimer(long, Handler) except the timer will fire on this context.boolean isDeployment()
true when the context is associated with a deploymentvoid addCloseHook(Closeable hook)
The hook will be called when the associated resource needs to be released. Hooks are useful
for automatically cleanup resources when a Verticle is undeployed.
hook - the close hookvoid removeCloseHook(Closeable hook)
This is called when the resource is released explicitly and does not need anymore a managed close.
hook - the close hookCopyright © 2021. All rights reserved.