Package org.hotswap.agent.javassist

Examples of org.hotswap.agent.javassist.ClassPool.makeClass()


                    final ClassPool classPool = ClassPool.getDefault();

                    scanner.scan(getClass().getClassLoader(), PLUGIN_PATH, new ScannerVisitor() {
                        @Override
                        public void visit(InputStream file) throws IOException {
                            plugins.add(classPool.makeClass(file));
                        }
                    });
                }
            }
        }
View Full Code Here


                "Boolean.TRUE", "java.lang.Boolean");

        ClassPool classPool = ClassPool.getDefault();
        classPool.appendSystemPath();

        CtClass clazz = classPool.makeClass("Test");
        clazz.addMethod(CtNewMethod.make("public void test() {" + s + "}", clazz));
        Class<?> testClass = clazz.toClass();


        Method testMethod = testClass.getDeclaredMethod("test");
View Full Code Here

     */
    private CtClass createCtClass(URI uri, ClassLoader classLoader) throws NotFoundException, IOException {
        ClassPool cp = new ClassPool();
        cp.appendClassPath(new LoaderClassPath(classLoader));

        return cp.makeClass(new ByteArrayInputStream(IOUtils.toByteArray(uri)));
    }
}
View Full Code Here

            File classFile = new File(fileURI);
            CtClass ctClass = null;

            boolean doHotswap = false;
            try {
                ctClass = pool.makeClass(new FileInputStream(classFile));
                doHotswap = equinoxPlugin.loadClassToTargetClassLoaders(ctClass, fileURI, true);
            } catch (Exception e) {
                LOGGER.warning("MakeClass exception : {}",  e.getMessage());
            } finally {
                if (ctClass != null) {
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.