org.apache.activemq.transport
Interface Transport

All Superinterfaces:
Service
All Known Subinterfaces:
CompositeTransport
All Known Implementing Classes:
CommandJoiner, DiscoveryTransport, FailoverTransport, FanoutTransport, InactivityMonitor, MarshallingTransportFilter, MockTransport, MulticastTransport, MutexTransport, NIOTransport, ReliableTransport, ResponseCorrelator, ResponseRedirectInterceptor, SslTransport, StompTransportFilter, TcpTransport, ThreadNameFilter, TransportFilter, TransportLogger, TransportSupport, TransportThreadSupport, UdpTransport, VMTransport, WireFormatNegotiator, WriteTimeoutFilter

public interface Transport
extends Service

Represents the client side of a transport allowing messages to be sent synchronously, asynchronously and consumed.

Version:
$Revision: 1.5 $

Method Summary
 FutureResponse asyncRequest(Object command, ResponseCallback responseCallback)
          An asynchronous request response where the Receipt will be returned in the future.
 String getRemoteAddress()
           
 TransportListener getTransportListener()
          Returns the current transport listener
 boolean isConnected()
           
 boolean isDisposed()
           
 boolean isFaultTolerant()
          Indicates if the transport can handle faults
<T> T
narrow(Class<T> target)
           
 void oneway(Object command)
          A one way asynchronous send
 void reconnect(URI uri)
          reconnect to another location
 Object request(Object command)
          A synchronous request response
 Object request(Object command, int timeout)
          A synchronous request response
 void setTransportListener(TransportListener commandListener)
          Registers an inbound command listener
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Method Detail

oneway

void oneway(Object command)
            throws IOException
A one way asynchronous send

Parameters:
command -
Throws:
IOException

asyncRequest

FutureResponse asyncRequest(Object command,
                            ResponseCallback responseCallback)
                            throws IOException
An asynchronous request response where the Receipt will be returned in the future. If responseCallback is not null, then it will be called when the response has been completed.

Parameters:
command -
responseCallback - TODO
Returns:
the FutureResponse
Throws:
IOException

request

Object request(Object command)
               throws IOException
A synchronous request response

Parameters:
command -
Returns:
the response
Throws:
IOException

request

Object request(Object command,
               int timeout)
               throws IOException
A synchronous request response

Parameters:
command -
timeout -
Returns:
the repsonse or null if timeout
Throws:
IOException

getTransportListener

TransportListener getTransportListener()
Returns the current transport listener

Returns:

setTransportListener

void setTransportListener(TransportListener commandListener)
Registers an inbound command listener

Parameters:
commandListener -

narrow

<T> T narrow(Class<T> target)
Parameters:
target -
Returns:
the target

getRemoteAddress

String getRemoteAddress()
Returns:
the remote address for this connection

isFaultTolerant

boolean isFaultTolerant()
Indicates if the transport can handle faults

Returns:
true if fault tolerant

isDisposed

boolean isDisposed()
Returns:
true if the transport is disposed

isConnected

boolean isConnected()
Returns:
true if the transport is connected

reconnect

void reconnect(URI uri)
               throws IOException
reconnect to another location

Parameters:
uri -
Throws:
IOException - on failure of if not supported


Copyright © 2009. All Rights Reserved.