org.infinispan.marshall.jboss
Class GenericJBossMarshaller

java.lang.Object
  extended by org.infinispan.marshall.AbstractMarshaller
      extended by org.infinispan.marshall.jboss.GenericJBossMarshaller
All Implemented Interfaces:
Marshaller
Direct Known Subclasses:
JBossMarshaller

public class GenericJBossMarshaller
extends AbstractMarshaller

A marshaller that makes use of JBoss Marshalling to serialize and deserialize objects.

In addition to making use of JBoss Marshalling, this Marshaller

Version:
4.1
Author:
Manik Surtani
See Also:
http://www.jboss.org/jbossmarshalling

Nested Class Summary
protected static class GenericJBossMarshaller.DebuggingExceptionListener
           
 
Field Summary
protected  org.jboss.marshalling.MarshallingConfiguration configuration
           
protected static String DEFAULT_MARSHALLER_FACTORY
           
protected  ClassLoader defaultCl
           
protected  org.jboss.marshalling.MarshallerFactory factory
           
protected static Log log
           
 
Fields inherited from class org.infinispan.marshall.AbstractMarshaller
DEFAULT_BUF_SIZE
 
Constructor Summary
GenericJBossMarshaller()
           
 
Method Summary
 void finishObjectInput(ObjectInput oi)
           
 void finishObjectOutput(ObjectOutput oo)
           
 boolean isMarshallable(Object o)
          A method that checks whether the given object is marshallable as per the rules of this marshaller.
 Object objectFromByteBuffer(byte[] buf, int offset, int length)
          Unmarshalls an object from a specific portion of a byte array.
 Object objectFromObjectStream(ObjectInput in)
           
protected  ByteBuffer objectToBuffer(Object o, int estimatedSize)
          This is a convenience method for converting an object into a ByteBuffer which takes an estimated size as parameter.
 void objectToObjectStream(Object obj, ObjectOutput out)
           
 ObjectInput startObjectInput(InputStream is, boolean isReentrant)
           
 ObjectOutput startObjectOutput(OutputStream os, boolean isReentrant)
           
 
Methods inherited from class org.infinispan.marshall.AbstractMarshaller
objectFromByteBuffer, objectToBuffer, objectToByteBuffer, objectToByteBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final Log log

DEFAULT_MARSHALLER_FACTORY

protected static final String DEFAULT_MARSHALLER_FACTORY
See Also:
Constant Field Values

defaultCl

protected ClassLoader defaultCl

configuration

protected org.jboss.marshalling.MarshallingConfiguration configuration

factory

protected org.jboss.marshalling.MarshallerFactory factory
Constructor Detail

GenericJBossMarshaller

public GenericJBossMarshaller()
Method Detail

objectToObjectStream

public void objectToObjectStream(Object obj,
                                 ObjectOutput out)
                          throws IOException
Throws:
IOException

objectToBuffer

protected ByteBuffer objectToBuffer(Object o,
                                    int estimatedSize)
                             throws IOException
Description copied from class: AbstractMarshaller
This is a convenience method for converting an object into a ByteBuffer which takes an estimated size as parameter. A ByteBuffer allows direct access to the byte array with minimal array copying

Specified by:
objectToBuffer in class AbstractMarshaller
Parameters:
o - object to marshall
estimatedSize - an estimate of how large the resulting byte array may be
Returns:
a ByteBuffer
Throws:
IOException

startObjectOutput

public ObjectOutput startObjectOutput(OutputStream os,
                                      boolean isReentrant)
                               throws IOException
Throws:
IOException

finishObjectOutput

public void finishObjectOutput(ObjectOutput oo)

objectFromByteBuffer

public Object objectFromByteBuffer(byte[] buf,
                                   int offset,
                                   int length)
                            throws IOException,
                                   ClassNotFoundException
Description copied from interface: Marshaller
Unmarshalls an object from a specific portion of a byte array.

Parameters:
buf - byte array containing the binary representation of an object. Must not be null.
offset - point in buffer to start reading
length - number of bytes to consider
Returns:
an object
Throws:
IOException
ClassNotFoundException

startObjectInput

public ObjectInput startObjectInput(InputStream is,
                                    boolean isReentrant)
                             throws IOException
Throws:
IOException

objectFromObjectStream

public Object objectFromObjectStream(ObjectInput in)
                              throws IOException,
                                     ClassNotFoundException
Throws:
IOException
ClassNotFoundException

finishObjectInput

public void finishObjectInput(ObjectInput oi)

isMarshallable

public boolean isMarshallable(Object o)
Description copied from interface: Marshaller
A method that checks whether the given object is marshallable as per the rules of this marshaller.

Parameters:
o - object to verify whether it's marshallable or not
Returns:
true if the object is marshallable, otherwise false

Google Analytics

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