Class AbstractReplicatedMap.MapMessage
java.lang.Object
org.apache.catalina.tribes.tipis.AbstractReplicatedMap.MapMessage
- All Implemented Interfaces:
Serializable, Cloneable
- Enclosing class:
AbstractReplicatedMap<K,V>
public static class AbstractReplicatedMap.MapMessage
extends Object
implements Serializable, Cloneable
Represents a message sent between replicated map instances.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMessage type: access.static final intMessage type: backup.static final intMessage type: copy.static final intMessage type: init.static final intMessage type: notify map member.static final intMessage type: ping.static final intMessage type: proxy.static final intMessage type: remove.static final intMessage type: retrieve backup.static final intMessage type: start.static final intMessage type: state.static final intMessage type: state copy.static final intMessage type: stop. -
Constructor Summary
ConstructorsConstructorDescriptionMapMessage(byte[] mapId, int msgtype, boolean diff, Serializable key, Serializable value, byte[] diffvalue, Member primary, Member[] nodes) Creates a new map message with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a shallow copy of this map message.voiddeserialize(ClassLoader[] cls) Deserializes the key and value using the given class loaders.Member[]Gets the backup nodes.byte[]Gets the diff value data.getKey()Gets the key for this message.byte[]Gets the serialized key data.byte[]getMapId()Gets the map identifier.intGets the message type.Gets the primary member.Gets a description of the message type.getValue()Gets the value for this message.byte[]Gets the serialized value data.booleanisDiff()Checks if this is a diff message.key(ClassLoader[] cls) Deserializes the key using the given class loaders.voidsetKey(Serializable key) Sets the key for this message.voidsetValue(Serializable value) Sets the value for this message.toString()Returns a string representation of this map message.value(ClassLoader[] cls) Deserializes the value using the given class loaders.
-
Field Details
-
MSG_BACKUP
public static final int MSG_BACKUPMessage type: backup.- See Also:
-
MSG_RETRIEVE_BACKUP
public static final int MSG_RETRIEVE_BACKUPMessage type: retrieve backup.- See Also:
-
MSG_PROXY
public static final int MSG_PROXYMessage type: proxy.- See Also:
-
MSG_REMOVE
public static final int MSG_REMOVEMessage type: remove.- See Also:
-
MSG_STATE
public static final int MSG_STATEMessage type: state.- See Also:
-
MSG_START
public static final int MSG_STARTMessage type: start.- See Also:
-
MSG_STOP
public static final int MSG_STOPMessage type: stop.- See Also:
-
MSG_INIT
public static final int MSG_INITMessage type: init.- See Also:
-
MSG_COPY
public static final int MSG_COPYMessage type: copy.- See Also:
-
MSG_STATE_COPY
public static final int MSG_STATE_COPYMessage type: state copy.- See Also:
-
MSG_ACCESS
public static final int MSG_ACCESSMessage type: access.- See Also:
-
MSG_NOTIFY_MAPMEMBER
public static final int MSG_NOTIFY_MAPMEMBERMessage type: notify map member.- See Also:
-
MSG_PING
public static final int MSG_PINGMessage type: ping.- See Also:
-
-
Constructor Details
-
MapMessage
public MapMessage(byte[] mapId, int msgtype, boolean diff, Serializable key, Serializable value, byte[] diffvalue, Member primary, Member[] nodes) Creates a new map message with the specified parameters.- Parameters:
mapId- The map identifiermsgtype- The message typediff- Whether this is a diff messagekey- The keyvalue- The valuediffvalue- The serialized diff valueprimary- The primary membernodes- The backup nodes
-
-
Method Details
-
toString
-
getTypeDesc
Gets a description of the message type.- Returns:
- A string description of the message type
-
deserialize
Deserializes the key and value using the given class loaders.- Parameters:
cls- The class loaders to use for deserialization- Throws:
IOException- If deserialization failsClassNotFoundException- If a class is not found
-
getMsgType
public int getMsgType()Gets the message type.- Returns:
- the message type
-
isDiff
public boolean isDiff()Checks if this is a diff message.- Returns:
trueif this is a diff message
-
getKey
-
key
Deserializes the key using the given class loaders.- Parameters:
cls- The class loaders to use for deserialization- Returns:
- The deserialized key
- Throws:
IOException- If deserialization failsClassNotFoundException- If the key class is not found
-
getKeyData
public byte[] getKeyData()Gets the serialized key data.- Returns:
- The serialized key data
-
getValue
-
value
Deserializes the value using the given class loaders.- Parameters:
cls- The class loaders to use for deserialization- Returns:
- The deserialized value
- Throws:
IOException- If deserialization failsClassNotFoundException- If the value class is not found
-
getValueData
public byte[] getValueData()Gets the serialized value data.- Returns:
- The serialized value data
-
getDiffValue
public byte[] getDiffValue()Gets the diff value data.- Returns:
- The diff value data
-
getBackupNodes
-
getPrimary
-
getMapId
public byte[] getMapId()Gets the map identifier.- Returns:
- the map identifier
-
setValue
Sets the value for this message.- Parameters:
value- The value
-
setKey
-
clone
Creates a shallow copy of this map message.
-