Examples of loadClass()


Examples of com.thoughtworks.xstream.core.JVM.loadClass()

        addDriverTest(new XppDomDriver());
        addDriverTest(new XppDriver());
        addDriverTest(new XomDriver());
        if (JVM.is14()) {
            JVM jvm = new JVM();
            Class driverType = jvm.loadClass("com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver");
            try {
                addDriverTest((HierarchicalStreamDriver)driverType.newInstance());
            } catch (InstantiationException e) {
                throw new AssertionFailedError("Cannot instantiate " + driverType.getName());
            } catch (IllegalAccessException e) {
View Full Code Here

Examples of com.twosigma.beaker.jvm.classloader.DynamicClassLoader.loadClass()

            compilationUnit.addJavaSource(pname+".Foo", javaSourceCode.toString());
 
            loader.clearCache();
            javaSourceCompiler.compile(compilationUnit);
            javaSourceCompiler.persistCompiledClasses(compilationUnit);
            Class<?> fooClass = loader.loadClass(pname+".Foo");
            Method mth = fooClass.getDeclaredMethod("beakerRun", (Class[]) null);
            Object o = mth.invoke(null, (Object[])null);
            if(ret.equals("Object")) {
              j.outputObject.finished(o);
            } else {
View Full Code Here

Examples of cuchaz.enigma.TranslatingTypeLoader.loadClass()

        {
          System.err.println( "WARNING: method doesn't match: " + methodEntry );
         
          // show the available methods
          System.err.println( "\tAvailable dest methods:" );
          CtClass c = destLoader.loadClass( classMapping.getObfName() );
          for( CtBehavior behavior : c.getDeclaredBehaviors() )
          {
            MethodEntry declaredMethodEntry = new MethodEntry(
              new ClassEntry( classMapping.getObfName() ),
              behavior.getName(),
View Full Code Here

Examples of edu.indiana.extreme.xbaya.jython.runner.JythonClassLoader.loadClass()

     */
    public void testLoadClass() throws ClassNotFoundException {
        JythonClassLoader loader = new JythonClassLoader(this.getClass()
                .getClassLoader());

        Class<?> newJythonClass = loader.loadClass(jython.class.getName(), true);
        assertNotSame(jython.class, newJythonClass);

        Class<?> newStringClass = loader.loadClass(String.class.getName(), true);
        assertEquals(String.class, newStringClass);
    }
View Full Code Here

Examples of fi.jumi.threadsafetyagent.util.TransformationTestClassLoader.loadClass()

            protected ClassVisitor getAdapters(ClassVisitor cv) {
                return super.getAdapters(new CheckClassAdapter(cv));
            }
        };
        ClassLoader loader = new TransformationTestClassLoader(cls.getName(), transformer, null);
        return loader.loadClass(cls.getName());
    }


    // guinea pigs
View Full Code Here

Examples of freenet.support.JarClassLoader.loadClass()

        Closer.close(pluginJarFile);
      }

      try {
        JarClassLoader jarClassLoader = new JarClassLoader(pluginFile);
        Class<?> pluginMainClass = jarClassLoader.loadClass(pluginMainClassName);
        Object object = pluginMainClass.newInstance();
        if(!(object instanceof FredPlugin)) {
          Logger.error(this, "plugin main class is not a plugin");
          pluginFile.delete();
          if(!downloaded) continue;
View Full Code Here

Examples of groovy.lang.GroovyClassLoader.loadClass()

    @Override
    protected CamelContext createCamelContext() throws Exception {
        CamelContext answer = super.createCamelContext();

        GroovyClassLoader classLoader = new GroovyClassLoader();
        Class<?> type = classLoader.loadClass(groovyBuilderClass);
        Object object = answer.getInjector().newInstance(type);
        RouteBuilder builder = assertIsInstanceOf(RouteBuilder.class, object);

        log.info("Loaded builder: " + builder);
        answer.addRoutes(builder);
View Full Code Here

Examples of honeycrm.server.test.small.dyn.hotreload.InterceptClassLoader.loadClass()

      ResourceStore r = new ResourceStore(db, "Classes");
      r.put(store.getBytecodeMapFromJarInputStream(new FileInputStream(FILE)));
     
      InterceptClassLoader loader = new InterceptClassLoader(getClass().getClassLoader(), Pattern.compile(PATTERN), Arrays.asList(new DatastoreClassLoaderDelegate(r)));
     
      Class c = loader.loadClass("honeycrm.server.test.small.DynamicallyLoadedClass", true);
      //assertTrue(c.newInstance() instanceof Plugin);
      // Plugin p = (Plugin) c.newInstance();
      // assertEquals("42", p.request());
      assertEquals("42", c.getMethod("request").invoke(c.newInstance()));
    } catch (Exception e) {
View Full Code Here

Examples of io.vertx.core.impl.verticle.CompilingClassLoader.loadClass()

    verticleName = VerticleFactory.removePrefix(verticleName);
    Class clazz;
    if (verticleName.endsWith(".java")) {
      CompilingClassLoader compilingLoader = new CompilingClassLoader(classLoader, verticleName);
      String className = compilingLoader.resolveMainClassName();
      clazz = compilingLoader.loadClass(className);
    } else {
      clazz = classLoader.loadClass(verticleName);
    }
    return (Verticle) clazz.newInstance();
  }
View Full Code Here

Examples of java.lang.ClassLoader.loadClass()

        if (cl == null) {
            // fall back to Class.forName
            return Class.forName(className);
        }
        try {
            return cl.loadClass(className);
        } catch (ClassNotFoundException e) {
            return Class.forName(className);
        }
    }
}
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.