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, defaultCl, factory, log
 
Fields inherited from class org.infinispan.marshall.AbstractMarshaller
DEFAULT_BUF_SIZE
 
Constructor Summary
JBossMarshaller()
           
 
Method Summary
 boolean isMarshallableCandidate(Object o)
           
 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, isMarshallable, 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
isMarshallable, 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()
Overrides:
stop in class GenericJBossMarshaller

objectFromInputStream

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

isMarshallableCandidate

public boolean isMarshallableCandidate(Object o)
Overrides:
isMarshallableCandidate in class GenericJBossMarshaller


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