Top Description Methods
org.xnio.channels

public Interface SuspendableAcceptChannel

extends CloseableChannel
Known Direct Subinterfaces
org.xnio.channels.SimpleAcceptingChannel
Imports
java.io.IOException, .InterruptedIOException, java.util.concurrent.TimeUnit, org.xnio.ChannelListener, .XnioExecutor, .XnioIoThread

A suspendable accept channel. This type of channel is associated with a listener which can suspend and resume accepting connections as needed.
Since
3.0

Method Summary

Modifier and TypeMethod and Description
public void
awaitAcceptable()

Block until this channel becomes acceptable again.

public void
awaitAcceptable(long
the time to wait
time
,
TimeUnit
the time unit
timeUnit
)

Block until this channel becomes acceptable again, or until the timeout expires.

public ChannelListener.Setter<? extends SuspendableAcceptChannel>

Returns:

the setter
getAcceptSetter
()

Get the setter which can be used to change the accept listener for this channel.

public XnioExecutor

Returns:

the thread
getAcceptThread
()
Deprecated The getIoThread() method should be used instead.

Get an accept thread for this channel.

public ChannelListener.Setter<? extends SuspendableAcceptChannel>
getCloseSetter()

Redeclares org.xnio.channels.CloseableChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel.

public XnioIoThread

Returns:

the thread
getIoThread
()

Redeclares org.xnio.channels.CloseableChannel.getIoThread.

Get an accept thread for this channel.

public boolean

Returns:

true if accepts are resumed, false if accepts are suspended
isAcceptResumed
()

Determine whether accepts are resumed.

public void
resumeAccepts()

Resume reads on this channel.

public void
suspendAccepts()

Suspend further read notifications on this channel.

public void
wakeupAccepts()
Deprecated Users should instead submit Runnable tasks to the channel thread when this functionality is needed.

resumeAccepts() Resume accepts} on this channel, and force the accept listener to be triggered even if the channel isn't actually ready.

Inherited from org.xnio.channels.CloseableChannel:
closegetWorker

Method Detail

awaitAcceptableback to summary
public void awaitAcceptable() throws IOException

Block until this channel becomes acceptable again. This method may return spuriously before the channel becomes acceptable.

Exceptions
IOException:
if an I/O error occurs
InterruptedIOException:
if the operation is interrupted; the thread's interrupt flag will be set as well
awaitAcceptableback to summary
public void awaitAcceptable(long time, TimeUnit timeUnit) throws IOException

Block until this channel becomes acceptable again, or until the timeout expires. This method may return spuriously before the channel becomes acceptable or the timeout expires.

Parameters
time:long

the time to wait

timeUnit:TimeUnit

the time unit

Exceptions
IOException:
if an I/O error occurs
InterruptedIOException:
if the operation is interrupted; the thread's interrupt flag will be set as well
getAcceptSetterback to summary
public ChannelListener.Setter<? extends SuspendableAcceptChannel> getAcceptSetter()

Get the setter which can be used to change the accept listener for this channel.

Returns:ChannelListener.Setter<? extends SuspendableAcceptChannel>

the setter

getAcceptThreadback to summary
public XnioExecutor getAcceptThread()

Deprecated

The getIoThread() method should be used instead.

Get an accept thread for this channel. If more than one is configured, any of them may be returned.

Returns:XnioExecutor

the thread

Annotations
@Deprecated
getCloseSetterback to summary
public ChannelListener.Setter<? extends SuspendableAcceptChannel> getCloseSetter()

Redeclares org.xnio.channels.CloseableChannel.getCloseSetter.

Doc from org.xnio.channels.CloseableChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.

Returns:ChannelListener.Setter<? extends SuspendableAcceptChannel>

the setter

getIoThreadback to summary
public XnioIoThread getIoThread()

Redeclares org.xnio.channels.CloseableChannel.getIoThread.

Get an accept thread for this channel. If more than one is configured, any of them may be returned.

Returns:XnioIoThread

the thread

isAcceptResumedback to summary
public boolean isAcceptResumed()

Determine whether accepts are resumed.

Returns:boolean

true if accepts are resumed, false if accepts are suspended

resumeAcceptsback to summary
public void resumeAccepts()

Resume reads on this channel. The accept listener will be called as soon as there is a connection available to be accepted.

suspendAcceptsback to summary
public void suspendAccepts()

Suspend further read notifications on this channel.

wakeupAcceptsback to summary
public void wakeupAccepts()

Deprecated

Users should instead submit Runnable tasks to the channel thread when this functionality is needed.

resumeAccepts() Resume accepts} on this channel, and force the accept listener to be triggered even if the channel isn't actually ready.

Annotations
@Deprecated