Interface Invocable
- All Known Subinterfaces:
 Blocker.Callback, Blocker.Promise<C>, Blocker.Runnable, Callback, Callback.Completing, Handler, Handler.Collection, Handler.Container, Handler.Singleton, HandlerContainer, HttpChannel, HttpClientTransport, HttpStream, Invocable.Callable, Invocable.Task, Promise.Invocable<R>, Request.Handler
- All Known Implementing Classes:
 AbstractConnectorHttpClientTransport, AbstractHandler, AbstractHandlerContainer, AbstractHttpClientTransport, AsyncMiddleManServlet.ProxyReader, AsyncMiddleManServlet.ProxyReader, AsyncMiddleManServlet.ProxyReader, AsyncMiddleManServlet.ProxyReader, AsyncMiddleManServlet.ProxyResponseListener, AsyncMiddleManServlet.ProxyResponseListener, AsyncMiddleManServlet.ProxyResponseListener, AsyncMiddleManServlet.ProxyResponseListener, AsyncMiddleManServlet.ProxyWriter, AsyncMiddleManServlet.ProxyWriter, AsyncMiddleManServlet.ProxyWriter, AsyncMiddleManServlet.ProxyWriter, AsyncProxyServlet.StreamReader, AsyncProxyServlet.StreamReader, AsyncProxyServlet.StreamReader, AsyncProxyServlet.StreamReader, BufferedResponseHandler, Callback.Completable, Callback.Nested, CompressionHandler, ConditionalHandler, ConditionalHandler.Abstract, ConditionalHandler.DontHandle, ConditionalHandler.ElseNext, ConditionalHandler.Reject, ConditionalHandler.SkipNext, ConnectHandler, ConstraintSecurityHandler, ConstraintSecurityHandler, ContentSourceCompletableFuture, ContextHandler, ContextHandler.CoreContextHandler, ContextHandler.CoreContextHandler, ContextHandler.CoreContextRequest, ContextHandler.CoreContextRequest, ContextHandlerCollection, ContextRequest, ControlFlusher, CoreAppContext, CountingCallback, CrossOriginHandler, DebugHandler, DefaultHandler, DelayedHandler, DoSHandler, DoSHandler.DelayedRejectHandler, DoSHandler.StatusRejectHandler, DumpHandler, EagerContentHandler, EagerContentHandler.RetainedContentLoaderFactory.RetainedContentLoader, EagerFormHandler, EagerFormHandler, EchoHandler, EchoHandler.Buffered, EchoHandler.BufferedAsync, EchoHandler.Reactive, EchoHandler.Stream, ErrorHandler, ErrorHandler, ErrorHandler, ErrorPageErrorHandler, ErrorPageErrorHandler, EventsHandler, FastCGIProxyHandler, FormFields, FutureCallback, GracefulHandler, GzipHandler, GzipResponseAndCallback, Handler.Abstract, Handler.Abstract.NonBlocking, Handler.AbstractContainer, Handler.Sequence, Handler.Wrapper, HotSwapHandler, HTTP2Session.Entry, HTTP2Stream, HTTP2StreamEndPoint, HttpClientTransportDynamic, HttpClientTransportOverFCGI, HttpClientTransportOverHTTP, HttpClientTransportOverHTTP2, HttpClientTransportOverHTTP3, HttpDestination, HttpInput.Content, HttpInput.Content, HttpInput.EofContent, HttpInput.EofContent, HttpInput.ErrorContent, HttpInput.ErrorContent, HttpInput.SpecialContent, HttpInput.SpecialContent, HttpInput.WrappingContent, HttpInput.WrappingContent, HttpReceiver, HttpSpiContextHandler, HttpStream.Wrapper, IdleTimeoutHandler, InetAccessHandler, InstructionFlusher, Invocable.ReadyTask, Invocable.Task.Abstract, IteratingCallback, IteratingNestedCallback, LatencyRecordingHandler, MessageFlusher, MovedContextHandler, PathMappingsHandler, PathMappingsHandler.NoContext, Promise.Invocable.Abstract, Promise.Invocable.NonBlocking, ProxyHandler, ProxyHandler.Forward, ProxyHandler.ProxyResponseListener, ProxyHandler.Reverse, ProxyProtocolClientConnectionFactory.ProxyProtocolConnection, QoSHandler, ReHandlingErrorHandler, ReHandlingErrorHandler.ByHttpStatus, ResourceHandler, ResourceHandler.ResourceContext, RewriteHandler, SecuredRedirectHandler, SecurityHandler, SecurityHandler.PathMapped, SendHandlerCallback, SendHandlerCallback, SendHandlerCallback, SendHandlerCallback, Server, ServerWebSocketContainer, ServletContextHandler, ServletContextHandler, ServletContextRequest, ServletContextRequest, ServletHandler, ServletHandler, SessionHandler, SessionHandler, SessionHandler, SharedBlockingCallback.Blocker, ShutdownHandler, SizeLimitHandler, SizeLimitHandler, StateTrackingHandler, StaticAppContext, StatisticsHandler, StatisticsHandler.MinimumDataRateHandler, ThreadLimitHandler, TryPathsHandler, WebAppContext, WebAppContext, WebSocketDemander, WebSocketUpgradeHandler, WebSocketUpgradeHandler
public interface Invocable
A task (typically either a Runnable or Invocable.Callable
that declares how it will behave when invoked:
- blocking, the invocation will certainly block (e.g. performs blocking I/O)
 - non-blocking, the invocation will certainly not block
 - either, the invocation may block
 
Static methods and are provided that allow the current thread to be tagged
with a ThreadLocal to indicate if it has a blocking invocation type.
- 
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic enumThe behavior of anInvocabletask when it is called.static classARunnabledecorated with anInvocable.InvocationType.static interfaceARunnabletask with anInvocable.InvocationType. - 
Field Summary
Fields - 
Method Summary
Modifier and TypeMethodDescriptionstatic Runnablestatic Invocable.InvocationTypeCombine two invocation type.static Invocable.InvocationTypestatic Invocable.Taskfrom(Invocable.InvocationType type, Runnable task) Creates aInvocable.Taskfrom the given InvocationType and Runnable.default Invocable.InvocationTypestatic Invocable.InvocationTypeGet theInvocationTypeof the given object.static voidinvokeNonBlocking(Runnable task) Invoke a task with the calling thread, tagged to indicate that it will not block.static booleanTests if the current thread has been tagged as non-blocking. 
- 
Field Details
- 
NOOP
 - 
__nonBlocking
 
 - 
 - 
Method Details
- 
from
Creates a
Invocable.Taskfrom the given InvocationType and Runnable.- Parameters:
 type- the InvocationTypetask- the Runnable- Returns:
 - a new Task
 
 - 
isNonBlockingInvocation
static boolean isNonBlockingInvocation()Tests if the current thread has been tagged as non-blocking.- Returns:
 - True if the task the current thread is running has indicated that it will not block.
 
 - 
invokeNonBlocking
Invoke a task with the calling thread, tagged to indicate that it will not block.- Parameters:
 task- The task to invoke.
 - 
combine
Combine two invocation type.- Parameters:
 it1- A typeit2- Another type- Returns:
 - The combination of both type, where any tendency to block overrules any non-blocking.
 
 - 
combineTypes
 - 
getInvocationType
Get theInvocationTypeof the given object.- Parameters:
 o- The object to check the invocation type of.- Returns:
 - If the object is an Invocable, it is coerced and the 
getInvocationType()used, otherwiseInvocable.InvocationType.BLOCKINGis returned. 
 - 
getInvocationType
- Returns:
 - The InvocationType of this object
 
 - 
combine
 
 -