|
|||||||||
| Home >> All >> org >> activemq >> [ io overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.activemq.io
Class AbstractWireFormat

java.lang.Objectorg.activemq.io.AbstractWireFormat
- All Implemented Interfaces:
- WireFormat
- Direct Known Subclasses:
- TextWireFormat
- public abstract class AbstractWireFormat
- extends java.lang.Object
- implements WireFormat
- extends java.lang.Object
Represents a strategy of encoding packets on the wire or on disk using some kind of serialization or wire format.
We use a default efficient format for Java to Java communication but other formats to other systems can be used, such as using simple text strings when talking to JavaScript or coming up with other formats for talking to C / C# languages or proprietary messaging systems we wish to interface with at the wire level etc.
- Version:
- $Revision: 1.1.1.1 $
| Field Summary | |
protected boolean |
cachingEnabled
|
private static org.apache.commons.logging.Log |
log
|
protected java.io.DataInputStream |
transportDataIn
|
protected java.io.DataOutputStream |
transportDataOut
|
| Fields inherited from interface org.activemq.io.WireFormat |
DEFAULT_MAXIMUM_MESSAGE_SIZE |
| Constructor Summary | |
AbstractWireFormat()
|
|
| Method Summary | |
boolean |
doesSupportMessageCompression()
Some wire formats will not be able to understand compressed messages |
boolean |
doesSupportMessageFragmentation()
some wire formats will implement their own fragementation |
org.activemq.message.Packet |
fromBytes(byte[] bytes)
Reads the packet from the given byte[] |
org.activemq.message.Packet |
fromBytes(byte[] bytes,
int offset,
int length)
Reads the packet from the given byte[] |
java.io.DataInputStream |
getTransportDataIn()
|
java.io.DataOutputStream |
getTransportDataOut()
|
void |
initiateClientSideProtocol()
Some wire formats require a handshake at start-up |
void |
initiateServerSideProtocol()
Some wire formats require a handshake at start-up |
boolean |
isCachingEnabled()
|
org.activemq.message.Packet |
readPacket(java.io.DataInput dataIn)
Reads a packet from the given input stream |
org.activemq.message.Packet |
readPacket(java.lang.String channelID,
java.net.DatagramPacket dpacket)
Read a packet from a Datagram packet from the given channelID. |
void |
registerTransportStreams(java.io.DataOutputStream dataOut,
java.io.DataInputStream dataIn)
some transports may register their streams (e.g. |
void |
setCachingEnabled(boolean enableCaching)
|
void |
setTransportDataIn(java.io.DataInputStream transportDataIn)
|
void |
setTransportDataOut(java.io.DataOutputStream transportDataOut)
|
byte[] |
toBytes(org.activemq.message.Packet packet)
A helper method which converts a packet into a byte array |
java.net.DatagramPacket |
writePacket(java.lang.String channelID,
org.activemq.message.Packet packet)
Writes the given package to a new datagram |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.activemq.io.WireFormat |
canProcessWireFormatVersion, copy, getCurrentWireFormatVersion, readPacket, writePacket |
| Field Detail |
log
private static final org.apache.commons.logging.Log log
transportDataOut
protected java.io.DataOutputStream transportDataOut
transportDataIn
protected java.io.DataInputStream transportDataIn
cachingEnabled
protected boolean cachingEnabled
| Constructor Detail |
AbstractWireFormat
public AbstractWireFormat()
| Method Detail |
readPacket
public org.activemq.message.Packet readPacket(java.lang.String channelID, java.net.DatagramPacket dpacket) throws java.io.IOException
- Read a packet from a Datagram packet from the given channelID. If the packet is from the same channel ID as it
was sent then we have a loop-back so discard the packet
- Specified by:
readPacketin interfaceWireFormat
writePacket
public java.net.DatagramPacket writePacket(java.lang.String channelID, org.activemq.message.Packet packet) throws java.io.IOException, javax.jms.JMSException
- Writes the given package to a new datagram
- Specified by:
writePacketin interfaceWireFormat
fromBytes
public org.activemq.message.Packet fromBytes(byte[] bytes, int offset, int length) throws java.io.IOException
- Reads the packet from the given byte[]
- Specified by:
fromBytesin interfaceWireFormat
fromBytes
public org.activemq.message.Packet fromBytes(byte[] bytes) throws java.io.IOException
- Reads the packet from the given byte[]
- Specified by:
fromBytesin interfaceWireFormat
toBytes
public byte[] toBytes(org.activemq.message.Packet packet) throws java.io.IOException, javax.jms.JMSException
- A helper method which converts a packet into a byte array
- Specified by:
toBytesin interfaceWireFormat
registerTransportStreams
public void registerTransportStreams(java.io.DataOutputStream dataOut, java.io.DataInputStream dataIn)
- some transports may register their streams (e.g. Tcp)
- Specified by:
registerTransportStreamsin interfaceWireFormat
initiateClientSideProtocol
public void initiateClientSideProtocol()
throws java.io.IOException
- Some wire formats require a handshake at start-up
- Specified by:
initiateClientSideProtocolin interfaceWireFormat
initiateServerSideProtocol
public void initiateServerSideProtocol()
throws java.io.IOException
- Some wire formats require a handshake at start-up
- Specified by:
initiateServerSideProtocolin interfaceWireFormat
isCachingEnabled
public boolean isCachingEnabled()
- Specified by:
isCachingEnabledin interfaceWireFormat
setCachingEnabled
public void setCachingEnabled(boolean enableCaching)
- Specified by:
setCachingEnabledin interfaceWireFormat
doesSupportMessageFragmentation
public boolean doesSupportMessageFragmentation()
- some wire formats will implement their own fragementation
- Specified by:
doesSupportMessageFragmentationin interfaceWireFormat
doesSupportMessageCompression
public boolean doesSupportMessageCompression()
- Some wire formats will not be able to understand compressed messages
- Specified by:
doesSupportMessageCompressionin interfaceWireFormat
getTransportDataOut
public java.io.DataOutputStream getTransportDataOut()
setTransportDataOut
public void setTransportDataOut(java.io.DataOutputStream transportDataOut)
getTransportDataIn
public java.io.DataInputStream getTransportDataIn()
setTransportDataIn
public void setTransportDataIn(java.io.DataInputStream transportDataIn)
readPacket
public org.activemq.message.Packet readPacket(java.io.DataInput dataIn) throws java.io.IOException
- Description copied from interface:
WireFormat - Reads a packet from the given input stream
- Specified by:
readPacketin interfaceWireFormat
|
|||||||||
| Home >> All >> org >> activemq >> [ io overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.activemq.io.AbstractWireFormat