xmlBlaster 2.2.0 API

org.xmlBlaster.engine.queuemsg
Class MsgQueueUpdateEntry

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

public final class MsgQueueUpdateEntry
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  java.lang.String flag
          Contains state|updateOneway|forceDestroy, for example "OK|oneway" or "OK"
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
private static long serialVersionUID
           
private  java.lang.String state
           
private  java.lang.String subscriptionId
           
private  boolean updateOneway
           
 
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
MsgQueueUpdateEntry(MsgQueueUpdateEntry entry, StorageId storageId)
          Copy constructor, used to get a shallow clone, we still reference the original MsgUnitWrapper.
MsgQueueUpdateEntry(ServerScope glob, MsgUnitWrapper msgUnitWrapper, StorageId storageId, SessionName receiver, java.lang.String subscriptionId, boolean wantUpdateOneway, boolean wantNewestOnly)
          A new message object is fed by method publish().
MsgQueueUpdateEntry(ServerScope glob, MsgUnitWrapper msgUnitWrapper, Timestamp timestamp, StorageId storageId, SessionName receiver, java.lang.String subscriptionId, boolean wantUpdateOneway, boolean wantNewestOnly)
          convenience constructor to allow passing an already given uniqueId (the timestamp)
MsgQueueUpdateEntry(ServerScope glob, PriorityEnum priority, StorageId storageId, Timestamp updateEntryTimestamp, java.lang.String keyOid, long msgUnitWrapperUniqueId, boolean persistent, long sizeInBytes, SessionName receiver, java.lang.String subscriptionId, java.lang.String flag, int redeliverCount, java.lang.String qos, java.lang.String key, byte[] content)
          For persistence recovery The params qos, key, content can be null (the unparsed raw message)
 
Method Summary
 java.lang.Object clone()
          Returns a shallow clone
 java.lang.Object getEmbeddedObject()
          The embedded object for this implementing class is an Object[6] for transient messages and Object[9] for persistent messages.
 java.lang.String getFlag()
          Holds state and updateOneway information
 XBRef getRef()
          For the new queues
 long getSizeInBytes()
          Try to find out the approximate memory consumption of this message in RAM.
 java.lang.String getState()
           
 java.lang.String getSubscriptionId()
           
protected  boolean isForceDestroy()
           
 boolean newestOnly()
           
 java.lang.String toXml()
          Dump state of this object into XML.
 java.lang.String toXml(java.lang.String extraOffset)
          Dump state of this object into XML.
 boolean updateOneway()
          true if the subscriber has passed <updateOneway> in his SubscribeQos
 
Methods inherited from class org.xmlBlaster.engine.queuemsg.ReferenceEntry
added, embeddedObjectToXml, 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, getPriority, getPriorityEnum, getRedeliverCounter, getReturnObj, getStorageId, getUniqueId, getUniqueIdLong, incrRedeliverCounter, isPersistent, isStored, setGlobal, setPersistent, setReturnObj, setStored, setWantReturnObject, toString, 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

subscriptionId

private final java.lang.String subscriptionId

flag

private final java.lang.String flag
Contains state|updateOneway|forceDestroy, for example "OK|oneway" or "OK"


state

private final java.lang.String state

updateOneway

private final boolean updateOneway
Constructor Detail

MsgQueueUpdateEntry

public MsgQueueUpdateEntry(ServerScope glob,
                           MsgUnitWrapper msgUnitWrapper,
                           StorageId storageId,
                           SessionName receiver,
                           java.lang.String subscriptionId,
                           boolean wantUpdateOneway,
                           boolean wantNewestOnly)
                    throws XmlBlasterException
A new message object is fed by method publish().

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

MsgQueueUpdateEntry

public MsgQueueUpdateEntry(ServerScope glob,
                           MsgUnitWrapper msgUnitWrapper,
                           Timestamp timestamp,
                           StorageId storageId,
                           SessionName receiver,
                           java.lang.String subscriptionId,
                           boolean wantUpdateOneway,
                           boolean wantNewestOnly)
                    throws XmlBlasterException
convenience constructor to allow passing an already given uniqueId (the timestamp)

Parameters:
glob -
msgUnitWrapper -
timestamp -
storageId -
receiver -
subscriptionId -
wantUpdateOneway -
wantNewestOnly - TODO
Throws:
XmlBlasterException

MsgQueueUpdateEntry

public MsgQueueUpdateEntry(ServerScope glob,
                           PriorityEnum priority,
                           StorageId storageId,
                           Timestamp updateEntryTimestamp,
                           java.lang.String keyOid,
                           long msgUnitWrapperUniqueId,
                           boolean persistent,
                           long sizeInBytes,
                           SessionName receiver,
                           java.lang.String subscriptionId,
                           java.lang.String flag,
                           int redeliverCount,
                           java.lang.String qos,
                           java.lang.String key,
                           byte[] content)
                    throws XmlBlasterException
For persistence recovery The params qos, key, content can be null (the unparsed raw message)

Throws:
XmlBlasterException

MsgQueueUpdateEntry

public MsgQueueUpdateEntry(MsgQueueUpdateEntry entry,
                           StorageId storageId)
                    throws XmlBlasterException
Copy constructor, used to get a shallow clone, we still reference the original MsgUnitWrapper.

Throws:
XmlBlasterException
Method Detail

isForceDestroy

protected boolean isForceDestroy()
Overrides:
isForceDestroy in class ReferenceEntry

getSubscriptionId

public java.lang.String getSubscriptionId()

getState

public java.lang.String getState()

newestOnly

public boolean newestOnly()

getFlag

public java.lang.String getFlag()
Holds state and updateOneway information

Returns:
for example "OK|oneway|newestOnly"

updateOneway

public boolean updateOneway()
true if the subscriber has passed <updateOneway> in his SubscribeQos


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

getEmbeddedObject

public java.lang.Object getEmbeddedObject()
The embedded object for this implementing class is an Object[6] for transient messages and Object[9] for persistent messages.

We need to store the 'meat' for persistent messages as well After a recovery the 'meat's reference counter is not valid so we need to have all informations duplicated in each callback queue.

Specified by:
getEmbeddedObject in interface I_Entry
Overrides:
getEmbeddedObject in class ReferenceEntry

clone

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

Overrides:
clone in class ReferenceEntry

toXml

public final java.lang.String toXml()
Dump state of this object into XML.

Overrides:
toXml in class MsgQueueEntry
Returns:
XML state of MsgQueueEntry

toXml

public final java.lang.String toXml(java.lang.String extraOffset)
Dump state of this object into XML.

Overrides:
toXml in class MsgQueueEntry
Parameters:
extraOffset - indenting of tags
Returns:
XML state of MsgQueueEntry

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.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.