|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.queuemsg.MsgQueueEntry org.xmlBlaster.engine.queuemsg.ReferenceEntry
public class ReferenceEntry
Wraps an publish() message into an entry for a sorted queue.
Field Summary | |
---|---|
protected ServerScope |
glob
|
protected java.lang.String |
keyOid
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
ME
|
protected long |
msgUnitWrapperUniqueId
|
protected SessionName |
receiver
|
private static long |
serialVersionUID
|
static boolean |
STRICT_REFERENCE_COUNTING
|
static boolean |
STRICT_REFERENCE_COUNTING_COMPATIBLE
|
private java.lang.ref.WeakReference |
weakMsgUnitWrapper
Weak reference on the MsgUnit with key/content/qos (raw struct) |
Fields inherited from class org.xmlBlaster.util.queuemsg.MsgQueueEntry |
---|
entryType, persistent, priority, redeliverCounter, refToCloneOrigin, returnObj, storageId, uniqueIdString, uniqueIdTimestamp, wantReturnObj |
Constructor Summary | |
---|---|
ReferenceEntry(java.lang.String ME,
ServerScope glob,
java.lang.String entryType,
MsgUnitWrapper msgUnitWrapper,
StorageId storageId)
A new message object is fed by method publish(). |
|
ReferenceEntry(java.lang.String ME,
ServerScope glob_,
java.lang.String entryType,
MsgUnitWrapper msgUnitWrapper,
Timestamp timestamp,
StorageId storageId,
SessionName receiver)
A new message object is fed by method update(). |
|
ReferenceEntry(java.lang.String ME,
ServerScope glob,
java.lang.String entryType,
PriorityEnum priority,
StorageId storageId,
Timestamp entryTimestamp,
java.lang.String keyOid,
long msgUnitWrapperUniqueId,
boolean persistent,
SessionName receiver,
java.lang.String qos,
java.lang.String key,
byte[] content)
For persistence recovery |
Method Summary | |
---|---|
void |
added(StorageId storageId)
Notification if this entry is added to queue. |
java.lang.Object |
clone()
Returns a shallow clone |
void |
embeddedObjectToXml(java.io.OutputStream out,
java.util.Properties props)
Dump content to xml representation |
java.lang.Object |
getEmbeddedObject()
The embedded object for this implementing class is an Object[2] |
ServerScope |
getGlobal()
|
java.lang.String |
getInfoWithoutMeat()
For logging, don't access meat to avoid recursion. |
java.lang.String |
getKeyOid()
|
XBMeat |
getMeat()
Shall return null since it is a reference |
MsgKeyData |
getMsgKeyData()
|
MsgQosData |
getMsgQosData()
|
MsgUnit |
getMsgUnit()
Gets the message unit but is for read only (dirty read) |
MsgUnit |
getMsgUnitOrNull()
Gets the message unit but is for read only (dirty read) |
MsgUnitWrapper |
getMsgUnitWrapper()
The caller needs to synchronize over msgCache |
long |
getMsgUnitWrapperUniqueId()
|
long |
getRcvTimestamp()
|
SessionName |
getReceiver()
|
SessionName |
getSender()
TODO? make sender persistent? |
private void |
incrementReferenceCounter(int incr,
StorageId storageId)
|
boolean |
isDestroyed()
Flag which marks the entry as destroyed, you should take it from queue and ignore/discard it |
boolean |
isExpired()
Flag which marks the entry as outdated |
protected boolean |
isForceDestroy()
|
boolean |
isInternal()
|
private MsgUnitWrapper |
lookup()
|
void |
removed(StorageId storageId)
Notification if this entry is removed from queue |
void |
setMsgUnitWrapper(MsgUnitWrapper msgUnitWrapper)
|
void |
setReceiver(SessionName receiver)
|
void |
setStorageId(StorageId storageId)
Used during conversion from xb_entries to xbstore (OneToThree.java) |
Methods inherited from class org.xmlBlaster.util.queuemsg.MsgQueueEntry |
---|
compare, equals, finalize, getEmbeddedType, getLogId, getMethodName, getPriority, getPriorityEnum, getRedeliverCounter, getRef, getReturnObj, getSizeInBytes, getStorageId, getUniqueId, getUniqueIdLong, 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 |
---|
private static java.util.logging.Logger log
private static final long serialVersionUID
private final java.lang.String ME
protected final transient ServerScope glob
private transient java.lang.ref.WeakReference weakMsgUnitWrapper
protected java.lang.String keyOid
protected long msgUnitWrapperUniqueId
protected SessionName receiver
public static final boolean STRICT_REFERENCE_COUNTING
public static final boolean STRICT_REFERENCE_COUNTING_COMPATIBLE
Constructor Detail |
---|
public ReferenceEntry(java.lang.String ME, ServerScope glob_, java.lang.String entryType, MsgUnitWrapper msgUnitWrapper, Timestamp timestamp, StorageId storageId, SessionName receiver) throws XmlBlasterException
msgUnit
- The raw data, we keep a weak reference only on this data so it can be garbage collected
XmlBlasterException
public ReferenceEntry(java.lang.String ME, ServerScope glob, java.lang.String entryType, MsgUnitWrapper msgUnitWrapper, StorageId storageId) throws XmlBlasterException
msgUnit
- The raw data, we keep a weak reference only on this data so it can be garbage collected
XmlBlasterException
public ReferenceEntry(java.lang.String ME, ServerScope glob, java.lang.String entryType, PriorityEnum priority, StorageId storageId, Timestamp entryTimestamp, java.lang.String keyOid, long msgUnitWrapperUniqueId, boolean persistent, SessionName receiver, java.lang.String qos, java.lang.String key, byte[] content) throws XmlBlasterException
msgUnitWrapperUniqueId
- The unique timestamp of the MsgUnitWrapper instance (need to lookup MsgUnitWrapper)
XmlBlasterException
Method Detail |
---|
protected boolean isForceDestroy()
public final ServerScope getGlobal()
public void setStorageId(StorageId storageId)
storageId
- public MsgUnitWrapper getMsgUnitWrapper()
public java.lang.String getInfoWithoutMeat()
private void incrementReferenceCounter(int incr, StorageId storageId)
public void added(StorageId storageId)
added
in interface I_Entry
added
in class MsgQueueEntry
I_Entry.added(StorageId)
public void removed(StorageId storageId)
removed
in interface I_Entry
removed
in class MsgQueueEntry
storageId
- The storage idI_Entry.removed(StorageId)
public boolean isExpired()
MsgQueueEntry
isExpired
in class MsgQueueEntry
public boolean isDestroyed()
MsgQueueEntry
isDestroyed
in class MsgQueueEntry
public MsgQosData getMsgQosData() throws XmlBlasterException
XmlBlasterException
public MsgUnit getMsgUnitOrNull()
XmlBlasterException
public MsgUnit getMsgUnit() throws XmlBlasterException
getMsgUnit
in class MsgQueueEntry
XmlBlasterException
- if not found (e.g. forceDestroy and expired)public void setMsgUnitWrapper(MsgUnitWrapper msgUnitWrapper) throws XmlBlasterException
XmlBlasterException
public long getMsgUnitWrapperUniqueId()
public java.lang.String getKeyOid()
getKeyOid
in class MsgQueueEntry
public long getRcvTimestamp()
public final MsgKeyData getMsgKeyData() throws XmlBlasterException
XmlBlasterException
public boolean isInternal()
isInternal
in class MsgQueueEntry
public final SessionName getSender()
getSender
in class MsgQueueEntry
public final SessionName getReceiver()
getReceiver
in class MsgQueueEntry
public final void setReceiver(SessionName receiver)
private MsgUnitWrapper lookup()
public java.lang.Object getEmbeddedObject()
public final void embeddedObjectToXml(java.io.OutputStream out, java.util.Properties props) throws java.io.IOException
I_Entry
out
- The stream to dump toprops
- Control porperties
java.io.IOException
public java.lang.Object clone()
clone
in class MsgQueueEntry
public XBMeat getMeat()
getMeat
in interface I_Entry
getMeat
in class MsgQueueEntry
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |