Class ServerConnectionBuilder
java.lang.Object
com.levigo.jadice.web.conn.client.internal.ServerConnectionBuilderInternal
com.levigo.jadice.web.conn.client.ServerConnectionBuilder
public class ServerConnectionBuilder
extends com.levigo.jadice.web.conn.client.internal.ServerConnectionBuilderInternal
This factory creates a
ServerConnection
that is able to communicate with the server side
end point. Three communication methods are available:
- WebSocket
- Server Sent Events
- Longpoll
ServerConnection
which connects to a given server.
Furthermore, websocket and longpoll is enabled.
The factory creates one of the supported communication methods, depicted by the capabilities of the browsers. Furthermore, certain methods can be disabled optionally.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newServerConnection
dependent on the capabilities of the browser, predefined end point and restrictions.Methods inherited from class com.levigo.jadice.web.conn.client.internal.ServerConnectionBuilderInternal
buildInternal, setInitialBackoffValue, setLongpollEnabled, setLongtimeReconnectEnabled, setLongtimeReconnectIntervalInMillis, setMaximumRetryDelay, setMaxReconnectAttempts, setRequestAggregationWindow, setServerAddress, setServerSentEventsEnabled, setWebSocketEnabled
-
Constructor Details
-
ServerConnectionBuilder
public ServerConnectionBuilder()
-
-
Method Details
-
build
Description copied from class:com.levigo.jadice.web.conn.client.internal.ServerConnectionBuilderInternal
Builds a newServerConnection
dependent on the capabilities of the browser, predefined end point and restrictions.First, the build method tries to create a connection using the websocket protocol, if not available or deactivated it tires to create a connection using a server sent event based protocol. If that is also not available or deactivated it falls back to the longpoll method as a last resort.
- Specified by:
build
in classcom.levigo.jadice.web.conn.client.internal.ServerConnectionBuilderInternal
- Returns:
- a new transport client, in order to communicate with the server
- Throws:
IOException
- if no transport method was enabled and thus no client could be constructed
-