public final class MessageSoftRef extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
MessageSoftRef.TransactionError |
Modifier and Type | Field and Description |
---|---|
private AgentId |
deadNotAgentId
The agent responsible of treating the notification when it expires.
|
private long |
expiration
The expiration date of the notification hold by the message, if any.
|
private static org.objectweb.util.monolog.api.Logger |
logmon |
private String |
messageId
If the notification is stored independently of its containing message,
messageId contains the persistent name of this notification.
|
private String |
name
Name for persistent message, used to retrieve garbaged message from
persistent storage.
|
private Message |
ref
Reference for transient message, used to pin non persistent in memory.
|
private SoftReference<Message> |
softRef
The SoftReference to the message, which permits to the message to be
garbaged in response to memory demand.
|
private int |
stamp
The stamp of the referenced message.
|
Constructor and Description |
---|
MessageSoftRef(Message msg) |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes the message in persistent storage.
|
AgentId |
getDeadNotAgentId()
Returns the agent responsible of treating the notification when it expires.
|
Message |
getMessage()
Returns this reference message's referent.
|
int |
getStamp()
Returns the stamp of the message backed by this MessageSoftRef, without
reloading it if it has been swapped.
|
boolean |
isExpired(long time)
Tests whether the message has expired.
|
Message |
loadMessage()
Returns the message to which this reference refers, loading it from disk if
the message has been swapped out.
|
String |
toString()
Returns a string representation of this
MessageSoftRef object. |
private static final org.objectweb.util.monolog.api.Logger logmon
private String name
private Message ref
private SoftReference<Message> softRef
private int stamp
private String messageId
private long expiration
private AgentId deadNotAgentId
MessageSoftRef(Message msg)
public boolean isExpired(long time)
time
- the current time.public AgentId getDeadNotAgentId()
public Message getMessage()
public int getStamp()
public Message loadMessage() throws MessageSoftRef.TransactionError
MessageSoftRef.TransactionError
public void delete()
Transaction
.Copyright © 2015 ScalAgent D.T.. All Rights Reserved.