org.objectweb.dream.message.manager
Class PoolNonExtensibleMessageManagerImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.message.manager.PoolNonExtensibleMessageManagerImpl
All Implemented Interfaces:
AttributeController, BindingController, LifeCycleController, Loggable, MessageManager, MessageManagerAttributeController, NonExtensibleMessageManagerAttributeController, PoolMessageManagerAttributeController, PoolNonExtensibleMessageManagerAttributeController
Direct Known Subclasses:
DebugPoolNonExtensibleMessageManagerImpl

public class PoolNonExtensibleMessageManagerImpl
extends AbstractComponent
implements MessageManager, PoolNonExtensibleMessageManagerAttributeController

This class provides an implementation of message managers for non extensible messages. It pools message instances.

The class of messages to be managed is given using the NonExtensibleMessageManagerAttributeController.


Field Summary
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.message.manager.MessageManager
ITF_NAME
 
Fields inherited from interface org.objectweb.dream.message.manager.MessageManagerAttributeController
ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
PoolNonExtensibleMessageManagerImpl()
           
 
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.
 int getCapacity()
          Returns the instance pool capacity.
 short getId()
          Returns the manager's id.
 String getMessageClassName()
          Returns the name of the class of non extensible messages that are managed by the manager to which this interface belongs.
 short getMessageManagerId()
          Returns the message manager identifier.
 String[] listFc()
           
 void setCapacity(int capacity)
          Sets the instance pool capacity.
 void setId(short id)
          Sets the manager's id.
 void setMessageClassName(String name)
          Sets the name of the class of non extensible messages that are managed by the manager to which this interface belongs.
 
Methods inherited from class org.objectweb.dream.AbstractComponent
bindFc, getFcState, initComponent, lookupFc, setLogger, startFc, stopFc, unbindFc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoolNonExtensibleMessageManagerImpl

public PoolNonExtensibleMessageManagerImpl()
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)

getCapacity

public int getCapacity()
Description copied from interface: PoolMessageManagerAttributeController
Returns the instance pool capacity.

Specified by:
getCapacity in interface PoolMessageManagerAttributeController
Returns:
the instance pool capacity.
See Also:
PoolMessageManagerAttributeController.getCapacity()

setCapacity

public void setCapacity(int capacity)
Description copied from interface: PoolMessageManagerAttributeController
Sets the instance pool capacity.

Specified by:
setCapacity in interface PoolMessageManagerAttributeController
Parameters:
capacity - the instance pool capacity.
See Also:
PoolMessageManagerAttributeController.setCapacity(int)

getMessageClassName

public String getMessageClassName()
Description copied from interface: NonExtensibleMessageManagerAttributeController
Returns the name of the class of non extensible messages that are managed by the manager to which this interface belongs.

Specified by:
getMessageClassName in interface NonExtensibleMessageManagerAttributeController
Returns:
the name of the class of messages.
See Also:
NonExtensibleMessageManagerAttributeController.getMessageClassName()

setMessageClassName

public void setMessageClassName(String name)
Description copied from interface: NonExtensibleMessageManagerAttributeController
Sets the name of the class of non extensible messages that are managed by the manager to which this interface belongs.

Specified by:
setMessageClassName in interface NonExtensibleMessageManagerAttributeController
Parameters:
name - the name of the class of messages.
See Also:
NonExtensibleMessageManagerAttributeController.setMessageClassName(String)

listFc

public String[] listFc()
Specified by:
listFc in interface BindingController
See Also:
BindingController.listFc()


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