public abstract class NioServerSocketChannelFactory extends Object implements Cloneable
NioServerSocketChannelFactory
Created on Jan 3, 2012 at 12:08:30 PM| Modifier and Type | Field and Description |
|---|---|
protected Hashtable<String,Object> |
attributes |
protected AsynchronousChannelGroup |
threadGroup |
| Modifier | Constructor and Description |
|---|---|
protected |
NioServerSocketChannelFactory()
Create a new instance of
NioServerSocketChannelFactory |
protected |
NioServerSocketChannelFactory(AsynchronousChannelGroup threadGroup)
Create a new instance of
NioServerSocketChannelFactory |
| Modifier and Type | Method and Description |
|---|---|
abstract NioChannel |
acceptChannel(AsynchronousServerSocketChannel listener)
Wrapper function for accept().
|
static NioServerSocketChannelFactory |
createSecureFactory(AsynchronousChannelGroup threadGroup)
Create and configure a new secure
NioServerSocketChannelFactory
instance |
AsynchronousServerSocketChannel |
createServerChannel(int port)
Returns a server socket channel which uses all network interfaces on the
host, and is bound to a the specified port.
|
AsynchronousServerSocketChannel |
createServerChannel(int port,
int backlog)
Returns a server socket which uses all network interfaces on the host, is
bound to a the specified port, and uses the specified connection backlog.
|
abstract AsynchronousServerSocketChannel |
createServerChannel(int port,
int backlog,
InetAddress ifAddress,
boolean reuseAddress)
Returns a server socket channel which uses only the specified network
interface on the local host, is bound to a the specified port, and uses
the specified connection backlog.
|
static NioServerSocketChannelFactory |
createServerSocketChannelFactory(AsynchronousChannelGroup threadGroup,
boolean secure)
Create a new
NioServerSocketChannelFactory instance |
abstract void |
destroy()
Destroy the factory
|
static NioServerSocketChannelFactory |
getDefault()
Returns a copy of the environment's default socket factory.
|
static NioServerSocketChannelFactory |
getDefault(AsynchronousChannelGroup threadGroup)
Returns a copy of the environment's default socket factory.
|
abstract void |
handshake(NioChannel channel)
Extra function to initiate the handshake.
|
abstract void |
init()
Initialize the factory
|
abstract void |
initChannel(NioChannel channel)
Initialize the specified
NioChannel |
protected AsynchronousServerSocketChannel |
open()
Open an
AsynchronousServerSocketChannel |
void |
setAttribute(String name,
Object value)
General mechanism to pass attributes from the ServerConnector to the
socket factory.
|
protected AsynchronousChannelGroup threadGroup
protected NioServerSocketChannelFactory()
NioServerSocketChannelFactoryprotected NioServerSocketChannelFactory(AsynchronousChannelGroup threadGroup)
NioServerSocketChannelFactorythreadGroup - public abstract void init()
throws IOException
IOExceptionpublic abstract void destroy()
throws IOException
IOExceptionpublic void setAttribute(String name, Object value)
name - value - public static NioServerSocketChannelFactory getDefault()
public static NioServerSocketChannelFactory getDefault(AsynchronousChannelGroup threadGroup)
threadGroup - public static NioServerSocketChannelFactory createSecureFactory(AsynchronousChannelGroup threadGroup)
NioServerSocketChannelFactory
instancethreadGroup - the thread group that will be used with the server socketsNioServerSocketChannelFactory instancepublic static NioServerSocketChannelFactory createServerSocketChannelFactory(AsynchronousChannelGroup threadGroup, boolean secure)
NioServerSocketChannelFactory instancethreadGroup - the thread group that will be used with the server socketssecure - NioServerSocketChannelFactory instancepublic AsynchronousServerSocketChannel createServerChannel(int port) throws IOException
port - the port to listen toAsynchronousServerSocketChannelIOException - for networking errorspublic AsynchronousServerSocketChannel createServerChannel(int port, int backlog) throws IOException
port - the port to listen tobacklog - how many connections are queuedAsynchronousServerSocketChannelIOException - for networking errorspublic abstract AsynchronousServerSocketChannel createServerChannel(int port, int backlog, InetAddress ifAddress, boolean reuseAddress) throws IOException
port - the port to listen tobacklog - how many connections are queuedifAddress - the network interface address to usereuseAddress - AsynchronousServerSocketChannelIOException - for networking errorspublic abstract void initChannel(NioChannel channel) throws Exception
NioChannelchannel - The channel to be initializedExceptionpublic abstract NioChannel acceptChannel(AsynchronousServerSocketChannel listener) throws IOException
listener - The Asynchronous Server Socket channel that will accept a new
connectionNioChannel representing the new connectionIOExceptionpublic abstract void handshake(NioChannel channel) throws IOException
channel - IOExceptionprotected AsynchronousServerSocketChannel open() throws IOException
AsynchronousServerSocketChannelAsynchronousServerSocketChannelIOExceptionCopyright © 2016 JBoss by Red Hat. All rights reserved.