org.objectweb.dream.message
Interface ExtensibleMessage

All Superinterfaces:
Message, Recyclable
All Known Subinterfaces:
ExtensibleMessageNC
All Known Implementing Classes:
AbstractExtensibleMessage, AggregateMessageImpl, ExtensibleMessageNCImpl

public interface ExtensibleMessage
extends Message

This interface defined methods to dynamically add or remove chunks and sub messages to this message. These methods are not defined in the Message interface for efficency reasons.


Field Summary
 
Fields inherited from interface org.objectweb.dream.message.Message
EMPTY_MESSAGE_ARRAY
 
Method Summary
 void addChunk(String name, ChunkType chkType, Object chunk)
          Adds a chunk in this message.
 void addSubMessage(Message message)
          Adds a sub message in this message.
 Object removeChunk(String name)
          Removes and returns the chunk with the specified name
 boolean removeSubMessage(Message message)
          Removes the specified sub message.
 void removeSubMessages()
          Removes every sub messages of this message.
 
Methods inherited from interface org.objectweb.dream.message.Message
getChunk, getMessageManagerId, getMessageType, getSubMessageIterator, getSubMessages, setMessageManagerId, transfertChunkStates
 
Methods inherited from interface org.objectweb.dream.pool.Recyclable
recycle
 

Method Detail

addChunk

public void addChunk(String name,
                     ChunkType chkType,
                     Object chunk)
              throws ChunkAlreadyExistsException
Adds a chunk in this message.

Parameters:
name - the name of the new chunk
chkType - the type of the new chunk
chunk - the chunk instance.
Throws:
ChunkAlreadyExistsException - if this message has already a chunk with the same name

removeChunk

public Object removeChunk(String name)
Removes and returns the chunk with the specified name

Parameters:
name - the name of the chunk to remove
Returns:
the removed chunk or null if no chunk with the specified name can be found.

addSubMessage

public void addSubMessage(Message message)
Adds a sub message in this message.

Parameters:
message - the message to add.

removeSubMessage

public boolean removeSubMessage(Message message)
Removes the specified sub message.

Parameters:
message - the message to be removed.
Returns:
true if the message has been removed, false otherwise.

removeSubMessages

public void removeSubMessages()
Removes every sub messages of this message.



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