Examples of loadClass()


Examples of org.allspice.util.ImmediateClassLoader.loadClass()

    JavaClass jc = GenJavaClass.createJavaClass(makeAddClass()) ;
    // Use a utility loader so we can call our class without saving to disk
    ImmediateClassLoader loader = new ImmediateClassLoader() ;
    loader.defineClass(jc.getClassName(),jc.getBytes()) ;
    // Load the honest to goodness class
    Class<?> cl = loader.loadClass("TestClass") ;
    // Create an instance of the class.
    Object o = cl.newInstance() ;
    // Get the "add" method
    Method m = cl.getMethod("add",int.class,int.class) ;
    // Run it!
View Full Code Here

Examples of org.apache.airavata.xbaya.jython.runner.JythonClassLoader.loadClass()

     * @throws ClassNotFoundException
     */
    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 org.apache.axis.utils.AxisClassLoader.loadClass()

    }

    public void testLoadClass() throws ClassNotFoundException
    {
  AxisClassLoader acl = AxisClassLoader.getClassLoader();
        Class clazz = acl.loadClass("java.util.BitSet"); //BitSet was chosen arbitrarily
        assertTrue(clazz.getName().equals("java.util.BitSet"));

        java.util.Stack stack = new java.util.Stack(); //Stack was chosen arbitrarily
        Class clazz1 = stack.getClass();
        acl.registerClass("myStack",clazz1);
View Full Code Here

Examples of org.apache.axis.utils.JWSClassLoader.loadClass()

            */
            rpc.setOption( "allowedMethods", "*");

            // Set up service description
            ServiceDesc sd = rpc.getServiceDescription();
            sd.setImplClass(cl.loadClass(clsName));
            sd.setTypeMapping(msgContext.getTypeMapping());

            // Set engine, which hooks up type mappings.
            rpc.setEngine(msgContext.getAxisEngine());
           
View Full Code Here

Examples of org.apache.axis2.deployment.DeploymentClassLoader.loadClass()

                }

                String[] facClassName = facSB.toString().split("\n");
                for (int i=0; i<facClassName.length; i++) {
                    log.info("Registering the Mediator factory: " + facClassName[i]);
                    Class facClass = urlCl.loadClass(facClassName[i]);
                    MediatorFactory facInst = (MediatorFactory) facClass.newInstance();
                    MediatorFactoryFinder.getInstance()
                            .getFactoryMap().put(facInst.getTagQName(), facClass);
                    log.info("Mediator loaded and registered for " +
                            "the tag name: " + facInst.getTagQName());
View Full Code Here

Examples of org.apache.bcel.util.ClassLoaderRepository.loadClass()

                return;
            }
        }
        JavaClass jc;
        try {
            jc = clr.loadClass(argv[0]);
        } catch (ClassNotFoundException e) {
            System.err.println("Class not found: " + argv[0]);
            return;
        }
        String pk = jc.getPackageName();
View Full Code Here

Examples of org.apache.bcel.util.Repository.loadClass()

              allClassNames.removeAll(skipNamesToProcess);
              sLog.info("Processing " + allClassNames.size()
                  + " classes in " + urlFile);
              for (String className : allClassNames) {
                final Map<MethodInfo, Code> codeMap = new HashMap<MethodInfo, Code>();
                final JavaClass javaClass = repo
                    .loadClass(className);
                for (Method method : javaClass.getMethods()) {
                  codeMap.put(JavaClassProcessor.toMethod(
                      className, method), method
                      .getCode());
View Full Code Here

Examples of org.apache.bcel.util.SyntheticRepository.loadClass()

        private void initUsedClasses(JarFile jarFile) {
            SyntheticRepository repository = SyntheticRepository.getInstance(new ClassPath(jarFile.getName()));
            for (String className : containedClasses) {
                try {
                    analyzeClass(className, repository.loadClass(className));
                } catch (ClassNotFoundException cnfe) {
                    cnfe.printStackTrace();
                }
            }
        }
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.ReloadableClassHandler.loadClass()

            FormBeanConfig formBeanConfig = formBeans[i];
            String formType = InternalUtils.getFormBeanType( formBeanConfig );

            try
            {
                Class formBeanClass = rch.loadClass( formType );
                _formBeanClasses.put( formBeanConfig.getName(), formBeanClass );
            }
            catch ( ClassNotFoundException e )
            {
                _log.error( "Could not load class " + formType + " referenced from form bean config "
View Full Code Here

Examples of org.apache.catalina.loader.WebappClassLoader.loadClass()

    private Object loadInstance(String className){
        try{
            WebappClassLoader loader = (WebappClassLoader)
                                                getLoader().getClassLoader();
            Class clazz = loader.loadClass(className);
            return clazz.newInstance();
        } catch (Throwable ex){
            String msg = _rb.getString("webcontainer.unableToLoadExtension");
            msg = MessageFormat.format(msg, new Object[] { className,
                                                           getName() });
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.