org.objectweb.dream.message
Interface Message

All Known Subinterfaces:
ExtensibleMessage, ExtensibleMessageNC, MessageNC
All Known Implementing Classes:
AbstractExtensibleMessage, AbstractNonExtensibleMessage, BasicExtensibleMessageNC

public interface Message

Base interface of every messages manipulated by Dream components. A message is composed of named chunks and a list of sub messages. More precisely, A Message is a naming context for its chunks. This means that a message can not have two chunks with the same name. In addition a message can have two chunks with the same type since they have different names.

See Also:
Chunk, MessageType

Field Summary
static Message[] EMPTY_MESSAGE_ARRAY
          An empty Message array constant.
 
Method Summary
 Object getChunk(String name)
          Returns a chunk of this message, or null if this message doesn't have a chunk with the specified name.
 short getMessageManagerId()
          Returns the id of the message manager that created this message.
 MessageType getMessageType()
          Returns the type of this message.
 Iterator getSubMessageIterator()
          Returns an Iterator that iterate over the sub messages of this message.
 Message[] getSubMessages()
          Returns an (eventually empty) array containing the sub messages of this message.
 void recycle()
          Recycles message instance.
 void setMessageManagerId(short id)
          Sets the id of the message manager that created this message.
 void transfertChunkStates(Message newInstance)
          Transferts the state of the message's chunks into the specified new instance.
 

Field Detail

EMPTY_MESSAGE_ARRAY

public static final Message[] EMPTY_MESSAGE_ARRAY
An empty Message array constant. This constant should be used by classes requiring an empty Message array.

Method Detail

getMessageManagerId

public short getMessageManagerId()
Returns the id of the message manager that created this message.

Returns:
the id of the message manager that created this message.

setMessageManagerId

public void setMessageManagerId(short id)
Sets the id of the message manager that created this message.

Parameters:
id - the id of the message manager that created this message.

getChunk

public Object getChunk(String name)
Returns a chunk of this message, or null if this message doesn't have a chunk with the specified name.

Parameters:
name - the name of the chunk, as specified in the message type.
Returns:
a chunk of this message.

getSubMessageIterator

public Iterator getSubMessageIterator()
Returns an Iterator that iterate over the sub messages of this message.

Returns:
an iterator on the sub messages.

getSubMessages

public Message[] getSubMessages()
Returns an (eventually empty) array containing the sub messages of this message.

Returns:
an array containing the sub messages of this message.

getMessageType

public MessageType getMessageType()
Returns the type of this message.

Returns:
the type of this message.

transfertChunkStates

public void transfertChunkStates(Message newInstance)
Transferts the state of the message's chunks into the specified new instance.

Note: the given new isntance contains all the chunks contained in this message.

Parameters:
newInstance - the new instance of message.

recycle

public void recycle()
Recycles message instance. Called by message manager when the message is deleted.



Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.