xmlBlaster 2.1.0 API

org.xmlBlaster.engine.queuemsg
Class MsgQueueHistoryEntry

java.lang.Object
  extended by org.xmlBlaster.util.queuemsg.MsgQueueEntry
      extended by org.xmlBlaster.engine.queuemsg.ReferenceEntry
          extended by org.xmlBlaster.engine.queuemsg.MsgQueueHistoryEntry
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, I_Entry, I_QueueEntry

public final class MsgQueueHistoryEntry
extends ReferenceEntry

Wraps an publish() message into an entry for a sorted queue.

Author:
michele@laghi.eu, xmlBlaster@marcelruff.info
See Also:
Serialized Form

Field Summary
private  boolean forceDestroy
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
private static long serialVersionUID
           
 
Fields inherited from class org.xmlBlaster.engine.queuemsg.ReferenceEntry
glob, keyOid, msgUnitWrapperUniqueId, receiver, STRICT_REFERENCE_COUNTING, STRICT_REFERENCE_COUNTING_COMPATIBLE
 
Fields inherited from class org.xmlBlaster.util.queuemsg.MsgQueueEntry
entryType, persistent, priority, redeliverCounter, refToCloneOrigin, returnObj, storageId, uniqueIdString, uniqueIdTimestamp, wantReturnObj
 
Constructor Summary
MsgQueueHistoryEntry(ServerScope glob, MsgUnitWrapper msgUnitWrapper, StorageId storageId)
          A new message object is fed by method publish().
MsgQueueHistoryEntry(ServerScope glob, PriorityEnum priority, StorageId storageId, Timestamp entryTimestamp, java.lang.String keyOid, long msgUnitWrapperUniqueId, boolean persistent, long sizeInBytes)
          For persistence recovery
 
Method Summary
 java.lang.Object clone()
          Returns a shallow clone
 int getPriority()
          Enforced by I_QueueEntry
 XBRef getRef()
          For the new queues
 long getSizeInBytes()
          Try to find out the approximate memory consumption of this message in RAM.
 long getUniqueId()
          The negative unique creation timestamp (unique in a Global of a virtual machine) Enforced by I_QueueEntry
 java.lang.Long getUniqueIdLong()
          The negative unique creation timestamp (unique in a Global of a virtual machine)
protected  boolean isForceDestroy()
          TODO: Save this state in persistency and recover it similar to MsgQueueUpdateEntry Is needed to know if missing meat is an error
 
Methods inherited from class org.xmlBlaster.engine.queuemsg.ReferenceEntry
added, embeddedObjectToXml, getEmbeddedObject, getGlobal, getInfoWithoutMeat, getKeyOid, getMeat, getMsgKeyData, getMsgQosData, getMsgUnit, getMsgUnitOrNull, getMsgUnitWrapper, getMsgUnitWrapperUniqueId, getRcvTimestamp, getReceiver, getSender, isDestroyed, isExpired, isInternal, removed, setMsgUnitWrapper, setReceiver, setStorageId
 
Methods inherited from class org.xmlBlaster.util.queuemsg.MsgQueueEntry
compare, equals, finalize, getEmbeddedType, getLogId, getMethodName, getPriorityEnum, getRedeliverCounter, getReturnObj, getStorageId, incrRedeliverCounter, isPersistent, isStored, setGlobal, setPersistent, setReturnObj, setStored, setWantReturnObject, toString, toXml, toXml, wantReturnObj
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

ME

private static final java.lang.String ME
See Also:
Constant Field Values

forceDestroy

private final boolean forceDestroy
Constructor Detail

MsgQueueHistoryEntry

public MsgQueueHistoryEntry(ServerScope glob,
                            MsgUnitWrapper msgUnitWrapper,
                            StorageId storageId)
                     throws XmlBlasterException
A new message object is fed by method publish().

Parameters:
msgUnit - The raw data, we keep a weak reference only on this data so it can be garbage collected
Throws:
XmlBlasterException

MsgQueueHistoryEntry

public MsgQueueHistoryEntry(ServerScope glob,
                            PriorityEnum priority,
                            StorageId storageId,
                            Timestamp entryTimestamp,
                            java.lang.String keyOid,
                            long msgUnitWrapperUniqueId,
                            boolean persistent,
                            long sizeInBytes)
                     throws XmlBlasterException
For persistence recovery

Throws:
XmlBlasterException
Method Detail

isForceDestroy

protected boolean isForceDestroy()
TODO: Save this state in persistency and recover it similar to MsgQueueUpdateEntry Is needed to know if missing meat is an error

Overrides:
isForceDestroy in class ReferenceEntry

getPriority

public int getPriority()
Enforced by I_QueueEntry

Specified by:
getPriority in interface I_Entry
Overrides:
getPriority in class MsgQueueEntry
Returns:
Allways the same int as the history queue is strictly chronologic

getUniqueId

public long getUniqueId()
The negative unique creation timestamp (unique in a Global of a virtual machine) Enforced by I_QueueEntry

Specified by:
getUniqueId in interface I_Entry
Overrides:
getUniqueId in class MsgQueueEntry
Parameters:
negative - nano seconds to enforce LIFO behavior (the newest message is at the front)
Returns:
The unique Id of this entry.

getUniqueIdLong

public java.lang.Long getUniqueIdLong()
The negative unique creation timestamp (unique in a Global of a virtual machine)

Overrides:
getUniqueIdLong in class MsgQueueEntry
Parameters:
negative - nano seconds to enforce LIFO behavior (the newest message is at the front)

getSizeInBytes

public long getSizeInBytes()
Description copied from class: MsgQueueEntry
Try to find out the approximate memory consumption of this message in RAM.

NOTE: The derived classes need to add their data amount to this value.

Specified by:
getSizeInBytes in interface I_Entry
Overrides:
getSizeInBytes in class MsgQueueEntry
Returns:
the approximate size in bytes of this object which contributes to a QueueEntry memory consumption

clone

public java.lang.Object clone()
Returns a shallow clone

Overrides:
clone in class ReferenceEntry

getRef

public XBRef getRef()
Description copied from class: MsgQueueEntry
For the new queues

Specified by:
getRef in interface I_Entry
Overrides:
getRef in class MsgQueueEntry

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.