XNIO API 2.1.0.CR2

org.jboss.xnio.channels
Interface BoundServer<A,T extends BoundChannel<A>>

Type Parameters:
A - the type of address associated with this server
T - the bound channel type
All Superinterfaces:
Channel, Closeable, CloseableChannel, Configurable
All Known Subinterfaces:
AcceptingServer<A,T,C>, LocalServer, SslTcpServer, TcpServer, UdpServer

public interface BoundServer<A,T extends BoundChannel<A>>
extends CloseableChannel

A server that is bound to a local address, and which may accept connections.

Since:
1.2

Method Summary
 IoFuture<? extends T> bind(A address)
          Add a binding.
 ChannelListener.Setter<? extends T> getBindSetter()
          Get the bind listener setter for this channel.
 Collection<? extends T> getChannels()
          Get the channels representing the individual bound servers.
 ChannelListener.Setter<? extends BoundServer<A,T>> getCloseSetter()
          Get the setter which can be used to change the close listener for this channel.
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 
Methods inherited from interface org.jboss.xnio.channels.Configurable
getOption, setOption, supportsOption
 

Method Detail

getChannels

Collection<? extends T> getChannels()
Get the channels representing the individual bound servers. The collection is a snapshot view of the bound channels; modifications to the collection are not allowed. However the channels within the collection are live references to the bindings that exist at the time this method is called; these channels may be closed to unbind the channel.

Returns:
the channels

bind

IoFuture<? extends T> bind(A address)
Add a binding. The returned channel may be used to close the binding.

Parameters:
address - the address to bind to
Returns:
a future channel representing the binding

getBindSetter

ChannelListener.Setter<? extends T> getBindSetter()
Get the bind listener setter for this channel. The listener is called every time a channel is bound.

Returns:
the listener setter

getCloseSetter

ChannelListener.Setter<? extends BoundServer<A,T>> 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
Returns:
the setter

XNIO API 2.1.0.CR2

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