org.codehaus.activemq.transport.reliable
Class ReliableTransportChannel

java.lang.Object
  extended byorg.codehaus.activemq.transport.TransportChannelSupport
      extended byorg.codehaus.activemq.transport.composite.CompositeTransportChannel
          extended byorg.codehaus.activemq.transport.reliable.ReliableTransportChannel
All Implemented Interfaces:
ExceptionListener, PacketListener, Service, TransportChannel
Direct Known Subclasses:
DiscoveryTransportChannel

public class ReliableTransportChannel
extends CompositeTransportChannel
implements PacketListener, ExceptionListener

A Compsite implementation of a TransportChannel

Version:
$Revision: 1.11 $

Field Summary
 
Fields inherited from class org.codehaus.activemq.transport.composite.CompositeTransportChannel
channel, closed, currentURI, failureSleepTime, maximumRetries, started, uris, wireFormat
 
Fields inherited from class org.codehaus.activemq.transport.TransportChannelSupport
pendingStop, transportConnected
 
Constructor Summary
ReliableTransportChannel(WireFormat wireFormat)
          Construct this transport
ReliableTransportChannel(WireFormat wireFormat, List uris)
          Construct this transport
 
Method Summary
 void asyncSend(Packet packet)
          Asynchronously send a Packet
protected  void configureChannel()
           
 void consume(Packet packet)
          consume a packet from the enbedded channel
protected  void doReconnect(TransportChannel currentChannel, long timeout)
           
protected  URI extractURI(List list)
           
protected  void fireException(JMSException jmsEx)
          Fire a JMSException to the exception listener
protected  TransportChannel getEstablishedChannel(long timeout)
           
 void onException(JMSException jmsEx)
          handle exception from the embedded channel
 Receipt send(Packet packet, int timeout)
          Synchronously send a Packet
 void start()
          start the connection
 void stop()
          stop this channel
 String toString()
           
 
Methods inherited from class org.codehaus.activemq.transport.composite.CompositeTransportChannel
attemptToConnect, canProcessWireFormatVersion, establishConnection, getChannel, getCurrentWireFormatVersion, getEstablishConnectionTimeout, getFailureSleepTime, getMaximumRetries, getUris, isMulticast, send, setEstablishConnectionTimeout, setExceptionListener, setFailureSleepTime, setMaximumRetries, setPacketListener, setUris
 
Methods inherited from class org.codehaus.activemq.transport.TransportChannelSupport
addTransportStatusEventListener, doAsyncSend, doConsumePacket, doConsumePacket, doHandleReceipt, doHandleWireFormat, fireStatusEvent, fireStatusEvent, getClientID, getExceptionListener, getPacketListener, getTransportChannelListener, isPendingStop, isServerSide, isTransportConnected, onAsyncException, removeTransportStatusEventListener, setClientID, setPendingStop, setServerSide, setTransportChannelListener, setTransportConnected, stopExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReliableTransportChannel

public ReliableTransportChannel(WireFormat wireFormat)
Construct this transport

Parameters:
wireFormat -

ReliableTransportChannel

public ReliableTransportChannel(WireFormat wireFormat,
                                List uris)
Construct this transport

Parameters:
wireFormat -
uris -
Method Detail

toString

public String toString()
Overrides:
toString in class CompositeTransportChannel
Returns:
pretty print for this

start

public void start()
           throws JMSException
start the connection

Specified by:
start in interface TransportChannel
Overrides:
start in class CompositeTransportChannel
Throws:
JMSException

send

public Receipt send(Packet packet,
                    int timeout)
             throws JMSException
Description copied from class: TransportChannelSupport
Synchronously send a Packet

Specified by:
send in interface TransportChannel
Overrides:
send in class CompositeTransportChannel
Parameters:
packet -
timeout -
Returns:
receipt - or null
Throws:
JMSException

asyncSend

public void asyncSend(Packet packet)
               throws JMSException
Description copied from interface: TransportChannel
Asynchronously send a Packet

Specified by:
asyncSend in interface TransportChannel
Overrides:
asyncSend in class CompositeTransportChannel
Parameters:
packet -
Throws:
JMSException

configureChannel

protected void configureChannel()
Overrides:
configureChannel in class CompositeTransportChannel

extractURI

protected URI extractURI(List list)
                  throws JMSException
Overrides:
extractURI in class CompositeTransportChannel
Throws:
JMSException

consume

public void consume(Packet packet)
consume a packet from the enbedded channel

Specified by:
consume in interface PacketListener
Parameters:
packet - to consume

onException

public void onException(JMSException jmsEx)
handle exception from the embedded channel

Specified by:
onException in interface ExceptionListener
Parameters:
jmsEx -

stop

public void stop()
stop this channel

Specified by:
stop in interface TransportChannel
Overrides:
stop in class CompositeTransportChannel

fireException

protected void fireException(JMSException jmsEx)
Fire a JMSException to the exception listener

Parameters:
jmsEx -

getEstablishedChannel

protected TransportChannel getEstablishedChannel(long timeout)
                                          throws JMSException
Throws:
JMSException

doReconnect

protected void doReconnect(TransportChannel currentChannel,
                           long timeout)
                    throws JMSException
Throws:
JMSException


Copyright © 2004 Protique, Ltd.. All Rights Reserved.