org.atmosphere.wasync
Interface Transport<T>

All Known Implementing Classes:
LongPollingTransport, SSETransport, StreamTransport, WebSocketTransport

public interface Transport<T>

Define a supported Transport. Default are websocket, streaming, server-side events and long-polling. Use this interface only if you want to define another transport. New transport can be registered using the Options class.

Author:
Jeanfrancois Arcand

Method Summary
 boolean canHandle(Request request)
          Return true if the transport can handle the request.
 void close()
          Close the underlying transport}
 Transport future(Future f)
          The current Socket's Future
 Request.TRANSPORT name()
          The transport name
 void onThrowable(Throwable t)
          Called when an unexpected exception ocurred.
 Transport registerF(FunctionWrapper function)
          Register a new FunctionResolver
 

Method Detail

name

Request.TRANSPORT name()
The transport name

Returns:
transport name

future

Transport future(Future f)
The current Socket's Future

Parameters:
f -
Returns:
this

registerF

Transport registerF(FunctionWrapper function)
Register a new FunctionResolver

Parameters:
function - FunctionResolver
Returns:
this;

onThrowable

void onThrowable(Throwable t)
Called when an unexpected exception ocurred.

Parameters:
t - a Throwable

close

void close()
Close the underlying transport}


canHandle

boolean canHandle(Request request)
Return true if the transport can handle the request.

Parameters:
request - Request
Returns:
true if the transport can handle the request.


Copyright © 2012. All Rights Reserved.