- All Implemented Interfaces:
org.infinispan.commons.marshall.Marshaller
, org.infinispan.commons.marshall.StreamingMarshaller
@Deprecated
public class WebAppMarshaller
extends org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller
Deprecated.
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 hotrod-client.properties 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>