org.infinispan.interceptors
Class MarshalledValueInterceptor

java.lang.Object
  extended by org.infinispan.commands.AbstractVisitor
      extended by org.infinispan.interceptors.base.CommandInterceptor
          extended by org.infinispan.interceptors.MarshalledValueInterceptor
All Implemented Interfaces:
Visitor

public class MarshalledValueInterceptor
extends CommandInterceptor

Interceptor that handles the wrapping and unwrapping of cached data using MarshalledValues. Known "excluded" types are not wrapped/unwrapped, which at this time include String, Java primitives and their Object wrappers, as well as arrays of excluded types.

The MarshalledValue wrapper handles lazy deserialization from byte array representations.

Since:
4.0
Author:
Manik Surtani (manik@jboss.org), Mircea.Markus@jboss.com, Galder ZamarreƱo
See Also:
MarshalledValue

Field Summary
 
Fields inherited from class org.infinispan.interceptors.base.CommandInterceptor
configuration, log, trace
 
Constructor Summary
MarshalledValueInterceptor()
           
 
Method Summary
protected  MarshalledValue createMarshalledValue(Object toWrap, InvocationContext ctx)
           
protected  void injectMarshaller(Marshaller marshaller)
           
 Object visitEntrySetCommand(InvocationContext ctx, EntrySetCommand command)
           
 Object visitEvictCommand(InvocationContext ctx, EvictCommand command)
           
 Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command)
           
 Object visitKeySetCommand(InvocationContext ctx, KeySetCommand command)
           
 Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command)
           
 Object visitPutMapCommand(InvocationContext ctx, PutMapCommand command)
           
 Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command)
           
 Object visitValuesCommand(InvocationContext ctx, ValuesCommand command)
           
protected  Map wrapMap(Map<Object,Object> m, Set<MarshalledValue> marshalledValues, InvocationContext ctx)
           
 
Methods inherited from class org.infinispan.interceptors.base.CommandInterceptor
getNext, handleDefault, hasNext, invokeNextInterceptor, setNext
 
Methods inherited from class org.infinispan.commands.AbstractVisitor
visitClearCommand, visitCollection, visitCommitCommand, visitInvalidateCommand, visitLockControlCommand, visitPrepareCommand, visitReplaceCommand, visitRollbackCommand, visitSizeCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarshalledValueInterceptor

public MarshalledValueInterceptor()
Method Detail

injectMarshaller

protected void injectMarshaller(Marshaller marshaller)

visitPutMapCommand

public Object visitPutMapCommand(InvocationContext ctx,
                                 PutMapCommand command)
                          throws Throwable
Specified by:
visitPutMapCommand in interface Visitor
Overrides:
visitPutMapCommand in class AbstractVisitor
Throws:
Throwable

visitPutKeyValueCommand

public Object visitPutKeyValueCommand(InvocationContext ctx,
                                      PutKeyValueCommand command)
                               throws Throwable
Specified by:
visitPutKeyValueCommand in interface Visitor
Overrides:
visitPutKeyValueCommand in class AbstractVisitor
Throws:
Throwable

visitRemoveCommand

public Object visitRemoveCommand(InvocationContext ctx,
                                 RemoveCommand command)
                          throws Throwable
Specified by:
visitRemoveCommand in interface Visitor
Overrides:
visitRemoveCommand in class AbstractVisitor
Throws:
Throwable

visitEvictCommand

public Object visitEvictCommand(InvocationContext ctx,
                                EvictCommand command)
                         throws Throwable
Specified by:
visitEvictCommand in interface Visitor
Overrides:
visitEvictCommand in class AbstractVisitor
Throws:
Throwable

visitGetKeyValueCommand

public Object visitGetKeyValueCommand(InvocationContext ctx,
                                      GetKeyValueCommand command)
                               throws Throwable
Specified by:
visitGetKeyValueCommand in interface Visitor
Overrides:
visitGetKeyValueCommand in class AbstractVisitor
Throws:
Throwable

visitKeySetCommand

public Object visitKeySetCommand(InvocationContext ctx,
                                 KeySetCommand command)
                          throws Throwable
Specified by:
visitKeySetCommand in interface Visitor
Overrides:
visitKeySetCommand in class AbstractVisitor
Throws:
Throwable

visitValuesCommand

public Object visitValuesCommand(InvocationContext ctx,
                                 ValuesCommand command)
                          throws Throwable
Specified by:
visitValuesCommand in interface Visitor
Overrides:
visitValuesCommand in class AbstractVisitor
Throws:
Throwable

visitEntrySetCommand

public Object visitEntrySetCommand(InvocationContext ctx,
                                   EntrySetCommand command)
                            throws Throwable
Specified by:
visitEntrySetCommand in interface Visitor
Overrides:
visitEntrySetCommand in class AbstractVisitor
Throws:
Throwable

wrapMap

protected Map wrapMap(Map<Object,Object> m,
                      Set<MarshalledValue> marshalledValues,
                      InvocationContext ctx)
               throws NotSerializableException
Throws:
NotSerializableException

createMarshalledValue

protected MarshalledValue createMarshalledValue(Object toWrap,
                                                InvocationContext ctx)
                                         throws NotSerializableException
Throws:
NotSerializableException

Google Analytics

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