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) |
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) |
void |
registered(ServerSocketChannel 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)
registered
in interface IStreamSessionFactory
public void closed(ServerSocketChannel channel)
closed
in interface IStreamSessionFactory
public void exception(ServerSocketChannel channel, Throwable exception)
exception
in interface IStreamSessionFactory
Copyright © 2017–2022 SNF4J.ORG. All rights reserved.