Context implementations.
| Modifier and Type | Field and Description |
|---|---|
| private final CloseFuture | |
| private final JsonObject | config
References Deprecated
JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private ConcurrentMap | |
| private final Deployment | |
| pack-priv static final boolean | |
| private static final String | |
| private final EventLoop | |
| private volatile Handler | |
| pack-priv final WorkerTaskQueue | |
| private final EventExecutor | |
| pack-priv final TaskQueue | |
| pack-priv final WorkerPool | |
| private static final Logger | |
| private final VertxImpl | |
| private final ClassLoader | |
| private final ThreadingModel | |
| pack-priv final WorkerPool |
| Access | Constructor and Description |
|---|---|
| public | ContextImpl(VertxImpl vertx, int localsLength, ThreadingModel threadingModel, EventLoop eventLoop, EventExecutor executor, WorkerPool internalWorkerPool, WorkerPool workerPool, Deployment deployment, CloseFuture closeFuture, ClassLoader tccl)
|
| Modifier and Type | Method and Description |
|---|---|
| public ClassLoader | |
| public Future | close()
Implements io. Close this context, cleanup close future hooks then dispose pending ordered task queue. |
| public CloseFuture | |
| public JsonObject | config()
Implements io.
References Deprecated
JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.
If the context is associated with a Verticle deployment, this returns the configuration that was specified when the verticle was deployed. |
| public synchronized ConcurrentMap | |
| public ContextInternal | duplicate()
Implements io. Returns a context sharing with this context
|
| public <T> void | emit(T
the argument, Handler<T> task argumentthe handler to execute with the task)event argumentImplements io. Emit the given |
| protected <T> void | |
| public Context | |
| public Handler | |
| public void | execute(Runnable
the task to execute task)Implements io. Execute the |
| public final <T> void | execute(T
the argument, Handler<T> task argumentthe task to execute task)Implements io. Execute a |
| protected void | |
| protected <T> void | execute(ContextInternal ctx, T argument, Handler<T> task)
|
| public <T> Future | executeBlocking(Handler<Promise<T>> blockingCodeHandler, boolean ordered)
Implements io. Same as |
| public <T> Future | executeBlocking(Callable<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)Implements io. Safely execute some blocking code. |
| public <T> Future | executeBlocking(Handler<Promise<T>> blockingCodeHandler, TaskQueue queue)
Implements io. Like |
| public <T> Future | executeBlocking(Callable<T> blockingCodeHandler, TaskQueue queue)
Implements io.
|
| pack-priv static <T> Future | executeBlocking(ContextInternal context, Callable<T> blockingCodeHandler, WorkerPool workerPool, TaskQueue queue)
|
| pack-priv static <T> Future | executeBlocking(ContextInternal context, Handler<Promise<T>> blockingCodeHandler, WorkerPool workerPool, TaskQueue queue)
|
| public <T> Future | executeBlockingInternal(Handler<Promise<T>> action)
Implements io. Like |
| public <T> Future | executeBlockingInternal(Callable<T> action)
Implements io.
|
| public <T> Future | executeBlockingInternal(Handler<Promise<T>> action, boolean ordered)
Implements io. Like |
| public <T> Future | executeBlockingInternal(Callable<T> action, boolean ordered)
Implements io.
|
| public EventExecutor | |
| public Deployment | |
| private static <T> Future | internalExecuteBlocking(ContextInternal context, Handler<Promise<T>> blockingCodeHandler, WorkerPool workerPool, TaskQueue queue)
|
| public boolean | |
| public boolean | isEventLoopContext()
Implements io. Is the current context an event loop context? |
| public boolean | isWorkerContext()
Implements io. Is the current context a worker context? |
| public EventLoop | nettyEventLoop()
Implements io. Return the Netty EventLoop used by this Context. |
| public VertxImpl | |
| public void | reportException(Throwable
the exception to report t)Implements io. Report an exception to this context synchronously. |
| protected void | |
| pack-priv static <T> void | |
| public ThreadingModel | |
| public VertxTracer | |
| public WorkerPool |
| closeFuture | back to summary |
|---|---|
| private final CloseFuture closeFuture | |
| config | back to summary |
|---|---|
| private final JsonObject config
References Deprecated
See corresponding docs for further information. | |
| data | back to summary |
|---|---|
| private ConcurrentMap<Object, Object> data | |
| deployment | back to summary |
|---|---|
| private final Deployment deployment | |
| DISABLE_TIMINGS | back to summary |
|---|---|
| pack-priv static final boolean DISABLE_TIMINGS | |
| DISABLE_TIMINGS_PROP_NAME | back to summary |
|---|---|
| private static final String DISABLE_TIMINGS_PROP_NAME | |
| eventLoop | back to summary |
|---|---|
| private final EventLoop eventLoop | |
| exceptionHandler | back to summary |
|---|---|
| private volatile Handler<Throwable> exceptionHandler | |
| executeBlockingTasks | back to summary |
|---|---|
| pack-priv final WorkerTaskQueue executeBlockingTasks | |
| executor | back to summary |
|---|---|
| private final EventExecutor executor | |
| internalOrderedTasks | back to summary |
|---|---|
| pack-priv final TaskQueue internalOrderedTasks | |
| internalWorkerPool | back to summary |
|---|---|
| pack-priv final WorkerPool internalWorkerPool | |
| log | back to summary |
|---|---|
| private static final Logger log | |
| owner | back to summary |
|---|---|
| private final VertxImpl owner | |
| tccl | back to summary |
|---|---|
| private final ClassLoader tccl | |
| threadingModel | back to summary |
|---|---|
| private final ThreadingModel threadingModel | |
| workerPool | back to summary |
|---|---|
| pack-priv final WorkerPool workerPool | |
| ContextImpl | back to summary |
|---|---|
| public ContextImpl(VertxImpl vertx, int localsLength, ThreadingModel threadingModel, EventLoop eventLoop, EventExecutor executor, WorkerPool internalWorkerPool, WorkerPool workerPool, Deployment deployment, CloseFuture closeFuture, ClassLoader tccl) | |
| classLoader | back to summary |
|---|---|
| public ClassLoader classLoader() Implements io.
| |
| close | back to summary |
|---|---|
| public Future Implements io. Doc from io. Close this context, cleanup close future hooks then dispose pending ordered task queue. | |
| closeFuture | back to summary |
|---|---|
| public CloseFuture closeFuture() Implements io.
| |
| config | back to summary |
|---|---|
| public JsonObject config() Implements io. Doc from io. References Deprecated
See corresponding docs for further information. If the context is associated with a Verticle deployment, this returns the configuration that was specified when the verticle was deployed.
| |
| contextData | back to summary |
|---|---|
| public synchronized ConcurrentMap Implements io.
| |
| duplicate | back to summary |
|---|---|
| public ContextInternal duplicate() Implements io. Doc from io. 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) Implements io. Doc from io. Emit the given | |
| emit | back to summary |
|---|---|
| protected <T> void emit(ContextInternal ctx, T argument, Handler<T> task) | |
| exceptionHandler | back to summary |
|---|---|
public Context exceptionHandler(Handler<Throwable> handler)
| |
| exceptionHandler | back to summary |
|---|---|
| public Handler Implements io.
| |
| execute | back to summary |
|---|---|
| public void execute(Runnable task) Implements io. Doc from io. Execute the | |
| execute | back to summary |
|---|---|
| public final <T> void execute(T argument, Handler<T> task) Implements io. Doc from io. Execute a | |
| execute | back to summary |
|---|---|
| protected void execute(ContextInternal ctx, Runnable task) | |
| execute | back to summary |
|---|---|
protected <T> void execute(ContextInternal ctx, T argument, Handler<T> task)
| |
| executeBlocking | back to summary |
|---|---|
| public <T> Future Implements io. Doc from io. Same as
| |
| executeBlocking | back to summary |
|---|---|
| public <T> Future 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. 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
| |
| executeBlocking | back to summary |
|---|---|
| public <T> Future Implements io. Doc from io. Like
| |
| executeBlocking | back to summary |
|---|---|
| public <T> Future Implements io.
| |
| executeBlocking | back to summary |
|---|---|
| pack-priv static <T> Future | |
| executeBlocking | back to summary |
|---|---|
| pack-priv static <T> Future | |
| executeBlockingInternal | back to summary |
|---|---|
| public <T> Future Implements io. Doc from io. Like
| |
| executeBlockingInternal | back to summary |
|---|---|
| public <T> Future Implements io.
| |
| executeBlockingInternal | back to summary |
|---|---|
| public <T> Future Implements io. Doc from io. Like
| |
| executeBlockingInternal | back to summary |
|---|---|
| public <T> Future Implements io.
| |
| executor | back to summary |
|---|---|
| public EventExecutor executor() Implements io.
| |
| getDeployment | back to summary |
|---|---|
| public Deployment getDeployment() Implements io.
| |
| internalExecuteBlocking | back to summary |
|---|---|
| private static <T> Future | |
| inThread | back to summary |
|---|---|
| public boolean inThread() Implements io.
| |
| isEventLoopContext | back to summary |
|---|---|
| public boolean isEventLoopContext() Implements io. Doc from io. Is the current context an event loop context? Note when running blocking code using
| |
| isWorkerContext | back to summary |
|---|---|
| public boolean isWorkerContext() Implements io. Doc from io. Is the current context a worker context? Note when running blocking code using
| |
| nettyEventLoop | back to summary |
|---|---|
| public EventLoop nettyEventLoop() Implements io. Doc from io. 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 VertxImpl owner() Implements io.
| |
| reportException | back to summary |
|---|---|
| public void reportException(Throwable t) Implements io. Doc from io. 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 |
|---|---|
| protected void runOnContext(ContextInternal ctx, Handler<Void> action) | |
| setResultHandler | back to summary |
|---|---|
| pack-priv static <T> void setResultHandler(ContextInternal ctx, Future<T> fut, Handler<AsyncResult<T>> resultHandler) | |
| threadingModel | back to summary |
|---|---|
| public ThreadingModel threadingModel() Implements io.
| |
| tracer | back to summary |
|---|---|
| public VertxTracer Implements io.
| |
| workerPool | back to summary |
|---|---|
| public WorkerPool workerPool() Implements io.
| |