Package javassist

Examples of javassist.ClassPool.writeFile()


                }
            }

            final File directory = getClassOutputDirectory(existingClass);

            pool.writeFile(className,
                directory != null ? directory.getAbsolutePath() : "");
        }
        catch (final Throwable throwable)
        {
            throwable.printStackTrace();
View Full Code Here


        ClassPool cp2 = new ClassPool(null);
        cp2.appendClassPath(new LoaderClassPath(Foo.class.getClassLoader()));

        try {
            // swap java.lang.ClassLoader with itself
            cp2.writeFile("java.lang.ClassLoader", "_dump");
            //byte[] bytecode = ClassLoaderPatcher.getPatchedClassLoader("org.codehaus.aspectwerkz.hook.impl.ClassLoaderPreProcessorImpl");
            client.hotswap(ClassLoader.class, cp2.get("java.lang.ClassLoader").toBytecode());
        } catch (Throwable e) {
            e.printStackTrace();
        }
View Full Code Here

        } catch (Throwable e) {
            e.printStackTrace();
        }

        // swap java.lang.String with itself
        cp2.writeFile("java.lang.String", "_dump");
        //byte[] bytecode = ClassLoaderPatcher.getPatchedClassLoader("org.codehaus.aspectwerkz.hook.impl.ClassLoaderPreProcessorImpl");
        client.hotswap(String.class, cp2.get("java.lang.String").toBytecode());
    }
}
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.