org.atmosphere.wasync
Class Options.OptionsBuilder

java.lang.Object
  extended by org.atmosphere.wasync.Options.OptionsBuilder
Enclosing class:
Options

public static final class Options.OptionsBuilder
extends Object


Constructor Summary
Options.OptionsBuilder()
           
 
Method Summary
 Options build()
           
 Options.OptionsBuilder pauseBeforeReconnectInSeconds(int reconnectInSecond)
          The time in second, before the reconnection occurs.
 Options.OptionsBuilder reconnect(boolean reconnect)
          Automatically reconnect in case the connection get closed.
 Options.OptionsBuilder registerTransport(Transport transport)
          Register a new Transport implementation.
 Options.OptionsBuilder runtime(com.ning.http.client.AsyncHttpClient client)
          Allow an application that want to share AsyncHttpClient or configure it before it gets used by the library.
 Options.OptionsBuilder waitBeforeUnlocking(long waitBeforeUnlocking)
          For streaming and long-polling, the server may not send the headers so the client never knows if the connection succeeded or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Options.OptionsBuilder

public Options.OptionsBuilder()
Method Detail

registerTransport

public Options.OptionsBuilder registerTransport(Transport transport)
Register a new Transport implementation. Register a transport only if you are planning to use a different transport than the supported one.

Parameters:
transport - Transport
Returns:
this

reconnect

public Options.OptionsBuilder reconnect(boolean reconnect)
Automatically reconnect in case the connection get closed. Default is true

Parameters:
reconnect - reconnect in case the connection get closed. Default is true
Returns:
this

pauseBeforeReconnectInSeconds

public Options.OptionsBuilder pauseBeforeReconnectInSeconds(int reconnectInSecond)
The time in second, before the reconnection occurs. Default is 1 second

Parameters:
reconnectInSecond - time in second, before the reconnection occurs. Default is 1 second
Returns:
this

waitBeforeUnlocking

public Options.OptionsBuilder waitBeforeUnlocking(long waitBeforeUnlocking)
For streaming and long-polling, the server may not send the headers so the client never knows if the connection succeeded or not. By default the library will wait for 2500 milliseconds before considering the connection established.

Parameters:
waitBeforeUnlocking - the time in millisecond
Returns:
this

runtime

public Options.OptionsBuilder runtime(com.ning.http.client.AsyncHttpClient client)
Allow an application that want to share AsyncHttpClient or configure it before it gets used by the library.

Parameters:
client -
Returns:
this;

build

public Options build()


Copyright © 2013. All Rights Reserved.