|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TransportChannel
A TransportChannel is used for tranporting packets between nodes e.g. a ActiveMQ JMS Connection and Broker. The TransportChannel supports synchronous and asynchronous send operations as well as sync or async reading of packets. A TransportChannel implementation could use a dedicated thread using blocking IO to read from a socket or could use NIO or poll some file system or database etc. On receipt of a Packet the TransportChannel should invoke the PacketListener
Method Summary | |
---|---|
void |
addTransportStatusEventListener(TransportStatusEventListener listener)
Add a listener for changes in a channels status |
void |
asyncSend(Packet packet)
Asynchronously send a Packet |
ReceiptHolder |
asyncSendWithReceipt(Packet packet)
Asynchronously send a Packet with receipt. |
boolean |
canProcessWireFormatVersion(int version)
Can this wireformat process packets of this version |
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 |
void |
forceDisconnect()
Forces an immediate transport-level disconnect which will be asynchronously reported as an exception to the exceptionListener. |
String |
getClientID()
|
int |
getCurrentWireFormatVersion()
|
BrokerConnector |
getEmbeddedBrokerConnector()
Some transports that rely on an embedded broker need to create the connector used by the broker |
long |
getLastReceiptTimestamp()
Gets the timestamp of the last received receipt packet. |
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()
|
void |
removeTransportStatusEventListener(TransportStatusEventListener listener)
Remove a listener for changes in a channels status |
boolean |
requiresEmbeddedBroker()
Some transports rely on an embedded broker (peer based protocols) |
Receipt |
send(Packet packet)
synchronously send a Packet |
Receipt |
send(Packet packet,
int timeout)
Synchrnously 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 listener)
A listener to be notified when the channel is removed |
void |
setUsedInternally(boolean usedInternally)
|
void |
setWireFormat(WireFormat wireformat)
set the wire format to be used by this channel |
void |
start()
start listeneing for events |
void |
stop()
close the channel |
Method Detail |
---|
void setPendingStop(boolean pendingStop)
pendingStop
- boolean isPendingStop()
void stop()
stop
in interface Service
void start() throws JMSException
start
in interface Service
JMSException
- if an error occursvoid forceDisconnect()
long getLastReceiptTimestamp()
Receipt send(Packet packet) throws JMSException
packet
-
JMSException
Receipt send(Packet packet, int timeout) throws JMSException
packet
- packet to sendtimeout
- amount of time to wait for a receipt
JMSException
void asyncSend(Packet packet) throws JMSException
packet
- the packet to send
JMSException
ReceiptHolder asyncSendWithReceipt(Packet packet) throws JMSException
packet
- the packet to send
JMSException
void setPacketListener(PacketListener l)
l
- void setExceptionListener(ExceptionListener listener)
listener
- boolean isMulticast()
void addTransportStatusEventListener(TransportStatusEventListener listener)
listener
- void removeTransportStatusEventListener(TransportStatusEventListener listener)
listener
- void setClientID(String clientID)
clientID
- String getClientID()
void setTransportChannelListener(TransportChannelListener listener)
listener
- boolean isServerSide()
void setServerSide(boolean serverSide)
serverSide
- boolean canProcessWireFormatVersion(int version)
version
- the version number to test
int getCurrentWireFormatVersion()
boolean isTransportConnected()
boolean requiresEmbeddedBroker()
BrokerConnector getEmbeddedBrokerConnector() throws JMSException
JMSException
void setWireFormat(WireFormat wireformat)
wireformat
- WireFormat getWireFormat()
boolean doesSupportWireFormatVersioning()
boolean doesSupportMessageFragmentation()
boolean doesSupportMessageCompression()
boolean isCachingEnabled()
void setCachingEnabled(boolean cachingEnabled)
cachingEnabled
- The cachingEnabled to set.boolean isNoDelay()
void setNoDelay(boolean noDelay)
noDelay
- The noDelay to set.boolean isUsedInternally()
void setUsedInternally(boolean usedInternally)
usedInternally
- The usedInternally to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |