XNIO API 2.0.0.GA

org.jboss.xnio
Interface TcpServer

All Superinterfaces:
AcceptingServer<java.net.InetSocketAddress,BoundChannel<java.net.InetSocketAddress>,TcpChannel>, BoundServer<java.net.InetSocketAddress,BoundChannel<java.net.InetSocketAddress>>, java.nio.channels.Channel, java.io.Closeable, CloseableChannel, Configurable

public interface TcpServer
extends AcceptingServer<java.net.InetSocketAddress,BoundChannel<java.net.InetSocketAddress>,TcpChannel>

A TCP server convenience interface.


Method Summary
 ChannelListener.Setter<? extends BoundChannel<java.net.InetSocketAddress>> getBindSetter()
          Get the bind handler setter for this channel.
 ChannelListener.Setter<? extends TcpServer> getCloseSetter()
          Get the setter which can be used to change the close handler for this channel.
 ChannelListener.Setter<? extends TcpChannel> getOpenSetter()
          Get the open handler setter for this server.
 
Methods inherited from interface org.jboss.xnio.channels.BoundServer
bind, getChannels
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 
Methods inherited from interface org.jboss.xnio.channels.Configurable
getOption, setOption, supportsOption
 

Method Detail

getBindSetter

ChannelListener.Setter<? extends BoundChannel<java.net.InetSocketAddress>> getBindSetter()
Get the bind handler setter for this channel. The handler is called every time a channel is bound.

Specified by:
getBindSetter in interface AcceptingServer<java.net.InetSocketAddress,BoundChannel<java.net.InetSocketAddress>,TcpChannel>
Specified by:
getBindSetter in interface BoundServer<java.net.InetSocketAddress,BoundChannel<java.net.InetSocketAddress>>
Returns:
the listener setter

getCloseSetter

ChannelListener.Setter<? extends TcpServer> getCloseSetter()
Get the setter which can be used to change the close handler for this channel. If the channel is already closed, then the handler will not be called.

Specified by:
getCloseSetter in interface AcceptingServer<java.net.InetSocketAddress,BoundChannel<java.net.InetSocketAddress>,TcpChannel>
Specified by:
getCloseSetter in interface BoundServer<java.net.InetSocketAddress,BoundChannel<java.net.InetSocketAddress>>
Specified by:
getCloseSetter in interface CloseableChannel
Returns:
the setter

getOpenSetter

ChannelListener.Setter<? extends TcpChannel> getOpenSetter()
Get the open handler setter for this server. The handler will be called each time a connection is accepted. If the handler is null, the channel will be immediately closed.

Specified by:
getOpenSetter in interface AcceptingServer<java.net.InetSocketAddress,BoundChannel<java.net.InetSocketAddress>,TcpChannel>
Returns:
the open setter

XNIO API 2.0.0.GA

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