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 Object

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

Author:
Jeanfrancois Arcand

Field Summary
protected  List<FunctionWrapper> functions
           
protected  Options options
           
protected  DefaultFuture rootFuture
           
protected  Transport transport
           
 
Constructor Summary
SocketRuntime(Transport transport, Options options, DefaultFuture rootFuture, 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, Object object, Object data)
           
protected  Object invokeEncoder(List<Encoder<? extends Object,?>> encoders, Object instanceType)
           
 void webSocketWrite(Request request, Object object, Object data)
           
 Future write(Request request, 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 List<FunctionWrapper> functions
Constructor Detail

SocketRuntime

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

future

public DefaultFuture future()

invokeEncoder

protected Object invokeEncoder(List<Encoder<? extends Object,?>> encoders,
                               Object instanceType)

write

public Future write(Request request,
                    Object data)
             throws IOException
Throws:
IOException

webSocketWrite

public void webSocketWrite(Request request,
                           Object object,
                           Object data)
                    throws IOException
Throws:
IOException

httpWrite

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

configureAHC

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


Copyright © 2013. All Rights Reserved.