Class WebAppMarshaller

  • All Implemented Interfaces:
    org.infinispan.commons.marshall.Marshaller, org.infinispan.commons.marshall.StreamingMarshaller

    public class WebAppMarshaller
    extends org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller
    WebAppMarshaller An implementation of the AbstractJBossMarshaller code that is just enough to provide a ContextClassResolver that will use the Thread Context Classloader in order to deserialize session attribute classes. This is necessary because the standard infinispan marshaller (GenericJBossMarshaller) uses the classloader of the loader that loaded itself. When using the infinispan module in Jetty, all of the infinispan classes will be on the container classpath. That means that the GenericJBossMarshaller returns the container classloader which is unable to load any webapp classes. This class ensures that it is always the webapp's classloader that will be used. In order to use this class, you should put a file into the ${jetty.base}/resources directory that contains this line: infinispan.client.hotrod.marshaller=org.eclipse.jetty.session.infinispan.WebAppMarshaller You will also need to add the following lines to a context xml file for your webapp to permit the webapp's classloader to see the org.eclipse.jetty.session.infinispan classes for the deserialization to work correctly: <Call name="prependServerClass"> <Arg>-org.eclipse.jetty.session.infinispan.</Arg> </Call>
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  WebAppMarshaller.WebAppContextClassResolver
      WebAppContextClassResolver Provides the Thread Context Classloader to use for deserializing.
      • Nested classes/interfaces inherited from class org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller

    • Field Summary

      • Fields inherited from class org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller

        baseCfg, DEF_CLASS_COUNT, DEF_INSTANCE_COUNT, factory, log
      • Fields inherited from class org.infinispan.commons.marshall.AbstractMarshaller

    • Constructor Summary

      Constructor Description
    • Method Summary

      • Methods inherited from class org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller

        finishObjectInput, finishObjectOutput, isMarshallable, isMarshallableCandidate, mediaType, objectFromByteBuffer, objectFromObjectStream, objectToBuffer, objectToObjectStream, start, startObjectInput, startObjectOutput, stop
      • Methods inherited from class org.infinispan.commons.marshall.AbstractMarshaller

        getBufferSizePredictor, objectFromByteBuffer, objectFromInputStream, 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.commons.marshall.Marshaller

        getBufferSizePredictor, objectFromByteBuffer, objectToBuffer, objectToByteBuffer, objectToByteBuffer
      • Methods inherited from interface org.infinispan.commons.marshall.StreamingMarshaller

    • Constructor Detail

      • WebAppMarshaller

        public WebAppMarshaller()