Top Description Methods
org.java_websocket

public Interface WebSocketServerFactory

extends WebSocketFactory
Known Direct Implementers
org.java_websocket.server.DefaultSSLWebSocketServerFactory, org.java_websocket.server.DefaultWebSocketServerFactory
Imports
java.io.IOException, java.nio.channels.ByteChannel, .SelectionKey, .SocketChannel, java.util.List, org.java_websocket.drafts.Draft

Interface to encapsulate the required methods for a websocket factory

Method Summary

Modifier and TypeMethod and Description
public void
close()

Allows to shutdown the websocket factory for a clean shutdown

public WebSocketImpl
createWebSocket(WebSocketAdapter a, Draft d)

Redeclares org.java_websocket.WebSocketFactory.createWebSocket.

Create a new Websocket with the provided listener, drafts and socket

public WebSocketImpl
createWebSocket(WebSocketAdapter a, List<Draft> drafts)

Redeclares org.java_websocket.WebSocketFactory.createWebSocket.

Create a new Websocket with the provided listener, drafts and socket

public ByteChannel

Returns:

The channel on which the read and write operations will be performed.
wrapChannel
(SocketChannel
The SocketChannel to wrap
channel
,
SelectionKey
a SelectionKey of an open SocketChannel.
key
)

Allows to wrap the SocketChannel( key.channel() ) to insert a protocol layer( like ssl or proxy authentication) beyond the ws layer.

Method Detail

closeback to summary
public void close()

Allows to shutdown the websocket factory for a clean shutdown

createWebSocketback to summary
public WebSocketImpl createWebSocket(WebSocketAdapter a, Draft d)

Redeclares org.java_websocket.WebSocketFactory.createWebSocket.

Doc from org.java_websocket.WebSocketFactory.createWebSocket.

Create a new Websocket with the provided listener, drafts and socket

Annotations
@Override
createWebSocketback to summary
public WebSocketImpl createWebSocket(WebSocketAdapter a, List<Draft> drafts)

Redeclares org.java_websocket.WebSocketFactory.createWebSocket.

Doc from org.java_websocket.WebSocketFactory.createWebSocket.

Create a new Websocket with the provided listener, drafts and socket

Annotations
@Override
wrapChannelback to summary
public ByteChannel wrapChannel(SocketChannel channel, SelectionKey key) throws IOException

Allows to wrap the SocketChannel( key.channel() ) to insert a protocol layer( like ssl or proxy authentication) beyond the ws layer.

Parameters
channel:SocketChannel

The SocketChannel to wrap

key:SelectionKey

a SelectionKey of an open SocketChannel.

Returns:ByteChannel

The channel on which the read and write operations will be performed.

Exceptions
IOException:
may be thrown while writing on the channel