Package org.java_websocket
Interface WebSocketServerFactory
-
- All Superinterfaces:
WebSocketFactory
- All Known Implementing Classes:
CustomSSLWebSocketServerFactory,DefaultSSLWebSocketServerFactory,DefaultWebSocketServerFactory,SSLParametersWebSocketServerFactory
public interface WebSocketServerFactory extends WebSocketFactory
Interface to encapsulate the required methods for a websocket factory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Allows to shutdown the websocket factory for a clean shutdownWebSocketImplcreateWebSocket(WebSocketAdapter a, java.util.List<Draft> drafts)Create a new Websocket with the provided listener, drafts and socketWebSocketImplcreateWebSocket(WebSocketAdapter a, Draft d)Create a new Websocket with the provided listener, drafts and socketjava.nio.channels.ByteChannelwrapChannel(java.nio.channels.SocketChannel channel, java.nio.channels.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
WebSocketImpl createWebSocket(WebSocketAdapter a, Draft d)
Description copied from interface:WebSocketFactoryCreate a new Websocket with the provided listener, drafts and socket- Specified by:
createWebSocketin interfaceWebSocketFactory- Parameters:
a- The Listener for the WebsocketImpld- The draft which should be used- Returns:
- A WebsocketImpl
-
createWebSocket
WebSocketImpl createWebSocket(WebSocketAdapter a, java.util.List<Draft> drafts)
Description copied from interface:WebSocketFactoryCreate a new Websocket with the provided listener, drafts and socket- Specified by:
createWebSocketin interfaceWebSocketFactory- Parameters:
a- The Listener for the WebsocketImpldrafts- The drafts which should be used- Returns:
- A WebsocketImpl
-
wrapChannel
java.nio.channels.ByteChannel wrapChannel(java.nio.channels.SocketChannel channel, java.nio.channels.SelectionKey key) throws java.io.IOExceptionAllows to wrap the SocketChannel( key.channel() ) to insert a protocol layer( like ssl or proxy authentication) beyond the ws layer.- 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.
- Throws:
java.io.IOException- may be thrown while writing on the channel
-
close
void close()
Allows to shutdown the websocket factory for a clean shutdown
-
-