Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.marshall.jboss;
 
JBoss Marshalling plugin class for org.jboss.marshalling.ClassExternalizerFactory that allows for Infinispan annotations to be used instead of JBoss Marshalling ones in order to discover which classes are serializable with Infinispan externalizers.

Author(s):
Galder ZamarreƱo
Since:
5.0
   @Override
   public Externalizer getExternalizer(Class<?> type) {
      SerializeWith ann = type.getAnnotation(SerializeWith.class);
      if (ann == null) {
         // Check for JBoss Marshaller's @Externalize
         return .getExternalizer(type);
      } else {
         try {
            return new JBossExternalizerAdapter(ann.value().newInstance());
         } catch (Exception e) {
            throw new IllegalArgumentException(String.format(
                  "Cannot instantiate externalizer for %s"type), e);
         }
      }
   }
New to GrepCode? Check out our FAQ X