org.codehaus.activemq.transport.jabber
Class JabberWireFormat

java.lang.Object
  extended byorg.codehaus.activemq.message.WireFormat
      extended byorg.codehaus.activemq.transport.jabber.JabberWireFormat

public class JabberWireFormat
extends WireFormat

A wire format which uses XMPP format of messages

Version:
$Revision: 1.3 $

Constructor Summary
JabberWireFormat()
           
 
Method Summary
 boolean canProcessWireFormatVersion(int version)
          Can this wireformat process packets of this version
 WireFormat copy()
          Creates a new copy of this wire format so it can be used in another thread/context
protected  String encodeBinary(byte[] data)
           
 int getCurrentWireFormatVersion()
           
protected  String getXmppType(ActiveMQMessage message)
           
 Packet readPacket(DataInput in)
          Reads a packet from the given input stream
 Packet readPacket(int firstByte, DataInput in)
          A helper method for working with sockets where the first byte is read first, then the rest of the message is read.
protected  void writeBytesMessage(ActiveMQBytesMessage message, DataOutput out)
           
protected  void writeMessage(ActiveMQMessage message, String body, DataOutput out)
           
protected  void writeObjectMessage(ActiveMQObjectMessage message, DataOutput out)
           
 void writePacket(Packet packet, DataOutput out)
          Writes the packet to the given output stream
protected  void writeTextMessage(ActiveMQTextMessage message, DataOutput out)
           
 
Methods inherited from class org.codehaus.activemq.message.WireFormat
fromBytes, fromBytes, readPacket, toBytes, writePacket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JabberWireFormat

public JabberWireFormat()
Method Detail

copy

public WireFormat copy()
Description copied from class: WireFormat
Creates a new copy of this wire format so it can be used in another thread/context

Specified by:
copy in class WireFormat
Returns:

readPacket

public Packet readPacket(DataInput in)
                  throws IOException
Description copied from class: WireFormat
Reads a packet from the given input stream

Specified by:
readPacket in class WireFormat
Parameters:
in -
Returns:
Throws:
IOException

readPacket

public Packet readPacket(int firstByte,
                         DataInput in)
                  throws IOException
Description copied from class: WireFormat
A helper method for working with sockets where the first byte is read first, then the rest of the message is read.

Its common when dealing with sockets to have different timeout semantics until the first non-zero byte is read of a message, after which time a zero timeout is used.

Specified by:
readPacket in class WireFormat
Parameters:
firstByte - the first byte of the packet
in - the rest of the packet
Returns:
Throws:
IOException

writePacket

public void writePacket(Packet packet,
                        DataOutput out)
                 throws IOException,
                        JMSException
Description copied from class: WireFormat
Writes the packet to the given output stream

Specified by:
writePacket in class WireFormat
Parameters:
packet -
out -
Throws:
IOException
JMSException

canProcessWireFormatVersion

public boolean canProcessWireFormatVersion(int version)
Can this wireformat process packets of this version

Specified by:
canProcessWireFormatVersion in class WireFormat
Parameters:
version - the version number to test
Returns:
true if can accept the version

getCurrentWireFormatVersion

public int getCurrentWireFormatVersion()
Specified by:
getCurrentWireFormatVersion in class WireFormat
Returns:
the current version of this wire format

writeObjectMessage

protected void writeObjectMessage(ActiveMQObjectMessage message,
                                  DataOutput out)
                           throws JMSException,
                                  IOException
Throws:
JMSException
IOException

writeTextMessage

protected void writeTextMessage(ActiveMQTextMessage message,
                                DataOutput out)
                         throws JMSException,
                                IOException
Throws:
JMSException
IOException

writeBytesMessage

protected void writeBytesMessage(ActiveMQBytesMessage message,
                                 DataOutput out)
                          throws IOException
Throws:
IOException

writeMessage

protected void writeMessage(ActiveMQMessage message,
                            String body,
                            DataOutput out)
                     throws IOException
Throws:
IOException

encodeBinary

protected String encodeBinary(byte[] data)

getXmppType

protected String getXmppType(ActiveMQMessage message)


Copyright © 2004 Protique, Ltd.. All Rights Reserved.