org.atmosphere.wasync.impl
Class SocketRuntime

java.lang.Object
  extended by org.atmosphere.wasync.impl.SocketRuntime
Direct Known Subclasses:
AtmosphereSocketRuntime, SerialSocketRuntime

public class SocketRuntime
extends java.lang.Object

This class implement the logic for communicating with a remote server.

Author:
Jeanfrancois Arcand

Field Summary
protected  java.util.List<FunctionWrapper> functions
           
protected  Options options
           
protected  DefaultFuture rootFuture
           
protected  Transport transport
           
 
Constructor Summary
SocketRuntime(Transport transport, Options options, DefaultFuture rootFuture, java.util.List<FunctionWrapper> functions)
           
 
Method Summary
protected  com.ning.http.client.AsyncHttpClient.BoundRequestBuilder configureAHC(Request request)
           
 DefaultFuture future()
           
 com.ning.http.client.ListenableFuture<com.ning.http.client.Response> httpWrite(Request request, java.lang.Object object, java.lang.Object data)
           
protected  java.lang.Object invokeEncoder(java.util.List<Encoder<? extends java.lang.Object,?>> encoders, java.lang.Object instanceType)
           
 void webSocketWrite(Request request, java.lang.Object object, java.lang.Object data)
           
 Future write(Request request, java.lang.Object data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transport

protected Transport transport

options

protected final Options options

rootFuture

protected final DefaultFuture rootFuture

functions

protected final java.util.List<FunctionWrapper> functions
Constructor Detail

SocketRuntime

public SocketRuntime(Transport transport,
                     Options options,
                     DefaultFuture rootFuture,
                     java.util.List<FunctionWrapper> functions)
Method Detail

future

public DefaultFuture future()

invokeEncoder

protected java.lang.Object invokeEncoder(java.util.List<Encoder<? extends java.lang.Object,?>> encoders,
                                         java.lang.Object instanceType)

write

public Future write(Request request,
                    java.lang.Object data)
             throws java.io.IOException
Throws:
java.io.IOException

webSocketWrite

public void webSocketWrite(Request request,
                           java.lang.Object object,
                           java.lang.Object data)
                    throws java.io.IOException
Throws:
java.io.IOException

httpWrite

public com.ning.http.client.ListenableFuture<com.ning.http.client.Response> httpWrite(Request request,
                                                                                      java.lang.Object object,
                                                                                      java.lang.Object data)
                                                                               throws java.io.IOException
Throws:
java.io.IOException

configureAHC

protected com.ning.http.client.AsyncHttpClient.BoundRequestBuilder configureAHC(Request request)


Copyright © 2014. All Rights Reserved.