Examples of WeavingClassLoader


Examples of er.profiling.classloader.WeavingClassLoader

    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    if (cl instanceof URLClassLoader && !premainHasRun) {
      premainHasRun = true;
      System.setProperty(WeavingClassLoader.GLUE_NAME_KEY, PFProfilerMixin.class.getName());
      URLClassLoader loader = (URLClassLoader) cl;
      ClassLoader newCl = new WeavingClassLoader(loader.getURLs(), loader.getParent());
      Thread.currentThread().setContextClassLoader(newCl);
    }
  }
View Full Code Here

Examples of kilim.WeavingClassLoader

        if (args.length == 0) {
            usage();
        }
        String className = args[0];
        args = processArgs(args);
        WeavingClassLoader wcl = new WeavingClassLoader(Thread.currentThread().getContextClassLoader());
        Class<?> mainClass = wcl.loadClass(className);
        Method mainMethod = mainClass.getMethod("main", new Class[]{String[].class});
        mainMethod.invoke(null,new Object[] {args});
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.hook.impl.WeavingClassLoader

                StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
                while (st.hasMoreTokens()) {
                    paths.add((new File(st.nextToken())).getCanonicalFile().toURL());
                }
                cl =
                new WeavingClassLoader(
                        (URL[])paths.toArray(new URL[]{}), ClassLoader.getSystemClassLoader().getParent()
                );
            }
            catch (IOException e) {
                throw new WrappedRuntimeException(e);
View Full Code Here

Examples of org.codehaus.aspectwerkz.hook.impl.WeavingClassLoader

    /**
     * Run with forced weaving thru custom classloader -Daspectwerkz.definition.file=src\test\test-xmldef.xml
     * -Daspectwerkz.transform.verbose=yes -Daspectwerkz.transform.dump=test..*
     */
    public void runThruWeavingClassLoader() throws Exception {
        ClassLoader cl = new WeavingClassLoader(
                new URL[]{(new File("_temp")).toURL()}, ClassLoader.getSystemClassLoader()
        );
        createClassFiles("_temp", "atest");
        long ms = System.currentTimeMillis();
        callClassesOneByOne(cl, "atest");
View Full Code Here

Examples of org.codehaus.aspectwerkz.hook.impl.WeavingClassLoader

                ArrayList paths = new ArrayList();
                StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
                while (st.hasMoreTokens()) {
                    paths.add((new File(st.nextToken())).getCanonicalFile().toURL());
                }
                cl = new WeavingClassLoader((URL[]) paths.toArray(new URL[] {}), ClassLoader.getSystemClassLoader()
                        .getParent());
            } catch (IOException e) {
                throw new WrappedRuntimeException(e);
            }
        }
View Full Code Here

Examples of org.codehaus.aspectwerkz.hook.impl.WeavingClassLoader

                ArrayList paths = new ArrayList();
                StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
                while (st.hasMoreTokens()) {
                    paths.add((new File(st.nextToken())).getCanonicalFile().toURL());
                }
                cl = new WeavingClassLoader(
                        (URL[]) paths.toArray(new URL[]{}), ClassLoader.getSystemClassLoader()
                                                            .getParent()
                );
            } catch (IOException e) {
                throw new WrappedRuntimeException(e);
View Full Code Here

Examples of org.codehaus.aspectwerkz.hook.impl.WeavingClassLoader

                ArrayList paths = new ArrayList();
                StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
                while (st.hasMoreTokens()) {
                    paths.add((new File(st.nextToken())).getCanonicalFile().toURL());
                }
                cl = new WeavingClassLoader(
                        (URL[]) paths.toArray(new URL[]{}), ClassLoader
                                                            .getSystemClassLoader().getParent()
                );
            } catch (IOException e) {
                throw new WrappedRuntimeException(e);
View Full Code Here

Examples of org.codehaus.aspectwerkz.hook.impl.WeavingClassLoader

    /**
     * Run with forced weaving thru custom classloader
     * -Daspectwerkz.definition.file=src\test\test-xmldef.xml -Daspectwerkz.transform.verbose=yes -Daspectwerkz.transform.dump=test..*
     */
    public void runThruWeavingClassLoader() throws Exception {
        ClassLoader cl = new WeavingClassLoader(new URL[]{(new File("_temp")).toURL()}, ClassLoader.getSystemClassLoader());
        createClassFiles("_temp", "atest");
        long ms = System.currentTimeMillis();
        callClassesOneByOne(cl, "atest");
        System.out.println("completed in: " + (System.currentTimeMillis() - ms));
        //continueCalls();// uncomment me if needed
View Full Code Here

Examples of org.codehaus.aspectwerkz.hook.impl.WeavingClassLoader

        bench("No weaver hooked in", custom_1, CLASS_COUNT, 0);



        ClassLoader custom_2 = new WeavingClassLoader(

                new URL[]{(new File(DUMP_DIR)).toURL()},

                GenerateClasses.class.getClassLoader()

        );

        bench("Weaver hooked in and match none", custom_2, CLASS_COUNT, 0);



        ClassLoader custom_3 = new WeavingClassLoader(

                new URL[]{(new File(DUMP_DIR)).toURL()},

                GenerateClasses.class.getClassLoader()
View Full Code Here

Examples of org.codehaus.aspectwerkz.hook.impl.WeavingClassLoader

                new URL[]{(new File(DUMP_DIR)).toURL()},
                GenerateClasses.class.getClassLoader()
        );
        bench("No weaver hooked in", custom_1, CLASS_COUNT, 0);

        ClassLoader custom_2 = new WeavingClassLoader(
                new URL[]{(new File(DUMP_DIR)).toURL()},
                GenerateClasses.class.getClassLoader()
        );
        bench("Weaver hooked in and match none", custom_2, CLASS_COUNT, 0);

        ClassLoader custom_3 = new WeavingClassLoader(
                new URL[]{(new File(DUMP_DIR)).toURL()},
                GenerateClasses.class.getClassLoader()
        );
        SystemDefinition sd = SystemDefinitionContainer.getVirtualDefinitionAt(custom_3);
        sd.addDeploymentScope(DeploymentScope.MATCH_ALL);
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.