org.objectweb.dream.message.manager
Interface MessageManager

All Known Implementing Classes:
BasicMessageManagerImpl, PoolNonExtensibleMessageManagerImpl

public interface MessageManager

A message manager is responsible for the life cycle of messages and chunks. This Interface is a component interface. Each Dream component has a MessageManager client interface (optionally bound).


Field Summary
static String ITF_NAME
          The commonly used name of refer to this interface.
 
Method Summary
 Object createChunk(ChunkType type)
          Allocates and returns a chunk of the specified type.
 Message createMessage(MessageType type)
          Allocates and returns a message of the specified type.
 void deleteChunk(Object chunk)
          Deletes a chunk.
 void deleteMessage(Message message)
          Deletes a message.
 Object duplicateChunk(Object chunk, boolean clone)
          Duplicates a chunk.
 Message duplicateMessage(Message message, boolean clone)
          Duplicates a message.
 short getMessageManagerId()
          Returns the message manager identifier.
 

Field Detail

ITF_NAME

public static final String ITF_NAME
The commonly used name of refer to this interface.

See Also:
Constant Field Values
Method Detail

createMessage

public Message createMessage(MessageType type)
                      throws UnknownChunkTypeError
Allocates and returns a message of the specified type. Depending on the implementation, the returned message is extensible (see ExtensibleMessage) or not.

Parameters:
type - the type of the message to be created.
Returns:
a message.
Throws:
UnknownChunkTypeError - if one of the chunk type in the message type is unknown by the manager (see createChunk(ChunkType)).

deleteMessage

public void deleteMessage(Message message)
Deletes a message. If the message has been duplicated (by reference), this operation releases the given reference. The message is effectively deleted only if all its references have been released.

Parameters:
message - the message to be deleted.

duplicateMessage

public Message duplicateMessage(Message message,
                                boolean clone)
Duplicates a message. There are two kinds of duplication:

Parameters:
message - the message to be duplicated.
clone - the duplication mode. false for reference duplication, true for value duplication.
Returns:
the duplicated message.

createChunk

public Object createChunk(ChunkType type)
                   throws UnknownChunkTypeError
Allocates and returns a chunk of the specified type. A given manager implementation knows only a restricted set of ChunkType, so if the requesed chunk type is unknown, a UnknownChunkTypeErroris thrown

Parameters:
type - the type of the chunk to be created.
Returns:
a chunk.
Throws:
UnknownChunkTypeError - if the chunk type can not be resolved by the manager (cannot find implementation).

deleteChunk

public void deleteChunk(Object chunk)
Deletes a chunk. If the chunk has been duplicated (by reference), this operation releases the given reference. The chunk is effectively deleted only if all its references have been released.

Parameters:
chunk - the chunk to delete.

duplicateChunk

public Object duplicateChunk(Object chunk,
                             boolean clone)
Duplicates a chunk. As for messages, there are two kinds of duplications (see duplicateMessage(Message, boolean)).

Parameters:
chunk - the chunk to be duplicated.
clone - the duplication mode.
Returns:
the duplicated chunk.

getMessageManagerId

public short getMessageManagerId()
Returns the message manager identifier.

Returns:
the message manager identifier.


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