public abstract class AbstractWebSocketSessionFactory extends Object implements IStreamSessionFactory
IStreamSessionFactory
interface for the Web Socket
sessions.Modifier | Constructor and Description |
---|---|
protected |
AbstractWebSocketSessionFactory()
Constructs a factory that creates the basic Web Socket sessions.
|
protected |
AbstractWebSocketSessionFactory(boolean ssl)
Constructs a factory that creates Web Socket 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 Web Socket session for a newly accepted connection.
|
protected abstract IWebSocketHandler |
createHandler(SocketChannel channel)
Creates a Web Socket 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 AbstractWebSocketSessionFactory()
protected AbstractWebSocketSessionFactory(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 Web Socket session could not be createdprotected abstract IWebSocketHandler 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.