Class HttpClientConnector
java.lang.Object
org.nustaq.kontraktor.remoting.http.HttpClientConnector
- All Implemented Interfaces:
org.nustaq.kontraktor.remoting.base.ActorClientConnector
public class HttpClientConnector
extends java.lang.Object
implements org.nustaq.kontraktor.remoting.base.ActorClientConnector
Created by ruedi on 13/05/15.
Long Poll, http 1.1 based connectivity with on top sequencing + reordering. Designed to handle network outages
and crappy connectivity.
This implies once it successfully connected, it won't go to "closed" except a session timeout/close happened (=>404) (even if server has been stopped after connection)
TODO: proxy options
TODO: provide 1.7 compliant Android client impl
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpClientConnector.HttpClientActor -
Field Summary
Fields Modifier and Type Field Description protected static org.apache.http.impl.nio.client.CloseableHttpAsyncClientasyncHttpClientjava.lang.Object[]authDatastatic booleanDumpProtocolstatic intMAX_CONN_PER_ROUTEstatic intMAX_CONN_TOTAL -
Constructor Summary
Constructors Constructor Description HttpClientConnector(HttpConnectable httpConnectable) -
Method Summary
Modifier and Type Method Description org.nustaq.kontraktor.IPromisecloseClient()org.nustaq.kontraktor.IPromiseconnect(java.util.function.Function<org.nustaq.kontraktor.remoting.base.ObjectSocket,org.nustaq.kontraktor.remoting.base.ObjectSink> factory)static org.apache.http.impl.nio.client.CloseableHttpAsyncClientgetClient()static HttpClientConnector.HttpClientActorgetReceiveActor()static HttpClientConnector.HttpClientActorgetRefPollActor()protected voidstartLongPoll(org.nustaq.kontraktor.remoting.http.HttpClientConnector.MyHttpWS myHttpWS)
-
Field Details
-
MAX_CONN_TOTAL
public static int MAX_CONN_TOTAL -
MAX_CONN_PER_ROUTE
public static int MAX_CONN_PER_ROUTE -
DumpProtocol
public static boolean DumpProtocol -
asyncHttpClient
protected static org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncHttpClient -
authData
public java.lang.Object[] authData
-
-
Constructor Details
-
Method Details
-
getClient
public static org.apache.http.impl.nio.client.CloseableHttpAsyncClient getClient() -
connect
public org.nustaq.kontraktor.IPromise connect(java.util.function.Function<org.nustaq.kontraktor.remoting.base.ObjectSocket,org.nustaq.kontraktor.remoting.base.ObjectSink> factory) throws java.lang.Exception- Specified by:
connectin interfaceorg.nustaq.kontraktor.remoting.base.ActorClientConnector- Throws:
java.lang.Exception
-
startLongPoll
protected void startLongPoll(org.nustaq.kontraktor.remoting.http.HttpClientConnector.MyHttpWS myHttpWS) -
closeClient
public org.nustaq.kontraktor.IPromise closeClient()- Specified by:
closeClientin interfaceorg.nustaq.kontraktor.remoting.base.ActorClientConnector
-
getReceiveActor
-
getRefPollActor
-