org.jboss.narayana.blacktie.jatmibroker.xatmi
Class Buffer

java.lang.Object
  extended by org.jboss.narayana.blacktie.jatmibroker.xatmi.Buffer
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BT_NBF, X_C_TYPE, X_COMMON, X_OCTET

public abstract class Buffer
extends Object
implements Serializable

This class is used to send and receive data to and from clients to services.

See Also:
X_OCTET, X_C_TYPE, X_COMMON, Serialized Form

Field Summary
static int BYTE_SIZE
          The agreed size of a byte.
static int DOUBLE_SIZE
          The agreed size of a double.
static int FLOAT_SIZE
          The agreed size of a float.
static int INT_SIZE
          The agreed size of a int.
static int LONG_SIZE
          The agreed size of a long.
static int SHORT_SIZE
          The agreed size of a short.
 
Method Summary
 void clear()
          Clear the content of the buffer
protected  Object getAttributeValue(String key, Class type)
          Get the value of an attribute.
 Map<String,Class> getFormat()
          Get the format of the message.
 int getLen()
           
protected  byte[] getRawData()
          Get the raw data, used internally and by the X_OCTET buffer.
 String getSubtype()
          Get the subtype
 String getType()
          Get the type
protected  void setAttributeValue(String key, Class type, Object value)
          Set the value.
protected  void setRawData(byte[] bytes)
          Set the raw data, used by the X_OCTET buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE_SIZE

public static final int BYTE_SIZE
The agreed size of a byte.

See Also:
Constant Field Values

LONG_SIZE

public static final int LONG_SIZE
The agreed size of a long.

See Also:
Constant Field Values

INT_SIZE

public static final int INT_SIZE
The agreed size of a int.

See Also:
Constant Field Values

SHORT_SIZE

public static final int SHORT_SIZE
The agreed size of a short.

See Also:
Constant Field Values

FLOAT_SIZE

public static final int FLOAT_SIZE
The agreed size of a float.

See Also:
Constant Field Values

DOUBLE_SIZE

public static final int DOUBLE_SIZE
The agreed size of a double.

See Also:
Constant Field Values
Method Detail

getFormat

public Map<String,Class> getFormat()
Get the format of the message.

Returns:
The format of the message

getType

public String getType()
Get the type

Returns:
The type

getSubtype

public String getSubtype()
Get the subtype

Returns:
The subtype

clear

public void clear()
Clear the content of the buffer


getAttributeValue

protected Object getAttributeValue(String key,
                                   Class type)
                            throws ConnectionException
Get the value of an attribute.

Parameters:
key - The key
type - The type
Returns:
The value
Throws:
ConnectionException - In case the message is not formatted yet.

setAttributeValue

protected void setAttributeValue(String key,
                                 Class type,
                                 Object value)
                          throws ConnectionException
Set the value.

Parameters:
key - The key to set
type - The type of the value.
value - The value to use
Throws:
ConnectionException - In case the message is not formatted.

setRawData

protected void setRawData(byte[] bytes)
Set the raw data, used by the X_OCTET buffer.

Parameters:
bytes - The data to use.

getRawData

protected byte[] getRawData()
Get the raw data, used internally and by the X_OCTET buffer.

Returns:
The data.

getLen

public int getLen()


Copyright © 2011. All Rights Reserved.