Examples of DomainClassLoader


Examples of org.jboss.ejb3.interceptors.aop.DomainClassLoader

      if(domainDefinition == null)
         throw new IllegalArgumentException("Domain definition for container '" + containerName + "' can not be found");
     
      final Domain domain = (Domain) domainDefinition.getManager();
     
      ClassLoader classLoader = new DomainClassLoader(Thread.currentThread().getContextClassLoader(), deploymentClassLoader, domain);
      Thread.currentThread().setContextClassLoader(classLoader);
     
      // The moment an instrumented class comes up it does AspectManager.instance(classLoader), which
      // should return the classLoader created above. So we tie in a class loader scoping policy.
      // Note that this won't work in AS.
      AOPClassLoaderScopingPolicy classLoaderScopingPolicy = new AOPClassLoaderScopingPolicy() {
         public Domain getDomain(ClassLoader classLoader, AspectManager parent)
         {
            //log.debug("getDomain");
            if(classLoader instanceof DomainClassLoader)
               return ((DomainClassLoader) classLoader).getDomain();
            return null;
         }

         public Domain getTopLevelDomain(AspectManager parent)
         {
            throw new RuntimeException("NYI");
         }

         public boolean isScoped(ClassLoader classLoader)
         {
            throw new RuntimeException("NYI");
         }
      };
      AspectManager.setClassLoaderScopingPolicy(classLoaderScopingPolicy);
     
      runner = classLoader.loadClass("org.jboss.ejb3.test.interceptors.basic.unit.BasicTestRunner").newInstance();
      log.info("===== Done setting up");
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.