fr.dyade.aaa.agent
Class MessageSoftRef

java.lang.Object
  extended by fr.dyade.aaa.agent.MessageSoftRef

public final class MessageSoftRef
extends java.lang.Object


Method Summary
 void delete()
          Deletes the message in persistent storage.
 fr.dyade.aaa.agent.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.
 fr.dyade.aaa.agent.Message loadMessage()
          Loads from disk this reference message's referent if the message has been swapped out.
 java.lang.String toString()
          Returns a string representation of this MessageSoftRef object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getMessage

public fr.dyade.aaa.agent.Message getMessage()
Returns this reference message's referent. If the message has been swap out it returns null.

Returns:
The message to which this reference refers.

getStamp

public int getStamp()
Returns the stamp of the message backed by this MessageSoftRef, without reloading it if it has been swapped.

Returns:
the stamp of the message.

loadMessage

public fr.dyade.aaa.agent.Message loadMessage()
                                       throws fr.dyade.aaa.agent.MessageSoftRef.TransactionError
Loads from disk this reference message's referent if the message has been swapped out. It should be called only after a getMessage returning null. The SoftReference is renewed to avoid reloading the message from disk each time this method is called.

Returns:
The message to which this reference refers.
Throws:
fr.dyade.aaa.agent.MessageSoftRef.TransactionError

delete

public void delete()
Deletes the message in persistent storage. This method must be called during a Transaction.


toString

public java.lang.String toString()
Returns a string representation of this MessageSoftRef object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.


Copyright © 2011 ScalAgent D.T.. All Rights Reserved.