org.codehaus.activemq.transport.composite
Class CompositeTransportChannel

java.lang.Object
  extended byorg.codehaus.activemq.transport.AbstractTransportChannel
      extended byorg.codehaus.activemq.transport.composite.CompositeTransportChannel
All Implemented Interfaces:
Service, TransportChannel
Direct Known Subclasses:
ReliableTransportChannel

public class CompositeTransportChannel
extends AbstractTransportChannel

A Compsite implementation of a TransportChannel

Version:
$Revision: 1.6 $

Field Summary
protected  TransportChannel channel
           
protected  SynchronizedBoolean closed
           
protected  java.net.URI currentURI
           
protected  long failureSleepTime
           
protected  int retryCount
           
protected  SynchronizedBoolean started
           
protected  java.net.URI[] uris
           
protected  WireFormat wireFormat
           
 
Constructor Summary
CompositeTransportChannel(WireFormat wireFormat, java.net.URI[] uris)
           
 
Method Summary
 void asyncSend(Packet packet)
          Asynchronously send a Packet
protected  void attemptToConnect(java.net.URI uri)
           
protected  void configureChannel()
           
protected  void establishConnection()
           
protected  java.net.URI extractURI(java.util.List list)
           
protected  TransportChannel getChannel()
           
 boolean isMulticast()
           
 Receipt send(Packet packet)
          synchronously send a Packet
 Receipt send(Packet packet, int timeout)
          Synchronously send a Packet
 void setExceptionListener(ExceptionListener listener)
          Set an exception listener to listen for asynchronously generated exceptions
 void setPacketListener(PacketListener listener)
          Set a listener for Packets
 void start()
          start listeneing for events
 void stop()
          close the channel
 java.lang.String toString()
           
 
Methods inherited from class org.codehaus.activemq.transport.AbstractTransportChannel
addTransportStatusEventListener, doAsyncSend, doConsumePacket, doHandleReceipt, fireStatusEvent, fireStatusEvent, getClientID, getExceptionListener, getPacketListener, getTransportChannelListener, onAsyncException, removeTransportStatusEventListener, setClientID, setTransportChannelListener, stopExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

wireFormat

protected WireFormat wireFormat

uris

protected java.net.URI[] uris

channel

protected TransportChannel channel

closed

protected SynchronizedBoolean closed

started

protected SynchronizedBoolean started

retryCount

protected int retryCount

failureSleepTime

protected long failureSleepTime

currentURI

protected java.net.URI currentURI
Constructor Detail

CompositeTransportChannel

public CompositeTransportChannel(WireFormat wireFormat,
                                 java.net.URI[] uris)
Method Detail

toString

public java.lang.String toString()

start

public void start()
           throws JMSException
Description copied from interface: TransportChannel
start listeneing for events

Throws:
JMSException - if an error occurs

stop

public void stop()
close the channel

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

send

public Receipt send(Packet packet)
             throws JMSException
Description copied from class: AbstractTransportChannel
synchronously send a Packet

Specified by:
send in interface TransportChannel
Overrides:
send in class AbstractTransportChannel
Parameters:
packet -
Returns:
a Receipt
Throws:
JMSException

send

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

Specified by:
send in interface TransportChannel
Overrides:
send in class AbstractTransportChannel
Parameters:
packet - packet to send
timeout - amount of time to wait for a receipt
Returns:
the Receipt
Throws:
JMSException

asyncSend

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

Parameters:
packet -
Throws:
JMSException

setPacketListener

public void setPacketListener(PacketListener listener)
Description copied from class: AbstractTransportChannel
Set a listener for Packets

Specified by:
setPacketListener in interface TransportChannel
Overrides:
setPacketListener in class AbstractTransportChannel
Parameters:
listener -

setExceptionListener

public void setExceptionListener(ExceptionListener listener)
Description copied from class: AbstractTransportChannel
Set an exception listener to listen for asynchronously generated exceptions

Specified by:
setExceptionListener in interface TransportChannel
Overrides:
setExceptionListener in class AbstractTransportChannel
Parameters:
listener -

isMulticast

public boolean isMulticast()
Returns:
true if this transport is multicast based (i.e. broadcasts to multiple nodes)

establishConnection

protected void establishConnection()
                            throws JMSException
Throws:
JMSException

getChannel

protected TransportChannel getChannel()
                               throws JMSException
Throws:
JMSException

configureChannel

protected void configureChannel()

extractURI

protected java.net.URI extractURI(java.util.List list)
                           throws JMSException
Throws:
JMSException

attemptToConnect

protected void attemptToConnect(java.net.URI uri)
                         throws JMSException
Throws:
JMSException


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