|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.wasync.OptionsBuilder<U,T>
T - public abstract class OptionsBuilder<U extends Options,T extends OptionsBuilder<U,T>>
Base class for building Options
| Field Summary | |
|---|---|
protected Class<T> |
derived
|
| Constructor Summary | |
|---|---|
protected |
OptionsBuilder(Class<T> derived)
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Class<T extends OptionsBuilder<U,T>> derived
| Constructor Detail |
|---|
protected OptionsBuilder(Class<T> derived)
| Method Detail |
|---|
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 - Transport
public T reconnect(boolean reconnect)
reconnect - reconnect in case the connection get closed. Default is true
public T pauseBeforeReconnectInSeconds(int reconnectInSecond)
reconnectInSecond - time in second, before the reconnection occurs. Default is 1 second
public T waitBeforeUnlocking(long waitBeforeUnlocking)
waitBeforeUnlocking - the time in millisecond
public 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 abstract U build()
Options
Optionspublic Transport transport()
Transport
Transportpublic 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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||