Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.marshall.jboss;
 
 import  org.jboss.marshalling.AbstractMarshallerFactory;
 import  org.jboss.marshalling.Marshalling;
 import  org.jboss.marshalling.MarshallingConfiguration;
 import  org.jboss.marshalling.reflect.SerializableClassRegistry;
 import  org.jboss.marshalling.river.RiverMarshallerFactory;
 
A JBoss Marshalling factory class for retrieving marshaller/unmarshaller instances. The aim of this factory is to allow Infinispan to provide its own JBoss Marshalling marshaller/unmarshaller extensions.

Author(s):
Galder ZamarreƱo
Since:
5.1
public class JBossMarshallerFactory extends AbstractMarshallerFactory {
   private final SerializableClassRegistry registry;
   private final RiverMarshallerFactory factory;
   public JBossMarshallerFactory() {
       = (RiverMarshallerFactory) Marshalling.getMarshallerFactory(
            "river", Marshalling.class.getClassLoader());
      if ( == null)
         throw new IllegalStateException(
            "River marshaller factory not found.  Verify that the JBoss Marshalling River jar archive is in the classpath.");
       = AccessController.doPrivileged(new PrivilegedAction<SerializableClassRegistry>() {
          @Override
          public SerializableClassRegistry run() {
              return SerializableClassRegistry.getInstance();
          }
      });
   }
   @Override
   public ExtendedRiverUnmarshaller createUnmarshaller(MarshallingConfiguration configurationthrows IOException {
      return new ExtendedRiverUnmarshaller(configuration);
   }
   @Override
   public ExtendedRiverMarshaller createMarshaller(MarshallingConfiguration configurationthrows IOException {
      return new ExtendedRiverMarshaller(configuration);
   }
New to GrepCode? Check out our FAQ X