|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activemq.transport.TransportChannelSupport
Some basic functionality, common across most transport implementations of channels
Field Summary | |
protected boolean |
cachingEnabled
|
protected WireFormat |
currentWireFormat
|
protected boolean |
noDelay
|
protected boolean |
pendingStop
|
protected boolean |
transportConnected
|
protected boolean |
usedInternally
|
Constructor Summary | |
protected |
TransportChannelSupport()
|
protected |
TransportChannelSupport(WireFormat wf)
|
Method Summary | |
void |
addTransportStatusEventListener(TransportStatusEventListener listener)
Add a listener for changes in a channels status |
ReceiptHolder |
asyncSendWithReceipt(Packet packet)
Asynchronously send a Packet with receipt. |
boolean |
canProcessWireFormatVersion(int version)
Can this wireformat process packets of this version |
protected Packet |
doAsyncSend(Packet packet)
send a Packet to the raw underlying transport This method is here to allow specific implementations to override this method |
protected void |
doConsumePacket(Packet packet)
consume a packet from the channel |
protected void |
doConsumePacket(Packet packet,
PacketListener listener)
|
boolean |
doesSupportMessageCompression()
Some transports/wireformats will not be able to understand compressed messages |
boolean |
doesSupportMessageFragmentation()
some transports/wire formats will implement their own fragementation |
boolean |
doesSupportWireFormatVersioning()
Does the transport support wire format version info |
protected boolean |
doHandleReceipt(Packet packet)
|
protected boolean |
doHandleWireFormat(Packet packet)
|
protected void |
fireStatusEvent(TransportStatusEvent event)
Fire status event to any status event listeners |
protected void |
fireStatusEvent(URI remoteURI,
int status)
Fire status event to any status event listeners |
String |
getClientID()
|
int |
getCurrentWireFormatVersion()
|
BrokerConnector |
getEmbeddedBrokerConnector()
Some transports that rely on an embedded broker need to create the connector used by the broker |
ExceptionListener |
getExceptionListener()
|
long |
getLastReceiptTimestamp()
Gets the timestamp of the last received receipt packet. |
PacketListener |
getPacketListener()
|
TransportChannelListener |
getTransportChannelListener()
|
WireFormat |
getWireFormat()
Get the current wireformat used by this channel |
boolean |
isCachingEnabled()
|
boolean |
isMulticast()
|
boolean |
isNoDelay()
Inform Transport to send messages as quickly as possible - for Tcp - this means disabling Nagles, which on OSX may provide better performance for sync sends |
boolean |
isPendingStop()
|
boolean |
isServerSide()
|
boolean |
isTransportConnected()
|
boolean |
isUsedInternally()
|
protected void |
onAsyncException(JMSException e)
Handles an exception thrown while performing async dispatch of messages |
void |
removeTransportStatusEventListener(TransportStatusEventListener listener)
Remove a listener for changes in a channels status |
boolean |
requiresEmbeddedBroker()
Some transports rely on an embedded broker (beer based protocols) |
Receipt |
send(Packet packet)
synchronously send a Packet |
Receipt |
send(Packet packet,
int timeout)
Synchronously send a Packet |
void |
setCachingEnabled(boolean cachingEnabled)
|
void |
setClientID(String clientID)
Provides a way to specify the client ID that this channel is using |
void |
setExceptionListener(ExceptionListener listener)
Set an exception listener to listen for asynchronously generated exceptions |
void |
setNoDelay(boolean noDelay)
|
void |
setPacketListener(PacketListener l)
Set a listener for Packets |
void |
setPendingStop(boolean pendingStop)
Give the TransportChannel a hint it's about to stop |
void |
setServerSide(boolean serverSide)
set the server flag |
void |
setTransportChannelListener(TransportChannelListener transportChannelListener)
A listener to be notified when the channel is removed |
protected void |
setTransportConnected(boolean value)
|
void |
setUsedInternally(boolean usedInternally)
|
void |
setWireFormat(WireFormat wireformat)
set the wire format to be used by this channel |
void |
stop()
close the channel |
protected void |
stopExecutor(Executor executor)
A helper method to stop the execution of an executor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.activemq.transport.TransportChannel |
asyncSend, forceDisconnect, start |
Field Detail |
protected boolean pendingStop
protected boolean transportConnected
protected WireFormat currentWireFormat
protected boolean cachingEnabled
protected boolean noDelay
protected boolean usedInternally
Constructor Detail |
protected TransportChannelSupport()
protected TransportChannelSupport(WireFormat wf)
Method Detail |
public void setPendingStop(boolean pendingStop)
setPendingStop
in interface TransportChannel
pendingStop
- public boolean isPendingStop()
isPendingStop
in interface TransportChannel
public void setWireFormat(WireFormat wireformat)
setWireFormat
in interface TransportChannel
wireformat
- public WireFormat getWireFormat()
getWireFormat
in interface TransportChannel
public void stop()
stop
in interface TransportChannel
public Receipt send(Packet packet) throws JMSException
send
in interface TransportChannel
packet
-
JMSException
public Receipt send(Packet packet, int timeout) throws JMSException
send
in interface TransportChannel
packet
- packet to sendtimeout
- amount of time to wait for a receipt
JMSException
public ReceiptHolder asyncSendWithReceipt(Packet packet) throws JMSException
asyncSendWithReceipt
in interface TransportChannel
packet
- the packet to send
JMSException
public TransportChannelListener getTransportChannelListener()
public void setTransportChannelListener(TransportChannelListener transportChannelListener)
TransportChannel
setTransportChannelListener
in interface TransportChannel
transportChannelListener
- public void addTransportStatusEventListener(TransportStatusEventListener listener)
addTransportStatusEventListener
in interface TransportChannel
listener
- public void removeTransportStatusEventListener(TransportStatusEventListener listener)
removeTransportStatusEventListener
in interface TransportChannel
listener
- public String getClientID()
getClientID
in interface TransportChannel
public void setClientID(String clientID)
TransportChannel
setClientID
in interface TransportChannel
clientID
- set the clientIDpublic ExceptionListener getExceptionListener()
public PacketListener getPacketListener()
public void setPacketListener(PacketListener l)
setPacketListener
in interface TransportChannel
l
- public void setExceptionListener(ExceptionListener listener)
setExceptionListener
in interface TransportChannel
listener
- public boolean isServerSide()
isServerSide
in interface TransportChannel
public void setServerSide(boolean serverSide)
TransportChannel
setServerSide
in interface TransportChannel
serverSide
- public boolean isTransportConnected()
isTransportConnected
in interface TransportChannel
protected void setTransportConnected(boolean value)
public boolean requiresEmbeddedBroker()
requiresEmbeddedBroker
in interface TransportChannel
public BrokerConnector getEmbeddedBrokerConnector() throws JMSException
getEmbeddedBrokerConnector
in interface TransportChannel
JMSException
public boolean isMulticast()
isMulticast
in interface TransportChannel
public boolean canProcessWireFormatVersion(int version)
canProcessWireFormatVersion
in interface TransportChannel
version
- the version number to test
public long getLastReceiptTimestamp()
TransportChannel
getLastReceiptTimestamp
in interface TransportChannel
public boolean isUsedInternally()
isUsedInternally
in interface TransportChannel
public void setUsedInternally(boolean usedInternally)
setUsedInternally
in interface TransportChannel
usedInternally
- The usedInternally to set.public boolean doesSupportWireFormatVersioning()
doesSupportWireFormatVersioning
in interface TransportChannel
public int getCurrentWireFormatVersion()
getCurrentWireFormatVersion
in interface TransportChannel
public boolean doesSupportMessageFragmentation()
doesSupportMessageFragmentation
in interface TransportChannel
public boolean doesSupportMessageCompression()
doesSupportMessageCompression
in interface TransportChannel
protected void doConsumePacket(Packet packet)
packet
-
UnsupportedWireFormatException
protected void doConsumePacket(Packet packet, PacketListener listener)
protected boolean doHandleReceipt(Packet packet)
protected boolean doHandleWireFormat(Packet packet)
protected Packet doAsyncSend(Packet packet) throws JMSException
packet
-
JMSException
protected void onAsyncException(JMSException e)
e
- protected void fireStatusEvent(URI remoteURI, int status)
remoteURI
- status
- protected void fireStatusEvent(TransportStatusEvent event)
event
- protected void stopExecutor(Executor executor) throws InterruptedException, JMSException
executor
- the executor or null if one is not created yet
InterruptedException
JMSException
public boolean isCachingEnabled()
isCachingEnabled
in interface TransportChannel
public void setCachingEnabled(boolean cachingEnabled)
setCachingEnabled
in interface TransportChannel
cachingEnabled
- The cachingEnabled to set.public boolean isNoDelay()
isNoDelay
in interface TransportChannel
public void setNoDelay(boolean noDelay)
setNoDelay
in interface TransportChannel
noDelay
- The noDelay to set.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |