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


Field Summary
 long waitBeforeUnlocking
           
 
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 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
 

Field Detail

waitBeforeUnlocking

public long waitBeforeUnlocking
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 defaul the library will wait for 2500 milliseconds before considering the connection established.

Parameters:
waitBeforeUnlocking - the time in millisecond
Returns:
this

build

public Options build()


Copyright © 2012. All Rights Reserved.