Package alt.jiapi.reflect

Examples of alt.jiapi.reflect.Loader.loadClass()


        Instrumentor createMethod =
            new CreateMethodInstrumentor(Modifier.PUBLIC + Modifier.STATIC,
                                         "bar");

        Loader loader = ctx.getLoader();
        JiapiClass sourceClass = loader.loadClass("test.Bar");
        JiapiMethod sourceMethod =
            sourceClass.getDeclaredMethod("bar", new String[0]);

        Instrumentor copyMethod
            = new CopyInstrumentor(sourceMethod.getInstructionList());
View Full Code Here


        Runtime.setFieldValue(fieldName, value);

        try {
            Loader l = new Loader();
            JiapiClass jc = l.loadClass("alt.jiapi.Runtime");
//             Class []params = new Class[] { String.class };
//             getFieldValue = Runtime.class.getMethod("getFieldValue", params);
            getFieldValue = jc.getDeclaredMethod("getFieldValue", new String[] {"java.lang.String"});
        }
        catch (Exception e) {
View Full Code Here

    }

    public HelloWorldBuilder() throws Exception {
        // Load the target class:
        Loader loader = new Loader();
        JiapiClass clazz = loader.loadClass("samples.reflect.hello1.Test");
        System.out.println(clazz);

        // Add an empty method for a clazz. The method signature must
        // match the method from HelloWorld interface, the only difference
        // is that we want to implement the method now so it can't be abstract.
View Full Code Here

        HSInstrumentor(HotSpotAdvice advice, byte[] hotSpots, String resolution) {
            try {
                this.rule = new Rule(resolution);
                Loader l = new Loader();
                log.debug("Loading advice " + advice.getClass().getName());
                JiapiClass clazz = l.loadClass(advice.getClass().getName());

                log.debug("Getting advice() method ");
                this.adviceMethod =
                    clazz.getDeclaredMethod("advice", new String[0]);
                this.hotSpots = hotSpots;
View Full Code Here

            }
        }

        Loader l = new Loader();
        try {
            JiapiClass hClass = l.loadClass(hookClass.getName());
            Class[] hpTypes = hookMethod.getParameterTypes();
            String[] pTypes = new String[hpTypes.length];
           
            for (int i = 0; i < pTypes.length; i++) {
                pTypes[i] = hpTypes[i].getName();
View Full Code Here

    }

    protected void setUp() {
        try {
            Loader loader = new Loader();
            JiapiClass clazz = loader.loadClass("alt.jiapi.InstrumentorTest");
            methods = clazz.getDeclaredMethods();
        } catch (Exception e) {
            e.printStackTrace();
        }
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.