org.kth.dks.dks_marshal
Class DKSMessage

java.lang.Object
  extended by org.kth.dks.dks_marshal.DKSMessage
Direct Known Subclasses:
AckByeMsg, AckHelloMsg, AckJoinInitMsg, AdaptLeaveMsg, AdaptMsg, AddItemMsg, AddToBindingMsg, BadPointerMsg, BecomeNormalMsg, BootstrapMsg, BroadCastMsg, ByeMsg, ChangeItemMsg, CorrectionOnJoinMsg, CorrectionOnLeaveMsg, CreateMCastGroupMsg, CreateMCastGroupReplyMsg, DHTRestoreItemsMsg, DHTRestoreReplicasMsg, DHTResultMsg, DHTStateTransferMsg, FailureMsg, GetItemsMsg, HeartbeatMsg, HelloMsg, InsertNodeMsg, JoinInitMsg, JoinMCastGroupMsg, KeepAliveMsg, LeaveAcceptMsg, LeaveRejectMsg, LeaveRequestMsg, LiveNodesMsg, LookupBindingMsg, LookupFailureMsg, LookupMsg, LookupRequestMsg, LookupResponseMsg, LookupResultMsg, MCastGroupInfoMsg, MCastGroupInfoReplyMsg, NodeLeftMsg, PingMsg, PongMsg, RemoveFromBindingMsg, RemoveItemMsg, ReplicateMsg, ReplicationFinishedMsg, RestartJoinMsg, RestartOperationMsg, RetreiveItemsMsg, RetrieveItemsMsg, StrechMeasurementMsg

public abstract class DKSMessage
extends java.lang.Object


Field Summary
protected  XMLElement ele
           
protected  int eleCnt
           
protected  MarshalInterface marshaler
           
protected static java.util.Map messageMap
           
protected static java.util.Map messageMapUnsync
           
protected  int pCount
           
protected  XMLMessage xmsg
           
 
Constructor Summary
DKSMessage()
           
 
Method Summary
static void addMessageType(java.lang.String msgInternalXMLTAG, java.lang.String nameOfClass)
          Adds a TAG string, e.g.
static void addMessageTypePrefixed(java.lang.String msgInternalXMLTAG, java.lang.String nameOfClass)
          Adds a TAG string, e.g.
 byte[] flatten()
           
abstract  java.lang.String getName()
           
 DKSRef getRecvRef()
           
 DKSRef getSendRef()
           
abstract  void marshal()
           
 void setRecvRef(DKSRef r)
           
 void setSendRef(DKSRef s)
           
abstract  void unmarshal()
           
static DKSMessage unmarshal(byte[] raw)
           
static DKSMessage unmarshal(byte transType, byte[] raw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messageMapUnsync

protected static java.util.Map messageMapUnsync

messageMap

protected static java.util.Map messageMap

marshaler

protected MarshalInterface marshaler

pCount

protected int pCount

xmsg

protected XMLMessage xmsg

ele

protected XMLElement ele

eleCnt

protected int eleCnt
Constructor Detail

DKSMessage

public DKSMessage()
Method Detail

getSendRef

public final DKSRef getSendRef()

getRecvRef

public final DKSRef getRecvRef()

setSendRef

public final void setSendRef(DKSRef s)

setRecvRef

public final void setRecvRef(DKSRef r)

unmarshal

public static DKSMessage unmarshal(byte[] raw)

unmarshal

public static DKSMessage unmarshal(byte transType,
                                   byte[] raw)

addMessageType

public static void addMessageType(java.lang.String msgInternalXMLTAG,
                                  java.lang.String nameOfClass)
Adds a TAG string, e.g. "LOOKUPMSG", into a Map which maps it to a DKSMessage (narrowed) class, e.g. "dks_marshal.LookupMsg" Used to initially by the application and DKSNode to install message types and their corresponding class

Parameters:
msgInternalXMLTAG - String Tag describing the message
nameOfClass - String Fully qualified (absolute) name of the class (example: org.kth.dks.MyClass)

addMessageTypePrefixed

public static void addMessageTypePrefixed(java.lang.String msgInternalXMLTAG,
                                          java.lang.String nameOfClass)
Adds a TAG string, e.g. "LOOKUPMSG", into a Map which maps it to a DKSMessage (narrowed) class, e.g. "dks_marshal.LookupMsg" Used to initially by the application and DKSNode to install message types and their corresponding class

Parameters:
msgInternalXMLTAG - String Tag describing the message
nameOfClass - String name of the class relative to the package org.kth.dks (this.BASEPACKAGE)

getName

public abstract java.lang.String getName()

marshal

public abstract void marshal()
                      throws java.io.IOException
Throws:
java.io.IOException

unmarshal

public abstract void unmarshal()
                        throws java.io.IOException
Throws:
java.io.IOException

flatten

public final byte[] flatten()


Copyright © 2010. All Rights Reserved.