org.objectweb.dream.message
Class AbstractNonExtensibleMessage

java.lang.Object
  extended byorg.objectweb.dream.message.AbstractNonExtensibleMessage
All Implemented Interfaces:
Cloneable, Message, MessageReferenceCounter, MessageType, Recyclable, Serializable

public abstract class AbstractNonExtensibleMessage
extends Object
implements Message, MessageType, MessageReferenceCounter, Cloneable, Serializable

Basic implementation of a non-extensible message. This class is intended to be extended by specific non-extensible message implementations. It implements the Messageand MessageTypeinterfaces.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.objectweb.dream.message.Message
EMPTY_MESSAGE_ARRAY
 
Fields inherited from interface org.objectweb.dream.message.MessageType
EMPTY_MESSAGE_TYPE_ARRAY
 
Constructor Summary
AbstractNonExtensibleMessage()
           
 
Method Summary
 boolean decrementReferenceCounter()
          Decrements the reference counter of this message.
 Object getChunk(String name)
          This class implements every chunk so it allways returns this.
 String[] getChunkNames()
          Returns an (eventually empty) array containing the chunk's names of messages of this type.
 Iterator getChunkNamesIterator()
          Returns an iterator over the chunk's names of messages of this type.
 ChunkType getChunkType(String name)
          Returns a chunk type of this message type from its 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()
          Allways returns Message.EMPTY_MESSAGE_ARRAY
 MessageType[] getSubMessageTypes()
          Returns an (eventually empty) array containing the types of the sub messages of messages of this type.
 Iterator getSubMessageTypesIterator()
          Returns an iterator over the types of the sub messages of messages of this type.
 void incrementReferenceCounter()
          Increments the reference counter of the message.
 boolean isEmpty()
          Returns true if this message type is empty (ie : does not contains any chunk types and any sub message types)
 boolean isSubTypeOf(MessageType t)
          Returns true if this message type if a sub type of the given message type.
 void setMessageManagerId(short id)
          Sets the id of the message manager that created this message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.dream.message.Message
transfertChunkStates
 
Methods inherited from interface org.objectweb.dream.pool.Recyclable
recycle
 

Constructor Detail

AbstractNonExtensibleMessage

public AbstractNonExtensibleMessage()
Method Detail

getChunk

public Object getChunk(String name)
This class implements every chunk so it allways returns this. Warning : the given chunk name is not checked

Specified by:
getChunk in interface Message
Parameters:
name - the name of the chunk, as specified in the message type.
Returns:
a chunk of this message.
See Also:
Message.getChunk(String)

getSubMessages

public Message[] getSubMessages()
Allways returns Message.EMPTY_MESSAGE_ARRAY

Specified by:
getSubMessages in interface Message
Returns:
an array containing the sub messages of this message.
See Also:
Message.getSubMessages()

getSubMessageIterator

public Iterator getSubMessageIterator()
Description copied from interface: Message
Returns an Iterator that iterate over the sub messages of this message.

Specified by:
getSubMessageIterator in interface Message
Returns:
an iterator on the sub messages.
See Also:
Message.getSubMessageIterator()

getMessageType

public MessageType getMessageType()
Description copied from interface: Message
Returns the type of this message.

Specified by:
getMessageType in interface Message
Returns:
the type of this message.
See Also:
Message.getMessageType()

getMessageManagerId

public short getMessageManagerId()
Description copied from interface: Message
Returns the id of the message manager that created this message.

Specified by:
getMessageManagerId in interface Message
Returns:
the id of the message manager that created this message.
See Also:
Message.getMessageManagerId()

setMessageManagerId

public void setMessageManagerId(short id)
Description copied from interface: Message
Sets the id of the message manager that created this message.

Specified by:
setMessageManagerId in interface Message
Parameters:
id - the id of the message manager that created this message.
See Also:
Message.setMessageManagerId(short)

getSubMessageTypes

public MessageType[] getSubMessageTypes()
Description copied from interface: MessageType
Returns an (eventually empty) array containing the types of the sub messages of messages of this type.

Specified by:
getSubMessageTypes in interface MessageType
Returns:
an array containing the types of the sub messages of messages of this type.
See Also:
MessageType.getSubMessageTypes()

getSubMessageTypesIterator

public Iterator getSubMessageTypesIterator()
Description copied from interface: MessageType
Returns an iterator over the types of the sub messages of messages of this type.

Specified by:
getSubMessageTypesIterator in interface MessageType
Returns:
an iterator over the types of the sub messages of messages of this type.
See Also:
MessageType.getSubMessageTypesIterator()

isEmpty

public boolean isEmpty()
Description copied from interface: MessageType
Returns true if this message type is empty (ie : does not contains any chunk types and any sub message types)

Specified by:
isEmpty in interface MessageType
Returns:
true if this message type is empty
See Also:
MessageType.isEmpty()

isSubTypeOf

public boolean isSubTypeOf(MessageType t)
Description copied from interface: MessageType
Returns true if this message type if a sub type of the given message type.

Specified by:
isSubTypeOf in interface MessageType
Parameters:
t - a message type
Returns:
true if this message type if a sub type of the given message type.
See Also:
MessageType.isSubTypeOf(MessageType)

getChunkNames

public String[] getChunkNames()
Description copied from interface: MessageType
Returns an (eventually empty) array containing the chunk's names of messages of this type.

Specified by:
getChunkNames in interface MessageType
Returns:
an array containing the chunk's names of messages of this type.
See Also:
MessageType.getChunkNames()

getChunkNamesIterator

public Iterator getChunkNamesIterator()
Description copied from interface: MessageType
Returns an iterator over the chunk's names of messages of this type.

Specified by:
getChunkNamesIterator in interface MessageType
Returns:
an iterator over the chunk's names of messages of this type.
See Also:
MessageType.getChunkNamesIterator()

getChunkType

public ChunkType getChunkType(String name)
Description copied from interface: MessageType
Returns a chunk type of this message type from its name.

Specified by:
getChunkType in interface MessageType
Parameters:
name - the name of one of the chunk types returned by MessageType.getChunkNames().
Returns:
a chunk type of this message type from its name or null if no chunk with the specified name can be found.
See Also:
MessageType.getChunkType(String)

incrementReferenceCounter

public void incrementReferenceCounter()
Description copied from interface: MessageReferenceCounter
Increments the reference counter of the message.

Specified by:
incrementReferenceCounter in interface MessageReferenceCounter
See Also:
MessageReferenceCounter.incrementReferenceCounter()

decrementReferenceCounter

public boolean decrementReferenceCounter()
Description copied from interface: MessageReferenceCounter
Decrements the reference counter of this message.

Specified by:
decrementReferenceCounter in interface MessageReferenceCounter
Returns:
true if the reference counter is null.
See Also:
MessageReferenceCounter.decrementReferenceCounter()


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