Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.marshall.jboss;
 
 import  org.jboss.marshalling.ContextClassResolver;
 
This class refines ContextClassLoader to add a default class loader in case the context class loader is null.

Author(s):
Dan Berindei <dberinde@redhat.com>
Since:
4.2
public class DefaultContextClassResolver extends ContextClassResolver {
   public DefaultContextClassResolver(ClassLoader defaultClassLoader) {
      this. = new WeakReference<ClassLoader>(defaultClassLoader);
   }
   @Override
   protected ClassLoader getClassLoader() {
      ClassLoader loader = super.getClassLoader();
      return loader != null ? loader : .get();
   }
New to GrepCode? Check out our FAQ X