Interface Invocable
- All Known Subinterfaces:
Callback
- All Known Implementing Classes:
AbstractConnection.ReadCallback, AsyncMiddleManServlet.ProxyDeferredContentProvider, AsyncMiddleManServlet.ProxyReader, AsyncMiddleManServlet.ProxyResponseListener, AsyncProxyServlet.StreamReader, Callback.Completable, Callback.Completing, Callback.Nested, ChannelEndPoint.RunnableCloseable, ChannelEndPoint.RunnableTask, CompletableCallback, CountingCallback, DeferredContentProvider, DeferredContentProvider.DeferredContentProviderIterator, Flusher.FlushCallback, Flusher.ShutdownResult, FutureCallback, Generator.Result, GzipHttpOutputInterceptor.GzipBufferCB, HttpChannel.Send100Callback, HttpChannel.SendCallback, HttpConnection.AsyncReadCallback, HttpConnection.BlockingReadCallback, HttpConnection.Content, HttpConnection.SendCallback, HttpContent, HttpDestination, HttpDestinationOverFCGI, HttpDestinationOverHTTP, HttpInput.Content, HttpInput.EofContent, HttpInput.SentinelContent, HttpOutput.AsyncFlush, HttpOutput.AsyncWrite, HttpOutput.ChannelWriteCB, HttpOutput.InputStreamWritingCB, HttpOutput.NestedChannelWriteCB, HttpOutput.ReadableByteChannelWritingCB, HttpOutput.WriteCompleteCB, HttpSender.CommitCallback, HttpSender.ContentCallback, HttpSender.LastCallback, HttpSenderOverHTTP.ByteBufferRecyclerCallback, HttpSenderOverHTTP.HeadersCallback, InputStreamContentProvider, IteratingCallback, IteratingNestedCallback, MultiPartContentProvider.MultiPartIterator, MultiplexHttpDestination, MultiplexHttpDestinationOverFCGI, OutputStreamContentProvider, PoolingHttpDestination, ProxyConnection.ProxyIteratingCallback, ProxyProtocolClientConnectionFactory.ProxyProtocolConnection, ProxyProtocolClientConnectionFactory.ProxyProtocolConnectionV1, ProxyProtocolClientConnectionFactory.ProxyProtocolConnectionV2, ProxyServlet.DelegatingContentProvider, ProxyServlet.ProxyInputStreamContentProvider, SharedBlockingCallback.Blocker, Socks4Proxy.Socks4ProxyConnection, SslConnection.DecryptedEndPoint.IncompleteWriteCallback, SslConnection.RunnableTask
public interface Invocable
A task (typically either a Runnable or 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 Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Invocable.InvocationTypedefault Invocable.InvocationTypestatic Invocable.InvocationTypeGet the invocation type of an Object.static voidinvokeNonBlocking(Runnable task) Invoke a task with the calling thread, tagged to indicate that it will not block.static booleanTest if the current thread has been tagged as non blocking
-
Field Details
-
__nonBlocking
-
-
Method Details
-
isNonBlockingInvocation
static boolean isNonBlockingInvocation()Test 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
-
getInvocationType
Get the invocation type of an 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
-