T - public abstract class OptionsBuilder<U extends Options,T extends OptionsBuilder<U,T>> extends Object
Options| Modifier | Constructor and Description |
|---|---|
protected |
OptionsBuilder(Class<T> derived) |
| Modifier and Type | Method and Description |
|---|---|
abstract U |
build()
Build an
Options |
T |
pauseBeforeReconnectInSeconds(int reconnectInSecond)
The time in second, before the reconnection occurs.
|
boolean |
reconnect()
Reconnect after a network failure or when the server close the connection.
|
T |
reconnect(boolean reconnect)
Automatically reconnect in case the connection get closed.
|
int |
reconnectInSeconds()
The delay, in second, before reconnecting.
|
T |
registerTransport(Transport transport)
Register a new
Transport implementation. |
int |
requestTimeoutInSeconds()
The time, in seconds to wait before closing the connection.
|
T |
requestTimeoutInSeconds(int requestTimeout)
The time, in seconds, the connection will stay open when waiting for new messages.
|
com.ning.http.client.AsyncHttpClient |
runtime()
The
AsyncHttpClient used to communicate with server. |
T |
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. |
T |
runtime(com.ning.http.client.AsyncHttpClient client,
boolean runtimeShared)
Allow an application that want to share
AsyncHttpClient or configure it before it gets used
by the library. |
boolean |
runtimeShared()
Return true is the
AsyncHttpClient is shared between Socket. |
T |
runtimeShared(boolean runtimeShared)
Set to true if your AsyncHttpClient is shared between clients.
|
Transport |
transport()
The used
Transport |
long |
waitBeforeUnlocking()
The delay before considering the http connection has been fully processed by the server.
|
T |
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.
|
protected final Class<T extends OptionsBuilder<U,T>> derived
public T requestTimeoutInSeconds(int requestTimeout)
public T registerTransport(Transport transport)
Transport implementation. Register a transport only if you are planning to use
a different transport than the supported one.transport - Transportpublic T reconnect(boolean reconnect)
reconnect - reconnect in case the connection get closed. Default is truepublic T pauseBeforeReconnectInSeconds(int reconnectInSecond)
reconnectInSecond - time in second, before the reconnection occurs. Default is 1 secondpublic T waitBeforeUnlocking(long waitBeforeUnlocking)
waitBeforeUnlocking - the time in millisecondpublic T runtimeShared(boolean runtimeShared)
runtimeShared - true if your AsyncHttpClient is shared between clients.public T runtime(com.ning.http.client.AsyncHttpClient client)
AsyncHttpClient or configure it before it gets used
by the library. Application must call AsyncHttpClient.close() at the end of their
execution as the library won't close it since shared.client - public T runtime(com.ning.http.client.AsyncHttpClient client, boolean runtimeShared)
AsyncHttpClient or configure it before it gets used
by the library.client - runtimeShared - to true if the runtime is shared between clients. If shared, the asyncHttpClient.close()
must be invoked by the application itself.public boolean reconnect()
public int reconnectInSeconds()
public long waitBeforeUnlocking()
Socket.fire(Object)
to send message. Server side framework that aren't sending any data when suspending a connection may not be ready to fullfil request, hence some data may be lost.
Framework like Atmosphere, Socket.io, Cometd do send some "handshake data" allow the fire operation to be available fast without loosing ant data.public com.ning.http.client.AsyncHttpClient runtime()
AsyncHttpClient used to communicate with server.AsyncHttpClient used to communicate with server.public boolean runtimeShared()
AsyncHttpClient is shared between Socket. Default is false. You need to invoke runtime(com.ning.http.client.AsyncHttpClient) to make
it shared.AsyncHttpClientpublic int requestTimeoutInSeconds()
Copyright © 2013. All Rights Reserved.