org.apache.activemq.store.kahadb.disk.util
Class VariableMarshaller<T>

java.lang.Object
  extended by org.apache.activemq.store.kahadb.disk.util.VariableMarshaller<T>
Type Parameters:
T -
All Implemented Interfaces:
Marshaller<T>
Direct Known Subclasses:
BTreeNode.Marshaller, ListNode.NodeMarshaller, MessageDatabase.MessageKeysMarshaller, MessageDatabase.StoredDestinationMarshaller, ObjectMarshaller, TempMessageDatabase.MessageKeysMarshaller, TempMessageDatabase.StoredDestinationMarshaller

public abstract class VariableMarshaller<T>
extends Object
implements Marshaller<T>

Convenience base class for Marshaller implementations which do not deepCopy and which use variable size encodings.

Author:
chirino

Constructor Summary
VariableMarshaller()
           
 
Method Summary
 T deepCopy(T source)
           
 int getFixedSize()
           
 boolean isDeepCopySupported()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.activemq.store.kahadb.disk.util.Marshaller
readPayload, writePayload
 

Constructor Detail

VariableMarshaller

public VariableMarshaller()
Method Detail

getFixedSize

public int getFixedSize()
Specified by:
getFixedSize in interface Marshaller<T>
Returns:
-1 if the object do not always marshall to a fixed size, otherwise return that fixed size.

isDeepCopySupported

public boolean isDeepCopySupported()
Specified by:
isDeepCopySupported in interface Marshaller<T>
Returns:
true if the Marshaller.deepCopy(Object) operations is supported.

deepCopy

public T deepCopy(T source)
Specified by:
deepCopy in interface Marshaller<T>
Returns:
a deep copy of the source object.


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.