|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activemq.transport.TransportChannelSupport
org.activemq.transport.composite.CompositeTransportChannel
A Compsite implementation of a TransportChannel
Field Summary | |
protected TransportChannel |
channel
|
protected SynchronizedBoolean |
closed
|
protected URI |
currentURI
|
protected long |
establishConnectionTimeout
|
protected long |
failureSleepTime
|
protected boolean |
incrementTimeout
|
protected int |
maximumRetries
|
protected long |
maximumTimeout
|
protected SynchronizedBoolean |
started
|
protected List |
uris
|
Fields inherited from class org.activemq.transport.TransportChannelSupport |
cachingEnabled, currentWireFormat, noDelay, pendingStop, transportConnected, usedInternally |
Constructor Summary | |
CompositeTransportChannel(WireFormat wireFormat)
|
|
CompositeTransportChannel(WireFormat wireFormat,
List uris)
|
Method Summary | |
void |
asyncSend(Packet packet)
Asynchronously send a Packet |
ReceiptHolder |
asyncSendWithReceipt(Packet packet)
Asynchronously send a Packet with receipt. |
protected void |
attemptToConnect(URI uri)
|
boolean |
canProcessWireFormatVersion(int version)
Can this wireformat process packets of this version |
protected void |
configureChannel()
|
protected void |
establishConnection(long timeout)
|
protected URI |
extractURI(List list)
|
void |
forceDisconnect()
Forces disconnect by delegating to the child channel |
TransportChannel |
getChannel()
Access to the current channel if one is active |
int |
getCurrentWireFormatVersion()
|
long |
getEstablishConnectionTimeout()
Return the maximum amount of time spent trying to establish a connection or a negative number to keep going forever |
long |
getFailureSleepTime()
|
long |
getLastReceiptTimestamp()
Gets the timestamp of the last received receipt packet. |
int |
getMaximumRetries()
|
long |
getMaximumTimeout()
|
List |
getUris()
|
boolean |
isIncrementTimeout()
|
boolean |
isMulticast()
|
boolean |
isTransportConnected()
|
Receipt |
send(Packet packet)
synchronously send a Packet |
Receipt |
send(Packet packet,
int timeout)
Synchronously send a Packet |
void |
setClientID(String clientID)
Provides a way to specify the client ID that this channel is using |
void |
setEstablishConnectionTimeout(long establishConnectionTimeout)
|
void |
setExceptionListener(ExceptionListener listener)
Set an exception listener to listen for asynchronously generated exceptions |
void |
setFailureSleepTime(long failureSleepTime)
|
void |
setIncrementTimeout(boolean incrementTimeout)
|
void |
setMaximumRetries(int maximumRetries)
|
void |
setMaximumTimeout(long maximumTimeout)
|
void |
setPacketListener(PacketListener listener)
Set a listener for Packets |
void |
setUris(List list)
|
void |
start()
start listeneing for events |
void |
statusChanged(TransportStatusEvent event)
called when the status of a transport channel changes |
void |
stop()
close the channel |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected List uris
protected URI currentURI
protected TransportChannel channel
protected SynchronizedBoolean closed
protected SynchronizedBoolean started
protected int maximumRetries
protected long failureSleepTime
protected long establishConnectionTimeout
protected long maximumTimeout
protected boolean incrementTimeout
Constructor Detail |
public CompositeTransportChannel(WireFormat wireFormat)
public CompositeTransportChannel(WireFormat wireFormat, List uris)
Method Detail |
public String toString()
public void start() throws JMSException
TransportChannel
start
in interface TransportChannel
JMSException
- if an error occurspublic void stop()
stop
in interface TransportChannel
stop
in class TransportChannelSupport
public void forceDisconnect()
forceDisconnect
in interface TransportChannel
public Receipt send(Packet packet) throws JMSException
TransportChannelSupport
send
in interface TransportChannel
send
in class TransportChannelSupport
packet
-
JMSException
public Receipt send(Packet packet, int timeout) throws JMSException
TransportChannelSupport
send
in interface TransportChannel
send
in class TransportChannelSupport
packet
- packet to sendtimeout
- amount of time to wait for a receipt
JMSException
public void asyncSend(Packet packet) throws JMSException
TransportChannel
asyncSend
in interface TransportChannel
packet
- the packet to send
JMSException
public ReceiptHolder asyncSendWithReceipt(Packet packet) throws JMSException
TransportChannelSupport
asyncSendWithReceipt
in interface TransportChannel
asyncSendWithReceipt
in class TransportChannelSupport
packet
- the packet to send
JMSException
public void setPacketListener(PacketListener listener)
TransportChannelSupport
setPacketListener
in interface TransportChannel
setPacketListener
in class TransportChannelSupport
listener
- public void setExceptionListener(ExceptionListener listener)
TransportChannelSupport
setExceptionListener
in interface TransportChannel
setExceptionListener
in class TransportChannelSupport
listener
- public boolean isMulticast()
isMulticast
in interface TransportChannel
isMulticast
in class TransportChannelSupport
public long getEstablishConnectionTimeout()
public void setEstablishConnectionTimeout(long establishConnectionTimeout)
public int getMaximumRetries()
public void setMaximumRetries(int maximumRetries)
public long getFailureSleepTime()
public void setFailureSleepTime(long failureSleepTime)
public List getUris()
public void setUris(List list)
public boolean isIncrementTimeout()
public void setIncrementTimeout(boolean incrementTimeout)
incrementTimeout
- The incrementTimeout to set.public long getMaximumTimeout()
public void setMaximumTimeout(long maximumTimeout)
maximumTimeout
- The maximumTimeout to set.public void setClientID(String clientID)
TransportChannel
setClientID
in interface TransportChannel
setClientID
in class TransportChannelSupport
clientID
- set the clientIDpublic boolean canProcessWireFormatVersion(int version)
canProcessWireFormatVersion
in interface TransportChannel
canProcessWireFormatVersion
in class TransportChannelSupport
version
- the version number to test
public int getCurrentWireFormatVersion()
getCurrentWireFormatVersion
in interface TransportChannel
getCurrentWireFormatVersion
in class TransportChannelSupport
public TransportChannel getChannel() throws JMSException
JMSException
- if no channel is availableprotected void establishConnection(long timeout) throws JMSException
JMSException
protected void configureChannel()
protected URI extractURI(List list) throws JMSException
JMSException
protected void attemptToConnect(URI uri) throws JMSException
JMSException
public void statusChanged(TransportStatusEvent event)
TransportStatusEventListener
statusChanged
in interface TransportStatusEventListener
event
- public boolean isTransportConnected()
isTransportConnected
in interface TransportChannel
isTransportConnected
in class TransportChannelSupport
public long getLastReceiptTimestamp()
TransportChannel
getLastReceiptTimestamp
in interface TransportChannel
getLastReceiptTimestamp
in class TransportChannelSupport
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |