Class 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
    Per default, this factory creates a ServerConnection which connects to a given server. Furthermore, all three communication methods are 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 Detail

      • ServerConnectionBuilder

        public ServerConnectionBuilder()
    • Method Detail

      • build

        public ServerConnection build()
                               throws IOException
        Description copied from class: com.levigo.jadice.web.conn.client.internal.ServerConnectionBuilderInternal
        Builds a new ServerConnection 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 class com.levigo.jadice.web.conn.client.internal.ServerConnectionBuilderInternal
        a new transport client, in order to communicate with the server
        IOException - if no transport method was enabled and thus no client could be constructed