com.neeve.sma
Class MessageViewImpl

java.lang.Object
  extended by com.neeve.util.UtlListElement
      extended by com.neeve.sma.MessageViewImpl
All Implemented Interfaces:
MessageView, UtlReferenceTracker.HasReferenceTracker
Direct Known Subclasses:
RawMessageViewImpl, com.neeve.rog.impl.RogNode

public abstract class MessageViewImpl
extends UtlListElement
implements MessageView

Base class implementation of a message view.


Field Summary
 
Fields inherited from class com.neeve.util.UtlListElement
count, head, next, prev
 
Fields inherited from interface com.neeve.sma.MessageView
ENCODING_TYPE_CUSTOM, ENCODING_TYPE_JSON, ENCODING_TYPE_PROTOBUF, ENCODING_TYPE_XBUF, NEXT_FREE_ENCODING_TYPE
 
Method Summary
 void acquire()
          Implementation of MessageView.acquire()
 int dispose()
          Default implementation of MessageView.dispose() This is the default implementation of the dispose method.
 Object getMessage()
          Implementation of MessageView.getMessage()
 int getMessageEncodingType()
          Implementation of MessageView.getMessageEncodingType()
 int getOwnershipCount()
          Implementation of MessageView.getOwnershipCount()
 Object getTag(int id)
          Implementation of MessageView.getTag(int)
 short getType()
          Implementation of MessageView.getType()
 short getVfid()
          Implementation of MessageView.getVfid()
 UtlReferenceTracker referenceTracker()
          Get an object's reference tracker.
 com.neeve.io.IOBuffer serializeToIOBuffer(boolean useNative)
          Serializes the MessageView to an IOBuffer.
 void setTag(int id, Object tag)
          Implementation of MessageView.setTag(int, java.lang.Object)
 String toString()
          Return a string representation of this object
 
Methods inherited from class com.neeve.util.UtlListElement
count, insertAfter, insertBefore, isLinked, next, previous, unlink, wipe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.neeve.sma.MessageView
deserializeFromByteArray, deserializeFromByteBuffer, deserializeFromJson, deserializeFromPacket, getAppSendBeginTs, getAppSendDoneTs, getCreateTs, getEnqueueTs, getEnqueueTsMicros, getMessageBus, getMessageBusAsRaw, getMessageChannel, getMessageChannelAsRaw, getMessageFlow, getMessageKey, getMessageKeyAsRaw, getMessageSender, getMessageSequenceNumber, getOriginTs, getOutTs, getOutTsMicros, getPostDeserializeTs, getPostProcessingTs, getPostProcessingTsMicros, getPostSerializeTs, getPostWireSendTs, getPostWireTs, getPreDeserializeTs, getPreProcessingTs, getPreProcessingTsMicros, getPreSerializeTs, getPreWireTs, getReceiveTs, getSendStartTs, getSendTs, isPossibleDuplicate, serializeToByteArray, serializeToByteBuffer, serializeToJson, serializeToPacket, setAppSendBeginTs, setAppSendDoneTs, setCreateTs, setEnqueueTsMicros, setMessageBus, setMessageBusAsRaw, setMessageChannel, setMessageChannelAsRaw, setMessageFlow, setMessageKey, setMessageKeyAsRaw, setMessageSender, setMessageSequenceNumber, setOriginTs, setOutTs, setOutTsMicros, setPossibleDuplicate, setPostDeserializeTs, setPostProcessingTs, setPostProcessingTsMicros, setPostSerializeTs, setPostWireSendTs, setPostWireTs, setPreDeserializeTs, setPreProcessingTs, setPreProcessingTsMicros, setPreSerializeTs, setPreWireTs, setReceiveTs, setSendStartTs, setSendTs, sync
 

Method Detail

serializeToIOBuffer

public com.neeve.io.IOBuffer serializeToIOBuffer(boolean useNative)
Description copied from interface: MessageView
Serializes the MessageView to an IOBuffer.

Ownership of the returned IOBuffer is given to the caller which should dispose of it when done.

The buffer backing the IOBuffer should be flipped (ready for read) upon return.

Specified by:
serializeToIOBuffer in interface MessageView
Parameters:
useNative - Whether the returned buffer should be native.
Returns:
The MessageView serialized to an IOBuffer.

setTag

public final void setTag(int id,
                         Object tag)
Implementation of MessageView.setTag(int, java.lang.Object)

Specified by:
setTag in interface MessageView

getTag

public final Object getTag(int id)
Implementation of MessageView.getTag(int)

Specified by:
getTag in interface MessageView
Returns:
Returns the requested tag

getVfid

public final short getVfid()
Implementation of MessageView.getVfid()

Specified by:
getVfid in interface MessageView

getType

public final short getType()
Implementation of MessageView.getType()

Specified by:
getType in interface MessageView

getMessageEncodingType

public final int getMessageEncodingType()
Implementation of MessageView.getMessageEncodingType()

Specified by:
getMessageEncodingType in interface MessageView

getMessage

public final Object getMessage()
Implementation of MessageView.getMessage()

Specified by:
getMessage in interface MessageView

acquire

public final void acquire()
Implementation of MessageView.acquire()

Specified by:
acquire in interface MessageView

getOwnershipCount

public final int getOwnershipCount()
Implementation of MessageView.getOwnershipCount()

Specified by:
getOwnershipCount in interface MessageView

dispose

public int dispose()
Default implementation of MessageView.dispose()

This is the default implementation of the dispose method. The implementation just decrements the ownership count. Implementations that implement view object pooling or other such functionality should override this method but invoke this method to decrement the object reference count.

Specified by:
dispose in interface MessageView

referenceTracker

public final UtlReferenceTracker referenceTracker()
Description copied from interface: UtlReferenceTracker.HasReferenceTracker
Get an object's reference tracker.

This method returns an object's reference tracker intended for use for debugging purposes. An object should instantiate a tracker only if UtlReferenceTracker.ENABLED is true or UtlReferenceTracker.enabled(Class) is true for the object type. The flag can be enabled via the properties nv.reftracking.enabled or by the nv.reftracking.types=fullclassname1[|fullclassnameN].

Specified by:
referenceTracker in interface UtlReferenceTracker.HasReferenceTracker

toString

public String toString()
Return a string representation of this object

Overrides:
toString in class Object


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.