org.ow2.easybeans.component.smartclient.message
Class AbsNameBytesMessage

java.lang.Object
  extended by org.ow2.easybeans.component.smartclient.message.AbsMessage
      extended by org.ow2.easybeans.component.smartclient.message.AbsNameBytesMessage
All Implemented Interfaces:
Message
Direct Known Subclasses:
ClassAnswer, ResourceAnswer

public abstract class AbsNameBytesMessage
extends AbsMessage

Abstract class used for exchanging a name and an array of bytes.

Author:
Florent Benoit

Field Summary
 
Fields inherited from interface org.ow2.easybeans.component.smartclient.api.Message
HEADER_SIZE, INT_BYTE_SIZE
 
Constructor Summary
AbsNameBytesMessage(java.nio.ByteBuffer dataBuffer)
          Builds an message with the given bytebuffer.
AbsNameBytesMessage(java.lang.String name, byte[] bytes)
          Builds a new message with the given name and the array of bytes.
 
Method Summary
 byte[] getBytes()
          Gets the bytes of this message.
 java.lang.String getName()
          Gets the name of this message.
abstract  byte getOpCode()
          Gets the OpCode of this message.
 java.nio.ByteBuffer getSubMessage()
          Gets the content of this message (only this part, not the header).
 
Methods inherited from class org.ow2.easybeans.component.smartclient.message.AbsMessage
decode, encode, getMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsNameBytesMessage

public AbsNameBytesMessage(java.lang.String name,
                           byte[] bytes)
Builds a new message with the given name and the array of bytes.

Parameters:
name - the given name
bytes - the array of bytes to store.

AbsNameBytesMessage

public AbsNameBytesMessage(java.nio.ByteBuffer dataBuffer)
Builds an message with the given bytebuffer.

Parameters:
dataBuffer - buffer containing the data to extract.
Method Detail

getOpCode

public abstract byte getOpCode()
Gets the OpCode of this message.

Specified by:
getOpCode in interface Message
Specified by:
getOpCode in class AbsMessage
Returns:
the operation code.

getSubMessage

public java.nio.ByteBuffer getSubMessage()
Gets the content of this message (only this part, not the header).

Specified by:
getSubMessage in class AbsMessage
Returns:
the content of this message.

getName

public java.lang.String getName()
Gets the name of this message.

Returns:
the name of this message.

getBytes

public byte[] getBytes()
Gets the bytes of this message.

Returns:
the bytes of this message.


Copyright © 2006-2007 OW2 Consortium. All Rights Reserved.