org.activemq.transport.reliable
Class ReliableTransportChannel

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

public class ReliableTransportChannel
extends CompositeTransportChannel
implements PacketListener, ExceptionListener

A Compsite implementation of a TransportChannel

Version:
$Revision: 1.1.1.1 $

Field Summary
 
Fields inherited from class org.activemq.transport.composite.CompositeTransportChannel
channel, closed, currentURI, establishConnectionTimeout, failureSleepTime, incrementTimeout, maximumRetries, maximumTimeout, started, uris
 
Fields inherited from class org.activemq.transport.TransportChannelSupport
cachingEnabled, currentWireFormat, noDelay, pendingStop, transportConnected, usedInternally
 
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
 ReceiptHolder asyncSendWithReceipt(Packet packet)
          Asynchronously send a Packet with receipt.
protected  void configureChannel()
           
 void consume(Packet packet)
          consume a packet from the enbedded channel
protected  void doClose()
           
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)
           
 long getKeepAliveTimeout()
           
 void onException(JMSException jmsEx)
          handle exception from the embedded channel
 Receipt send(Packet packet, int timeout)
          Synchronously send a Packet
 void setKeepAliveTimeout(long timeoutInterval)
          Sets the number of milliseconds this channel can be idle after a keep-alive packet has been sent without being disconnected.
 void stop()
          stop this channel
 String toString()
           
 
Methods inherited from class org.activemq.transport.composite.CompositeTransportChannel
attemptToConnect, canProcessWireFormatVersion, establishConnection, forceDisconnect, getChannel, getCurrentWireFormatVersion, getEstablishConnectionTimeout, getFailureSleepTime, getLastReceiptTimestamp, getMaximumRetries, getMaximumTimeout, getUris, isIncrementTimeout, isMulticast, isTransportConnected, send, setClientID, setEstablishConnectionTimeout, setExceptionListener, setFailureSleepTime, setIncrementTimeout, setMaximumRetries, setMaximumTimeout, setPacketListener, setUris, start, statusChanged
 
Methods inherited from class org.activemq.transport.TransportChannelSupport
addTransportStatusEventListener, doAsyncSend, doConsumePacket, doConsumePacket, doesSupportMessageCompression, doesSupportMessageFragmentation, doesSupportWireFormatVersioning, doHandleReceipt, doHandleWireFormat, fireStatusEvent, fireStatusEvent, getClientID, getEmbeddedBrokerConnector, getExceptionListener, getPacketListener, getTransportChannelListener, getWireFormat, isCachingEnabled, isNoDelay, isPendingStop, isServerSide, isUsedInternally, onAsyncException, removeTransportStatusEventListener, requiresEmbeddedBroker, setCachingEnabled, setNoDelay, setPendingStop, setServerSide, setTransportChannelListener, setTransportConnected, setUsedInternally, setWireFormat, 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

setKeepAliveTimeout

public void setKeepAliveTimeout(long timeoutInterval)
Sets the number of milliseconds this channel can be idle after a keep-alive packet has been sent without being disconnected.

Parameters:
timeoutInterval - the timeout interval

getKeepAliveTimeout

public long getKeepAliveTimeout()

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

asyncSendWithReceipt

public ReceiptHolder asyncSendWithReceipt(Packet packet)
                                   throws JMSException
Description copied from class: TransportChannelSupport
Asynchronously send a Packet with receipt.

Specified by:
asyncSendWithReceipt in interface TransportChannel
Overrides:
asyncSendWithReceipt in class CompositeTransportChannel
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

doClose

protected void doClose()


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