Examples of loadClass()


Examples of org.gradle.internal.classloader.MutableURLClassLoader.loadClass()

        ClassPath antClasspath = classPathRegistry.getClassPath("ANT");
        ClassPath runtimeClasspath = classPathRegistry.getClassPath("GRADLE_RUNTIME");
        ClassLoader antClassLoader = classLoaderFactory.createIsolatedClassLoader(antClasspath);
        ClassLoader runtimeClassLoader = new MutableURLClassLoader(antClassLoader, runtimeClasspath);
        Thread.currentThread().setContextClassLoader(runtimeClassLoader);
        Class<?> mainClass = runtimeClassLoader.loadClass(mainClassName);
        Object entryPoint = mainClass.newInstance();
        Method mainMethod = mainClass.getMethod("run", String[].class);
        mainMethod.invoke(entryPoint, new Object[]{args});
    }
}
View Full Code Here

Examples of org.jboss.classfilewriter.code.CodeAttribute.loadClass()

    @Override
    protected void generateHashCodeMethod(ClassFile proxyClassType) {
        final ClassMethod method = proxyClassType.addMethod(AccessFlag.PUBLIC, HASH_CODE_METHOD, DescriptorUtils.INT_CLASS_DESCRIPTOR);
        final CodeAttribute b = method.getCodeAttribute();
        // MyProxyName.class.hashCode()
        b.loadClass(proxyClassType.getName());
        // now we have the class object on top of the stack
        b.invokevirtual("java.lang.Object", HASH_CODE_METHOD, EMPTY_PARENTHESES + DescriptorUtils.INT_CLASS_DESCRIPTOR);
        // now we have the hashCode
        b.returnInstruction();
    }
View Full Code Here

Examples of org.jboss.classloader.spi.ClassLoaderDomain.loadClass()

            myPerVMAspects.put(def, aspect);
         }
         else
         {
            //The class has been loaded by a parent domain, find out if we also have a copy
            Class<?> myAspectClazz = myDomain.loadClass(aspect.getClass().getName());
           
            if (myAspectClazz == superAspectClass)
            {
               notMyPerVMAspects.put(def, Boolean.TRUE);
            }
View Full Code Here

Examples of org.jboss.classloader.spi.DelegateLoader.loadClass()

   @Override
   protected Class<?> doLoadClass(String className)
   {
      DelegateLoader loader = resolve(ClassLoaderUtils.getClassPackageName(className));
      return loader != null ? loader.loadClass(className) : null;
   }

   @Override
   protected URL doGetResource(String name)
   {
View Full Code Here

Examples of org.jboss.classloader.spi.Loader.loadClass()

         {
            ClassLoaderCache cache = policy.getCache();
            if (cache != null)
            {
               Loader loader = cache.getCachedLoader(path);
               return (loader != null) ? loader.loadClass(name) : null;
            }
         }
      }
      return null;
   }
View Full Code Here

Examples of org.jboss.classloading.plugins.AbstractClassLoadingDomain.loadClass()

   // Public --------------------------------------------------------

   public void testLoadClass() throws Exception
   {
      AbstractClassLoadingDomain domain = new AbstractClassLoadingDomain();
      domain.loadClass("java.lang.String", false, null);
   }

   public void testLoadClassFailed() throws Exception
   {
      AbstractClassLoadingDomain domain = new AbstractClassLoadingDomain();
View Full Code Here

Examples of org.jboss.classloading.spi.dependency.Module.loadClass()

      KernelControllerContext contextA = install(a);
      try
      {
         ClassLoader clA = assertClassLoader(contextA);
         Module moduleA = assertModule(contextA);
         Class<?> result = moduleA.loadClass(A.class.getName());
         assertEquals(clA, result.getClassLoader());
        
         Module other = moduleA.getModuleForClass(A.class.getName());
         assertEquals(moduleA, other);
        
View Full Code Here

Examples of org.jboss.ejb3.interceptors.aop.DomainClassLoader.loadClass()

            throw new RuntimeException("NYI");
         }
      };
      AspectManager.setClassLoaderScopingPolicy(classLoaderScopingPolicy);
     
      runner = classLoader.loadClass("org.jboss.ejb3.test.interceptors.basic.unit.BasicTestRunner").newInstance();
      log.info("===== Done setting up");
   }
  
   public Object getRunner()
   {
View Full Code Here

Examples of org.jboss.ejb3.test.proxy.impl.ejbthree1889.RedefiningClassLoader.loadClass()

      URLClassLoader master = (URLClassLoader) Thread.currentThread().getContextClassLoader();
      ClassLoader cl = new RedefiningClassLoader(master, MyServiceBean.class, MyService.class, MyServiceRemoteBusiness.class);
      Thread.currentThread().setContextClassLoader(cl);
      try
      {
         Class<?> beanClass = cl.loadClass(MyServiceBean.class.getName());
        
         ServiceContainer container = Utils.createService(beanClass);
        
         Ejb3RegistrarLocator.locateRegistrar().bind(container.getName(), container);
      }
View Full Code Here

Examples of org.jboss.forge.classloader.mock.system.EmptyClassLoader.loadClass()

   public void testNullSystemClassLoaderDefaultsToFurnaceProxyCL() throws Exception
   {
      ClassLoader thisLoader = SystemClassLoaderNullClassLoaderAdapterTest.class.getClassLoader();

      ClassLoader dep1Loader = new EmptyClassLoader();
      Class<?> foreignType = dep1Loader.loadClass(ArrayListFactory.class.getName());
      Object foreignInstance = foreignType.newInstance();
      List<?> proxy = (List<?>) foreignType.getMethod("getArrayList").invoke(foreignInstance);
      Assert.assertFalse(Proxies.isForgeProxy(proxy));

      Object delegate = foreignType.newInstance();
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.