APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.nio.ch

pack-priv Class Invoker

extends Object
Class Inheritance
Imports
java.nio.channels.*, java.util.concurrent.*, jdk.internal.misc.InnocuousThread

Defines static methods to invoke a completion handler or arbitrary task.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final int
private static final ThreadLocal<Invoker.GroupAndInvokeCount>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
bindToGroup(AsynchronousChannelGroupImpl group)

Binds this thread to the given group

pack-priv static Invoker.GroupAndInvokeCount
getGroupAndInvokeCount()

Returns the GroupAndInvokeCount object for this thread.

pack-priv static <V, A> void
invoke(AsynchronousChannel channel, CompletionHandler<V, ? super A> handler, A attachment, V result, Throwable exc)

Invokes the handler.

pack-priv static <V, A> void
invoke(PendingFuture<V, A> future)

Invoke handler with completed result.

pack-priv static <V, A> void
invokeDirect(Invoker.GroupAndInvokeCount myGroupAndInvokeCount, CompletionHandler<V, ? super A> handler, A attachment, V result, Throwable exc)

Invoke handler assuming thread identity already checked

pack-priv static <V, A> void
invokeIndirectly(AsynchronousChannel channel, final CompletionHandler<V, ? super A> handler, final A attachment, final V result, final Throwable exc)

Invokes the handler indirectly via the channel group's thread pool.

pack-priv static <V, A> void
invokeIndirectly(final CompletionHandler<V, ? super A> handler, final A attachment, final V value, final Throwable exc, Executor executor)

Invokes the handler "indirectly" in the given Executor

pack-priv static <V, A> void
invokeIndirectly(PendingFuture<V, A> future)

Invoke handler with completed result.

pack-priv static void
invokeOnThreadInThreadPool(Groupable channel, Runnable task)

Invokes the given task on the thread pool associated with the given channel.

pack-priv static <V, A> void
invokeUnchecked(CompletionHandler<V, ? super A> handler, A attachment, V value, Throwable exc)

Invoke handler without checking the thread identity or number of handlers on the thread stack.

pack-priv static <V, A> void
invokeUnchecked(PendingFuture<V, A> future)

Invoke handler with completed result.

pack-priv static boolean
isBoundToAnyGroup()

Returns true if the current thread is in a channel group's thread pool

pack-priv static boolean
mayInvokeDirect(Invoker.GroupAndInvokeCount myGroupAndInvokeCount, AsynchronousChannelGroupImpl group)

Returns true if the current thread is in the given channel's thread pool and we haven't exceeded the maximum number of handler frames on the stack.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

maxHandlerInvokeCountback to summary
private static final int maxHandlerInvokeCount
myGroupAndInvokeCountback to summary
private static final ThreadLocal<Invoker.GroupAndInvokeCount> myGroupAndInvokeCount

Constructor Detail

Invokerback to summary
private Invoker()

Method Detail

bindToGroupback to summary
pack-priv static void bindToGroup(AsynchronousChannelGroupImpl group)

Binds this thread to the given group

getGroupAndInvokeCountback to summary
pack-priv static Invoker.GroupAndInvokeCount getGroupAndInvokeCount()

Returns the GroupAndInvokeCount object for this thread.

invokeback to summary
pack-priv static <V, A> void invoke(AsynchronousChannel channel, CompletionHandler<V, ? super A> handler, A attachment, V result, Throwable exc)

Invokes the handler. If the current thread is in the channel group's thread pool then the handler is invoked directly, otherwise it is invoked indirectly.

invokeback to summary
pack-priv static <V, A> void invoke(PendingFuture<V, A> future)

Invoke handler with completed result. If the current thread is in the channel group's thread pool then the handler is invoked directly, otherwise it is invoked indirectly.

invokeDirectback to summary
pack-priv static <V, A> void invokeDirect(Invoker.GroupAndInvokeCount myGroupAndInvokeCount, CompletionHandler<V, ? super A> handler, A attachment, V result, Throwable exc)

Invoke handler assuming thread identity already checked

invokeIndirectlyback to summary
pack-priv static <V, A> void invokeIndirectly(AsynchronousChannel channel, final CompletionHandler<V, ? super A> handler, final A attachment, final V result, final Throwable exc)

Invokes the handler indirectly via the channel group's thread pool.

invokeIndirectlyback to summary
pack-priv static <V, A> void invokeIndirectly(final CompletionHandler<V, ? super A> handler, final A attachment, final V value, final Throwable exc, Executor executor)

Invokes the handler "indirectly" in the given Executor

invokeIndirectlyback to summary
pack-priv static <V, A> void invokeIndirectly(PendingFuture<V, A> future)

Invoke handler with completed result. The handler is invoked indirectly, via the channel group's thread pool.

invokeOnThreadInThreadPoolback to summary
pack-priv static void invokeOnThreadInThreadPool(Groupable channel, Runnable task)

Invokes the given task on the thread pool associated with the given channel. If the current thread is in the thread pool then the task is invoked directly.

invokeUncheckedback to summary
pack-priv static <V, A> void invokeUnchecked(CompletionHandler<V, ? super A> handler, A attachment, V value, Throwable exc)

Invoke handler without checking the thread identity or number of handlers on the thread stack.

invokeUncheckedback to summary
pack-priv static <V, A> void invokeUnchecked(PendingFuture<V, A> future)

Invoke handler with completed result. This method does not check the thread identity or the number of handlers on the thread stack.

isBoundToAnyGroupback to summary
pack-priv static boolean isBoundToAnyGroup()

Returns true if the current thread is in a channel group's thread pool

mayInvokeDirectback to summary
pack-priv static boolean mayInvokeDirect(Invoker.GroupAndInvokeCount myGroupAndInvokeCount, AsynchronousChannelGroupImpl group)

Returns true if the current thread is in the given channel's thread pool and we haven't exceeded the maximum number of handler frames on the stack.

sun.nio.ch back to summary

pack-priv Class Invoker.GroupAndInvokeCount

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final AsynchronousChannelGroupImpl
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv AsynchronousChannelGroupImpl
pack-priv void
pack-priv int
pack-priv void
pack-priv void
setInvokeCount(int value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

groupback to summary
private final AsynchronousChannelGroupImpl group
handlerInvokeCountback to summary
private int handlerInvokeCount

Constructor Detail

GroupAndInvokeCountback to summary
pack-priv GroupAndInvokeCount(AsynchronousChannelGroupImpl group)

Method Detail

groupback to summary
pack-priv AsynchronousChannelGroupImpl group()
incrementInvokeCountback to summary
pack-priv void incrementInvokeCount()
invokeCountback to summary
pack-priv int invokeCount()
resetInvokeCountback to summary
pack-priv void resetInvokeCount()
setInvokeCountback to summary
pack-priv void setInvokeCount(int value)