org.atmosphere.wasync.impl
Class DefaultOptions

java.lang.Object
  extended by org.atmosphere.wasync.impl.DefaultOptions
All Implemented Interfaces:
Options
Direct Known Subclasses:
SerializedOptions

public class DefaultOptions
extends Object
implements Options

Default implementation of the Options

Author:
Jeanfrancois Arcand

Field Summary
protected  OptionsBuilder b
           
 
Constructor Summary
DefaultOptions(OptionsBuilder b)
           
 
Method Summary
 boolean reconnect()
          Reconnect after a network failure or when the server close the connection.
 int reconnectInSeconds()
          The delay, in second, before reconnecting.
 int requestTimeoutInSeconds()
          The time, in seconds to wait before closing the connection.
 com.ning.http.client.AsyncHttpClient runtime()
          The AsyncHttpClient used to communicate with server.
 void runtime(com.ning.http.client.AsyncHttpClient client)
          Set the AsyncHttpClient.
 boolean runtimeShared()
          Return true is the AsyncHttpClient is shared between Socket.
 Transport transport()
          The used Transport
 long waitBeforeUnlocking()
          When using long-polling and the Request, the delay before considering the long-polling connection has been fully processed by the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

b

protected final OptionsBuilder b
Constructor Detail

DefaultOptions

public DefaultOptions(OptionsBuilder b)
Method Detail

transport

public Transport transport()
The used Transport

Specified by:
transport in interface Options
Returns:
Transport

reconnect

public boolean reconnect()
Reconnect after a network failure or when the server close the connection.

Specified by:
reconnect in interface Options
Returns:
reconnect

reconnectInSeconds

public int reconnectInSeconds()
The delay, in second, before reconnecting.

Specified by:
reconnectInSeconds in interface Options
Returns:
The delay, in second, before reconnecting.

waitBeforeUnlocking

public long waitBeforeUnlocking()
When using long-polling and the Request, the delay before considering the long-polling connection has been fully processed by the server. If you use the AtmosphereClient, the server will send some handshake so this value is not needed.

Specified by:
waitBeforeUnlocking in interface Options
Returns:
the delay before considering the long-polling connection has been fully processed

runtime

public com.ning.http.client.AsyncHttpClient runtime()
The AsyncHttpClient used to communicate with server.

Specified by:
runtime in interface Options
Returns:
AsyncHttpClient used to communicate with server.

runtime

public void runtime(com.ning.http.client.AsyncHttpClient client)
Description copied from interface: Options
Set the AsyncHttpClient.

Specified by:
runtime in interface Options
Parameters:
client - the AsyncHttpClient

runtimeShared

public boolean runtimeShared()
Return true is the AsyncHttpClient is shared between Socket. Default is false. You need to invoke Options.runtime(com.ning.http.client.AsyncHttpClient) to make it shared.

Specified by:
runtimeShared in interface Options
Returns:
true is the AsyncHttpClient

requestTimeoutInSeconds

public int requestTimeoutInSeconds()
The time, in seconds to wait before closing the connection.

Specified by:
requestTimeoutInSeconds in interface Options
Returns:
The time, in seconds to wait before closing the connection.


Copyright © 2013. All Rights Reserved.