org.objectweb.dream.message.manager
Class BasicMessageManagerImpl

java.lang.Object
  extended byorg.objectweb.dream.message.manager.BasicMessageManagerImpl
All Implemented Interfaces:
AttributeController, MessageManager, MessageManagerAttributeController

public class BasicMessageManagerImpl
extends Object
implements MessageManager, MessageManagerAttributeController

Basic implementation of a message manager. This message manager doesn't pool instances.


Field Summary
 
Fields inherited from interface org.objectweb.dream.message.manager.MessageManager
ITF_NAME
 
Fields inherited from interface org.objectweb.dream.message.manager.MessageManagerAttributeController
ITF_NAME
 
Constructor Summary
BasicMessageManagerImpl()
           
 
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 getId()
          Returns the manager's id.
 short getMessageManagerId()
          Returns the message manager identifier.
 void setId(short id)
          Sets the manager's id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicMessageManagerImpl

public BasicMessageManagerImpl()
Method Detail

createMessage

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

Specified by:
createMessage in interface MessageManager
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 MessageManager.createChunk(ChunkType)).
See Also:
MessageManager.createMessage(MessageType)

deleteMessage

public void deleteMessage(Message message)
Description copied from interface: MessageManager
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.

Specified by:
deleteMessage in interface MessageManager
Parameters:
message - the message to be deleted.
See Also:
MessageManager.deleteMessage(Message)

duplicateMessage

public Message duplicateMessage(Message message,
                                boolean clone)
Description copied from interface: MessageManager
Duplicates a message. There are two kinds of duplication:

Specified by:
duplicateMessage in interface MessageManager
Parameters:
message - the message to be duplicated.
clone - the duplication mode. false for reference duplication, true for value duplication.
Returns:
the duplicated message.
See Also:
MessageManager.duplicateMessage(Message, boolean)

createChunk

public Object createChunk(ChunkType type)
                   throws UnknownChunkTypeError
Description copied from interface: MessageManager
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

Specified by:
createChunk in interface MessageManager
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).
See Also:
MessageManager.createChunk(ChunkType)

deleteChunk

public void deleteChunk(Object chunk)
Description copied from interface: MessageManager
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.

Specified by:
deleteChunk in interface MessageManager
Parameters:
chunk - the chunk to delete.
See Also:
MessageManager.deleteChunk(Object)

duplicateChunk

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

Specified by:
duplicateChunk in interface MessageManager
Parameters:
chunk - the chunk to be duplicated.
clone - the duplication mode.
Returns:
the duplicated chunk.
See Also:
MessageManager.duplicateChunk(Object, boolean)

getMessageManagerId

public short getMessageManagerId()
Description copied from interface: MessageManager
Returns the message manager identifier.

Specified by:
getMessageManagerId in interface MessageManager
Returns:
the message manager identifier.
See Also:
MessageManager.getMessageManagerId()

getId

public short getId()
Description copied from interface: MessageManagerAttributeController
Returns the manager's id.

Specified by:
getId in interface MessageManagerAttributeController
Returns:
the manager's id.
See Also:
MessageManagerAttributeController.getId()

setId

public void setId(short id)
Description copied from interface: MessageManagerAttributeController
Sets the manager's id.

Specified by:
setId in interface MessageManagerAttributeController
Parameters:
id - the id to set.
See Also:
MessageManagerAttributeController.setId(short)


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