org.jboss.cache.marshall
Class AbstractMarshaller

java.lang.Object
  extended by org.jboss.cache.marshall.AbstractMarshaller
All Implemented Interfaces:
Marshaller, org.jgroups.blocks.RpcDispatcher.Marshaller, org.jgroups.blocks.RpcDispatcher.Marshaller2
Direct Known Subclasses:
CacheMarshaller200, VersionAwareMarshaller

public abstract class AbstractMarshaller
extends Object
implements Marshaller

Abstract AbstractMarshaller for JBoss Cache.

Author:
Manik Surtani (manik@jboss.org)

Field Summary
protected  Configuration configuration
           
protected  ClassLoader defaultClassLoader
           
protected  boolean defaultInactive
           
protected  org.apache.commons.logging.Log log
           
protected  RegionManager regionManager
           
protected  boolean trace
           
protected  boolean useRefs
           
protected  boolean useRegionBasedMarshalling
           
 
Constructor Summary
AbstractMarshaller()
           
 
Method Summary
protected  Fqn extractFqn(ReplicableCommand cmd)
           
protected  void init()
           
protected  void initLogger()
           
 Object objectFromByteBuffer(byte[] bytes)
           
 Object objectFromByteBuffer(byte[] bytes, int offset, int len)
           
 Object objectFromStream(InputStream in)
          Unmarshalls an object from an InputStream
 ByteBuffer objectToBuffer(Object o)
           
 byte[] objectToByteBuffer(Object obj)
           
 RegionalizedMethodCall regionalizedMethodCallFromByteBuffer(byte[] buffer)
          Returns a RegionalizedMethodCall from a byte buffer.
 RegionalizedMethodCall regionalizedMethodCallFromObjectStream(ObjectInputStream in)
          Returns a RegionalizedMethodCall from an object input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.cache.marshall.Marshaller
objectFromObjectStream, objectToObjectStream, objectToObjectStream
 

Field Detail

useRegionBasedMarshalling

protected boolean useRegionBasedMarshalling

regionManager

protected RegionManager regionManager

defaultInactive

protected boolean defaultInactive

log

protected org.apache.commons.logging.Log log

trace

protected boolean trace

configuration

protected Configuration configuration

defaultClassLoader

protected ClassLoader defaultClassLoader

useRefs

protected boolean useRefs
Constructor Detail

AbstractMarshaller

public AbstractMarshaller()
Method Detail

init

protected void init()

initLogger

protected void initLogger()

objectFromStream

public Object objectFromStream(InputStream in)
                        throws Exception
Description copied from interface: Marshaller
Unmarshalls an object from an InputStream

Specified by:
objectFromStream in interface Marshaller
Parameters:
in - stream to unmarshall from
Returns:
Object from stream passed in.
Throws:
Exception

regionalizedMethodCallFromByteBuffer

public RegionalizedMethodCall regionalizedMethodCallFromByteBuffer(byte[] buffer)
                                                            throws Exception
Description copied from interface: Marshaller
Returns a RegionalizedMethodCall from a byte buffer. Only use if you know that the byte buffer contains a MethodCall and that you are using region-based marshalling, otherwise use RpcDispatcher.Marshaller.objectFromByteBuffer(byte[])

Specified by:
regionalizedMethodCallFromByteBuffer in interface Marshaller
Parameters:
buffer - byte buffer
Returns:
a RegionalizedMethodCall
Throws:
Exception - if there are issues

regionalizedMethodCallFromObjectStream

public RegionalizedMethodCall regionalizedMethodCallFromObjectStream(ObjectInputStream in)
                                                              throws Exception
Description copied from interface: Marshaller
Returns a RegionalizedMethodCall from an object input stream. Only use if you know that the byte buffer contains a MethodCall and that you are using region-based marshalling, otherwise use Marshaller.objectFromObjectStream(java.io.ObjectInputStream)

Specified by:
regionalizedMethodCallFromObjectStream in interface Marshaller
Parameters:
in - object inout stream
Returns:
a RegionalizedMethodCall
Throws:
Exception - if there are issues

objectToBuffer

public ByteBuffer objectToBuffer(Object o)
                          throws Exception
Specified by:
objectToBuffer in interface org.jgroups.blocks.RpcDispatcher.Marshaller2
Throws:
Exception

objectFromByteBuffer

public Object objectFromByteBuffer(byte[] bytes)
                            throws Exception
Specified by:
objectFromByteBuffer in interface org.jgroups.blocks.RpcDispatcher.Marshaller
Throws:
Exception

objectFromByteBuffer

public Object objectFromByteBuffer(byte[] bytes,
                                   int offset,
                                   int len)
                            throws Exception
Specified by:
objectFromByteBuffer in interface org.jgroups.blocks.RpcDispatcher.Marshaller2
Throws:
Exception

objectToByteBuffer

public byte[] objectToByteBuffer(Object obj)
                          throws Exception
Specified by:
objectToByteBuffer in interface org.jgroups.blocks.RpcDispatcher.Marshaller
Throws:
Exception

extractFqn

protected Fqn extractFqn(ReplicableCommand cmd)


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.