org.infinispan.marshall.jboss
Class JBossMarshaller

java.lang.Object
  extended by org.infinispan.marshall.AbstractMarshaller
      extended by org.infinispan.marshall.jboss.GenericJBossMarshaller
          extended by org.infinispan.marshall.jboss.JBossMarshaller
All Implemented Interfaces:
Marshaller, StreamingMarshaller

public class JBossMarshaller
extends GenericJBossMarshaller
implements StreamingMarshaller

A specialized form of the GenericJBossMarshaller, making use of a custom object table for types internal to Infinispan.

The reason why this is implemented specially in Infinispan rather than resorting to Java serialization or even the more efficient JBoss serialization is that a lot of efficiency can be gained when a majority of the serialization that occurs has to do with a small set of known types such as GlobalTransaction or ReplicableCommand, and class type information can be replaced with simple magic numbers.

Unknown types (typically user data) falls back to JBoss serialization.

Since:
4.0
Author:
Galder ZamarreƱo

Nested Class Summary
 
Nested classes/interfaces inherited from class org.infinispan.marshall.jboss.GenericJBossMarshaller
GenericJBossMarshaller.DebuggingExceptionListener
 
Field Summary
 
Fields inherited from class org.infinispan.marshall.jboss.GenericJBossMarshaller
configuration, DEFAULT_MARSHALLER_FACTORY, defaultCl, factory, log
 
Fields inherited from class org.infinispan.marshall.AbstractMarshaller
DEFAULT_BUF_SIZE
 
Constructor Summary
JBossMarshaller()
           
 
Method Summary
 boolean isMarshallable(Object o)
          A method that checks whether the given object is marshallable as per the rules of this marshaller.
 Object objectFromInputStream(InputStream inputStream)
           
 void start(ClassLoader defaultCl, RemoteCommandsFactory cmdFactory, StreamingMarshaller ispnMarshaller)
           
 void stop()
           
 
Methods inherited from class org.infinispan.marshall.jboss.GenericJBossMarshaller
finishObjectInput, finishObjectOutput, objectFromByteBuffer, objectFromObjectStream, objectToBuffer, objectToObjectStream, startObjectInput, startObjectOutput
 
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
 
Methods inherited from interface org.infinispan.marshall.StreamingMarshaller
finishObjectInput, finishObjectOutput, objectFromObjectStream, objectToObjectStream, startObjectInput, startObjectOutput
 
Methods inherited from interface org.infinispan.marshall.Marshaller
objectFromByteBuffer, objectFromByteBuffer, objectToBuffer, objectToByteBuffer, objectToByteBuffer
 

Constructor Detail

JBossMarshaller

public JBossMarshaller()
Method Detail

start

public void start(ClassLoader defaultCl,
                  RemoteCommandsFactory cmdFactory,
                  StreamingMarshaller ispnMarshaller)

stop

public void stop()

objectFromInputStream

public Object objectFromInputStream(InputStream inputStream)
                             throws IOException,
                                    ClassNotFoundException
Specified by:
objectFromInputStream in interface StreamingMarshaller
Throws:
IOException
ClassNotFoundException

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.

Specified by:
isMarshallable in interface Marshaller
Overrides:
isMarshallable in class GenericJBossMarshaller
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.