|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.dream.message.AbstractExtensibleMessage
Abstract implementation of the ExtensibleMessage
interface.
Methods managing sub messages are not implemented.
Field Summary | |
protected String[] |
chunkNames
The chunk names |
protected Hashtable |
chunks
Contains (name, chunk object) pairs. |
protected Hashtable |
chunkTypes
Contains (name, chunk type) pairs. |
protected short |
messageManagerId
The id of the message manager that created this chunk. |
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 | |
AbstractExtensibleMessage()
|
Method Summary | |
void |
addChunk(String name,
ChunkType chkType,
Object chunk)
Adds a chunk in this message. |
boolean |
decrementReferenceCounter()
Decrements the reference counter of this component. |
Object |
getChunk(String name)
Returns a chunk of this message, or null if this message
doesn't have a chunk with the specified name. |
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. |
void |
incrementReferenceCounter()
Increments the reference counter of this component. |
boolean |
isEmpty()
Returns true if this message type is empty (ie : does not
contains any chunk types and any sub message types) |
void |
recycle()
Recycles message instance. |
Object |
removeChunk(String name)
Removes and returns the chunk with the specified name |
void |
setMessageManagerId(short id)
Sets the id of the message manager that created this message. |
void |
transfertChunkStates(Message newInstance)
Transferts the state of the message's chunks into the specified new instance. |
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 |
addSubMessage, removeSubMessage |
Methods inherited from interface org.objectweb.dream.message.Message |
getSubMessageIterator, getSubMessages |
Methods inherited from interface org.objectweb.dream.message.MessageType |
getSubMessageTypes, getSubMessageTypesIterator, isSubTypeOf |
Field Detail |
protected transient short messageManagerId
protected Hashtable chunks
protected Hashtable chunkTypes
protected String[] chunkNames
Constructor Detail |
public AbstractExtensibleMessage()
Method Detail |
public Object getChunk(String name)
Message
null
if this message
doesn't have a chunk with the specified name.
getChunk
in interface Message
name
- the name of the chunk, as specified in the message type.
Message.getChunk(String)
public MessageType getMessageType()
Message
getMessageType
in interface Message
Message.getMessageType()
public void transfertChunkStates(Message newInstance)
Message
Note: the given new isntance contains all the chunks contained in this message.
transfertChunkStates
in interface Message
newInstance
- the new instance of message.Message.transfertChunkStates(Message)
public short getMessageManagerId()
Message
getMessageManagerId
in interface Message
Message.getMessageManagerId()
public void setMessageManagerId(short id)
Message
setMessageManagerId
in interface Message
id
- the id of the message manager that created this message.Message.setMessageManagerId(short)
public void recycle()
Message
recycle
in interface Message
Message.recycle()
public void addChunk(String name, ChunkType chkType, Object chunk) throws ChunkAlreadyExistException
ExtensibleMessage
addChunk
in interface ExtensibleMessage
name
- the name of the new chunkchkType
- the type of the new chunkchunk
- the chunk instance.
ChunkAlreadyExistException
- if this message has already a chunk with
the same nameExtensibleMessage.addChunk(String, ChunkType, Object)
public Object removeChunk(String name)
ExtensibleMessage
removeChunk
in interface ExtensibleMessage
name
- the name of the chunk to remove
null
if no chunk with the
specified name can be found.ExtensibleMessage.removeChunk(String)
public String[] getChunkNames()
MessageType
getChunkNames
in interface MessageType
MessageType.getChunkNames()
public Iterator getChunkNamesIterator()
MessageType
getChunkNamesIterator
in interface MessageType
MessageType.getChunkNamesIterator()
public ChunkType getChunkType(String name)
MessageType
getChunkType
in interface MessageType
name
- the name of one of the chunk types returned by
MessageType.getChunkNames()
.
null
if no chunk with the specified name can be
found.MessageType.getChunkType(String)
public boolean isEmpty()
MessageType
true
if this message type is empty (ie : does not
contains any chunk types and any sub message types)
isEmpty
in interface MessageType
true
if this message type is emptyMessageType.isEmpty()
public void incrementReferenceCounter()
public boolean decrementReferenceCounter()
true
if the reference counter is null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |