XNIO API 3.0.7.GA

org.xnio.channels
Interface SimpleAcceptingChannel<C extends CloseableChannel>

Type Parameters:
C - the channel type
All Superinterfaces:
Channel, Closeable, CloseableChannel, Configurable, InterruptibleChannel, SuspendableAcceptChannel
All Known Subinterfaces:
AcceptingChannel<C>

public interface SimpleAcceptingChannel<C extends CloseableChannel>
extends SuspendableAcceptChannel

A channel which can accept connections.

Author:
David M. Lloyd

Method Summary
 C accept()
          Attempt to accept a connection.
 ChannelListener.Setter<? extends SimpleAcceptingChannel<C>> getAcceptSetter()
          Get the setter which can be used to change the accept listener for this channel.
 ChannelListener.Setter<? extends SimpleAcceptingChannel<C>> getCloseSetter()
          Get the setter which can be used to change the close listener for this channel.
 
Methods inherited from interface org.xnio.channels.SuspendableAcceptChannel
awaitAcceptable, awaitAcceptable, resumeAccepts, suspendAccepts, wakeupAccepts
 
Methods inherited from interface org.xnio.channels.CloseableChannel
close, getWorker
 
Methods inherited from interface java.nio.channels.Channel
isOpen
 
Methods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
 

Method Detail

accept

C accept()
                                  throws IOException
Attempt to accept a connection.

Returns:
the new connection, or null if none is available
Throws:
IOException - if an I/O error occurs

getAcceptSetter

ChannelListener.Setter<? extends SimpleAcceptingChannel<C>> getAcceptSetter()
Get the setter which can be used to change the accept listener for this channel. When the listener is called, additional notifications are automatically suspended.

Specified by:
getAcceptSetter in interface SuspendableAcceptChannel
Returns:
the setter

getCloseSetter

ChannelListener.Setter<? extends SimpleAcceptingChannel<C>> 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.

Specified by:
getCloseSetter in interface CloseableChannel
Specified by:
getCloseSetter in interface SuspendableAcceptChannel
Returns:
the setter

XNIO API 3.0.7.GA

Copyright © 2010 JBoss, a division of Red Hat, Inc.