Package org.java_websocket.server
Class DefaultWebSocketServerFactory
- java.lang.Object
-
- org.java_websocket.server.DefaultWebSocketServerFactory
-
- All Implemented Interfaces:
WebSocketFactory
,WebSocketServerFactory
public class DefaultWebSocketServerFactory extends Object implements WebSocketServerFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultWebSocketServerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Allows to shutdown the websocket factory for a clean shutdownWebSocketImpl
createWebSocket(WebSocketAdapter a, List<Draft> d)
Create a new Websocket with the provided listener, drafts and socketWebSocketImpl
createWebSocket(WebSocketAdapter a, Draft d)
Create a new Websocket with the provided listener, drafts and socketSocketChannel
wrapChannel(SocketChannel channel, SelectionKey key)
Allows to wrap the Socketchannel( key.channel() ) to insert a protocol layer( like ssl or proxy authentication) beyond the ws layer.
-
-
-
Method Detail
-
createWebSocket
public WebSocketImpl createWebSocket(WebSocketAdapter a, Draft d)
Description copied from interface:WebSocketFactory
Create a new Websocket with the provided listener, drafts and socket- Specified by:
createWebSocket
in interfaceWebSocketFactory
- Specified by:
createWebSocket
in interfaceWebSocketServerFactory
- Parameters:
a
- The Listener for the WebsocketImpld
- The draft which should be used- Returns:
- A WebsocketImpl
-
createWebSocket
public WebSocketImpl createWebSocket(WebSocketAdapter a, List<Draft> d)
Description copied from interface:WebSocketFactory
Create a new Websocket with the provided listener, drafts and socket- Specified by:
createWebSocket
in interfaceWebSocketFactory
- Specified by:
createWebSocket
in interfaceWebSocketServerFactory
- Parameters:
a
- The Listener for the WebsocketImpld
- The drafts which should be used- Returns:
- A WebsocketImpl
-
wrapChannel
public SocketChannel wrapChannel(SocketChannel channel, SelectionKey key)
Description copied from interface:WebSocketServerFactory
Allows to wrap the Socketchannel( key.channel() ) to insert a protocol layer( like ssl or proxy authentication) beyond the ws layer.- Specified by:
wrapChannel
in interfaceWebSocketServerFactory
- Parameters:
channel
- The SocketChannel to wrapkey
- a SelectionKey of an open SocketChannel.- Returns:
- The channel on which the read and write operations will be performed.
-
close
public void close()
Description copied from interface:WebSocketServerFactory
Allows to shutdown the websocket factory for a clean shutdown- Specified by:
close
in interfaceWebSocketServerFactory
-
-