|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.activemq.transport.TransportChannelSupport
Some basic functionality, common across most transport implementations of channels
Field Summary | |
protected boolean |
pendingStop
|
protected boolean |
transportConnected
|
Constructor Summary | |
TransportChannelSupport()
|
Method Summary | |
void |
addTransportStatusEventListener(TransportStatusEventListener listener)
Add a listener for changes in a channels status |
protected void |
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)
|
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()
|
ExceptionListener |
getExceptionListener()
|
PacketListener |
getPacketListener()
|
TransportChannelListener |
getTransportChannelListener()
|
boolean |
isPendingStop()
|
boolean |
isServerSide()
|
boolean |
isTransportConnected()
|
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 |
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 |
setExceptionListener(ExceptionListener listener)
Set an exception listener to listen for asynchronously generated exceptions |
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 |
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.codehaus.activemq.transport.TransportChannel |
asyncSend, canProcessWireFormatVersion, getCurrentWireFormatVersion, isMulticast, start |
Field Detail |
protected boolean pendingStop
protected boolean transportConnected
Constructor Detail |
public TransportChannelSupport()
Method Detail |
public void setPendingStop(boolean pendingStop)
setPendingStop
in interface TransportChannel
pendingStop
- public boolean isPendingStop()
isPendingStop
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 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)
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 void 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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |