public abstract class AbstractSessionFactory extends Object implements IStreamSessionFactory
IStreamSessionFactory
interface.Modifier | Constructor and Description |
---|---|
protected |
AbstractSessionFactory()
Constructs a factory that creates the basic stream-oriented sessions.
|
protected |
AbstractSessionFactory(boolean ssl)
Constructs a factory that creates sessions of the given type (basic or
SSL/TLS).
|
Modifier and Type | Method and Description |
---|---|
void |
closed(ServerSocketChannel channel)
Notifies about closing and unregistering of a listening channel.
|
StreamSession |
create(SocketChannel channel)
Creates a stream-oriented session for a newly accepted connection.
|
protected abstract IStreamHandler |
createHandler(SocketChannel channel)
Creates a stream-oriented handler for a newly accepted connection.
|
void |
exception(ServerSocketChannel channel,
Throwable exception)
Notifies about an exception caught during processing of a listening
channel.
|
void |
registered(ServerSocketChannel channel)
Notifies about registration of a listening channel.
|
protected AbstractSessionFactory()
protected AbstractSessionFactory(boolean ssl)
ssl
- the type of created sessions. true
for SSL/TLS
sessions handshaking in server mode and false
for
basic stream-oriented sessions.public StreamSession create(SocketChannel channel) throws Exception
createHandler
method.create
in interface IStreamSessionFactory
channel
- the socket channel associated with the accepted connection.Exception
- when a stream-oriented session could not be createdprotected abstract IStreamHandler createHandler(SocketChannel channel)
channel
- the socket channel associated with the accepted connection.create
methodpublic void registered(ServerSocketChannel channel)
IStreamSessionFactory
registered
in interface IStreamSessionFactory
channel
- the listening channel that has been registeredpublic void closed(ServerSocketChannel channel)
IStreamSessionFactory
closed
in interface IStreamSessionFactory
channel
- the listening channel that has been closedpublic void exception(ServerSocketChannel channel, Throwable exception)
IStreamSessionFactory
exception
in interface IStreamSessionFactory
channel
- the listening channel for witch the exception was caughtexception
- the exception that was caughtCopyright © 2017–2022 SNF4J.ORG. All rights reserved.