Top Description Inners Fields Constructors Methods
sun.nio.ch

pack-priv abstract Class Port

extends AsynchronousChannelGroupImpl
Class Inheritance
Known Direct Subclasses
sun.nio.ch.EPollPort
Imports
java.nio.channels.spi.AsynchronousChannelProvider, java.nio.channels.*, java.io.IOException, .Closeable, .FileDescriptor, java.util.Map, .HashMap, java.util.concurrent.locks.ReadWriteLock, .ReentrantReadWriteLock

Base implementation of AsynchronousChannelGroupImpl for Unix systems.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
Port.PollableChannel

Implemented by clients registered with this port.

Field Summary

Modifier and TypeField and Description
protected final Map<Integer, Port.PollableChannel>
protected final ReadWriteLock

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv final Object
attachForeignChannel(final Channel channel, FileDescriptor fd)

Implements abstract sun.nio.ch.AsynchronousChannelGroupImpl.attachForeignChannel.

Attaches a foreign channel to this group.

pack-priv final void
closeAllChannels()

Implements abstract sun.nio.ch.AsynchronousChannelGroupImpl.closeAllChannels.

Closes all channels in the group

pack-priv final void
detachForeignChannel(Object key)

Implements abstract sun.nio.ch.AsynchronousChannelGroupImpl.detachForeignChannel.

Detaches a foreign channel from this group.

pack-priv final boolean
isEmpty()

Implements abstract sun.nio.ch.AsynchronousChannelGroupImpl.isEmpty.

Returns true if there are no channels in the group

protected void
preUnregister(int fd)

Callback method for implementations that need special handling when fd is removed (currently only needed in the AIX-Port - see AixPollPort.java).

pack-priv final void
register(int fd, Port.PollableChannel ch)

Register channel identified by its file descriptor

pack-priv abstract void
startPoll(int fd, int events)

Register file descriptor with polling mechanism for given events.

pack-priv final void
unregister(int fd)

Unregister channel identified by its file descriptor

Inherited from sun.nio.ch.AsynchronousChannelGroupImpl:
awaitTerminationdetachFromThreadPoolexecuteexecuteOnHandlerTaskexecuteOnPooledThreadexecutorfixedThreadCountisFixedThreadPoolisShutdownisTerminatedofferTaskpollTaskscheduleshutdownshutdownHandlerTasksshutdownNowstartThreadsthreadCountthreadExit

Field Detail

fdToChannelback to summary
protected final Map<Integer, Port.PollableChannel> fdToChannel
fdToChannelLockback to summary
protected final ReadWriteLock fdToChannelLock

Constructor Detail

Portback to summary
pack-priv Port(AsynchronousChannelProvider provider, ThreadPool pool)

Method Detail

attachForeignChannelback to summary
pack-priv final Object attachForeignChannel(final Channel channel, FileDescriptor fd)

Implements abstract sun.nio.ch.AsynchronousChannelGroupImpl.attachForeignChannel.

Doc from sun.nio.ch.AsynchronousChannelGroupImpl.attachForeignChannel.

Attaches a foreign channel to this group.

Annotations
@Override
closeAllChannelsback to summary
pack-priv final void closeAllChannels()

Implements abstract sun.nio.ch.AsynchronousChannelGroupImpl.closeAllChannels.

Doc from sun.nio.ch.AsynchronousChannelGroupImpl.closeAllChannels.

Closes all channels in the group

Annotations
@Override
detachForeignChannelback to summary
pack-priv final void detachForeignChannel(Object key)

Implements abstract sun.nio.ch.AsynchronousChannelGroupImpl.detachForeignChannel.

Doc from sun.nio.ch.AsynchronousChannelGroupImpl.detachForeignChannel.

Detaches a foreign channel from this group.

Annotations
@Override
isEmptyback to summary
pack-priv final boolean isEmpty()

Implements abstract sun.nio.ch.AsynchronousChannelGroupImpl.isEmpty.

Doc from sun.nio.ch.AsynchronousChannelGroupImpl.isEmpty.

Returns true if there are no channels in the group

Annotations
@Override
preUnregisterback to summary
protected void preUnregister(int fd)

Callback method for implementations that need special handling when fd is removed (currently only needed in the AIX-Port - see AixPollPort.java).

registerback to summary
pack-priv final void register(int fd, Port.PollableChannel ch)

Register channel identified by its file descriptor

startPollback to summary
pack-priv abstract void startPoll(int fd, int events)

Register file descriptor with polling mechanism for given events. The implementation should translate the events as required.

unregisterback to summary
pack-priv final void unregister(int fd)

Unregister channel identified by its file descriptor

sun.nio.ch back to summary

pack-priv Interface Port.PollableChannel

extends Closeable
Known Direct Implementers
sun.nio.ch.UnixAsynchronousServerSocketChannelImpl, sun.nio.ch.UnixAsynchronousSocketChannelImpl

Implemented by clients registered with this port.

Method Summary

Modifier and TypeMethod and Description
public void
onEvent(int events, boolean mayInvokeDirect)

Inherited from java.io.Closeable:
close

Method Detail

onEventback to summary
public void onEvent(int events, boolean mayInvokeDirect)