org.objectweb.dream.message
Class BasicExtensibleMessageNC

java.lang.Object
  extended byorg.objectweb.dream.message.AbstractExtensibleMessage
      extended byorg.objectweb.dream.message.BasicExtensibleMessage
          extended byorg.objectweb.dream.message.BasicExtensibleMessageNC
All Implemented Interfaces:
EmptyStringArray, ExtensibleMessage, ExtensibleMessageNC, Message, MessageNC, MessageType, MessageTypeNC, Serializable

public class BasicExtensibleMessageNC
extends BasicExtensibleMessage
implements ExtensibleMessageNC, MessageTypeNC

Implementation of extensible message with named sub messages.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.dream.message.AbstractExtensibleMessage
chunkNames, chunks, chunkTypes, messageManagerId
 
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
 
Fields inherited from interface org.objectweb.dream.util.EmptyStringArray
EMPTY_STRING_ARRAY
 
Constructor Summary
BasicExtensibleMessageNC(short messageManagerId)
          Constructor.
 
Method Summary
 void addSubMessage(String name, Message message)
          Adds a sub message in this message
 Message getSubMessage(String name)
          Returns a sub message of this message, or null if this message doesn't have a sub message with the specified name.
 Iterator getSubMessageIterator()
          Returns an Iterator that iterate over the sub messages of this message.
 String[] getSubMessageNames()
          Returns an (eventually empty) array containing the sub message's names of messages of this type.
 Iterator getSubMessageNamesIterator()
          Returns an iterator over the sub message's names of messages of this type.
 Message[] getSubMessages()
          Returns an (eventually empty) array containing the sub messages of this message.
 MessageType getSubMessageType(String name)
          Returns the type of the sub message having the specified name.
 MessageType[] getSubMessageTypes()
          Returns an (eventually empty) array containing the types of the sub messages of messages of this type.
 Iterator getUnnamedSubMessageIterator()
          Returns an Iterator that iterate over the unnamed sub messages of this message.
 Message[] getUnnamedSubMessages()
          Returns an (eventually empty) array containing the unnamed sub messages of this message.
 MessageType[] getUnnamedSubMessageTypes()
          Returns an (eventually empty) array containing the types of the unnamed sub messages of messages of this type.
 Iterator getUnnamedSubMessageTypesIterator()
          Returns an iterator over the types of the unnamed sub messages of messages of this type.
 Message removeSubMessage(String name)
          Removes and returns the sub message with the specified name.
 
Methods inherited from class org.objectweb.dream.message.BasicExtensibleMessage
addSubMessage, getSubMessageTypesIterator, isSubTypeOf, removeSubMessage
 
Methods inherited from class org.objectweb.dream.message.AbstractExtensibleMessage
addChunk, decrementReferenceCounter, getChunk, getChunkNames, getChunkNamesIterator, getChunkType, getMessageManagerId, getMessageType, incrementReferenceCounter, isEmpty, recycle, removeChunk, setMessageManagerId, transfertChunkStates
 
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.ExtensibleMessage
addChunk, addSubMessage, removeChunk, removeSubMessage
 
Methods inherited from interface org.objectweb.dream.message.Message
getChunk, getMessageManagerId, getMessageType, recycle, setMessageManagerId, transfertChunkStates
 
Methods inherited from interface org.objectweb.dream.message.MessageType
getChunkNames, getChunkNamesIterator, getChunkType, getSubMessageTypesIterator, isEmpty, isSubTypeOf
 

Constructor Detail

BasicExtensibleMessageNC

public BasicExtensibleMessageNC(short messageManagerId)
Constructor.

Parameters:
messageManagerId - the id of the message manager that creates this message.
Method Detail

getSubMessage

public Message getSubMessage(String name)
Description copied from interface: MessageNC
Returns a sub message of this message, or null if this message doesn't have a sub message with the specified name.

Specified by:
getSubMessage in interface MessageNC
Parameters:
name - the name of the sub message, as specified in the message type.
Returns:
a sub message of this message.
See Also:
MessageNC.getSubMessage(java.lang.String)

getSubMessageNames

public String[] getSubMessageNames()
Description copied from interface: MessageTypeNC
Returns an (eventually empty) array containing the sub message's names of messages of this type.

Specified by:
getSubMessageNames in interface MessageTypeNC
Returns:
an array containing the sub message's names of messages of this type.
See Also:
MessageTypeNC.getSubMessageNames()

getSubMessageNamesIterator

public Iterator getSubMessageNamesIterator()
Description copied from interface: MessageTypeNC
Returns an iterator over the sub message's names of messages of this type.

Specified by:
getSubMessageNamesIterator in interface MessageTypeNC
Returns:
an iterator over the sub message's names of messages of this type.
See Also:
MessageTypeNC.getSubMessageNamesIterator()

addSubMessage

public void addSubMessage(String name,
                          Message message)
                   throws MessageAlreadyExistException
Description copied from interface: ExtensibleMessageNC
Adds a sub message in this message

Specified by:
addSubMessage in interface ExtensibleMessageNC
Parameters:
name - the name of this new sub message.
message - the message to add.
Throws:
MessageAlreadyExistException - if this message has already an enclosed message with the same name
See Also:
ExtensibleMessageNC.addSubMessage(java.lang.String, org.objectweb.dream.message.Message)

removeSubMessage

public Message removeSubMessage(String name)
Description copied from interface: ExtensibleMessageNC
Removes and returns the sub message with the specified name.

Specified by:
removeSubMessage in interface ExtensibleMessageNC
Parameters:
name - the name of the enclosed message to remove.
Returns:
the removed message or null if no sub message with the specified name is found.
See Also:
ExtensibleMessageNC.removeSubMessage(java.lang.String)

getUnnamedSubMessageIterator

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

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

getUnnamedSubMessages

public Message[] getUnnamedSubMessages()
Description copied from interface: MessageNC
Returns an (eventually empty) array containing the unnamed sub messages of this message.

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

getSubMessageType

public MessageType getSubMessageType(String name)
Description copied from interface: MessageTypeNC
Returns the type of the sub message having the specified name.

Specified by:
getSubMessageType in interface MessageTypeNC
Parameters:
name - the name of one of the message types returned by MessageTypeNC.getSubMessageNames().
Returns:
the type of the sub message having the specified name or null if no sub message with the specified name exists.
See Also:
MessageTypeNC.getSubMessageType(java.lang.String)

getUnnamedSubMessageTypes

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

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

getUnnamedSubMessageTypesIterator

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

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

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
Overrides:
getSubMessageIterator in class BasicExtensibleMessage
See Also:
Message.getSubMessageIterator()

getSubMessages

public Message[] getSubMessages()
Description copied from interface: Message
Returns an (eventually empty) array containing the sub messages of this message.

Specified by:
getSubMessages in interface Message
Overrides:
getSubMessages in class BasicExtensibleMessage
See Also:
Message.getSubMessages()

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
Overrides:
getSubMessageTypes in class BasicExtensibleMessage
See Also:
MessageType.getSubMessageTypes()


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