org.apache.tomcat.bayeux
Class MessageImpl
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<java.lang.String,java.lang.Object>
org.apache.tomcat.bayeux.MessageImpl
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>, Message
public class MessageImpl
- extends java.util.HashMap<java.lang.String,java.lang.Object>
- implements Message
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class java.util.AbstractMap |
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
Constructor Summary |
protected |
MessageImpl(java.lang.String id)
|
Method Summary |
java.lang.Object |
clone()
|
Channel |
getChannel()
Returns a reference to the channel that this message was published throuhg |
Client |
getClient()
Returns a reference to the client that sent this message |
long |
getCreationTime()
returns the timestamp in milliseconds(System.currentTimeMillis()) of when this message was created. |
java.lang.String |
getId()
Returns the unique id of this message |
long |
getTTL()
Returns the time to live (in milliseconds) for this message |
protected void |
setChannel(Channel channel)
|
protected void |
setClient(Client client)
|
void |
setTTL(long TTL)
Sets the time to live in milliseconds. |
Methods inherited from class java.util.HashMap |
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
channel
protected Channel channel
client
protected Client client
id
protected java.lang.String id
creationTime
protected long creationTime
MessageImpl
protected MessageImpl(java.lang.String id)
clone
public java.lang.Object clone()
- Overrides:
clone
in class java.util.HashMap<java.lang.String,java.lang.Object>
getChannel
public Channel getChannel()
- Description copied from interface:
Message
- Returns a reference to the channel that this message was published throuhg
- Specified by:
getChannel
in interface Message
- Returns:
- Channel - may be null
getClient
public Client getClient()
- Description copied from interface:
Message
- Returns a reference to the client that sent this message
- Specified by:
getClient
in interface Message
- Returns:
- Client - may be null
getCreationTime
public long getCreationTime()
- Description copied from interface:
Message
- returns the timestamp in milliseconds(System.currentTimeMillis()) of when this message was created.
- Specified by:
getCreationTime
in interface Message
- Returns:
- long
getTTL
public long getTTL()
- Description copied from interface:
Message
- Returns the time to live (in milliseconds) for this message
- Specified by:
getTTL
in interface Message
- Returns:
- long
getId
public java.lang.String getId()
- Description copied from interface:
Message
- Returns the unique id of this message
- Specified by:
getId
in interface Message
- Returns:
- String
setChannel
protected void setChannel(Channel channel)
setClient
protected void setClient(Client client)
setTTL
public void setTTL(long TTL)
- Description copied from interface:
Message
- Sets the time to live in milliseconds. If the message hasn't been delivered
when the time passed after the creation time is longer than the TTL the message will
expire and removed from any delivery queues.
- Specified by:
setTTL
in interface Message
- Parameters:
TTL
- long
Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.