Package javassist

Examples of javassist.ClassPool.appendClassPath()


                                              BindingSource source,
                                              Runnable phaseTwoTraining) throws Exception
    {
        ClassPool pool = new ClassPool();
        ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
        pool.appendClassPath(new LoaderClassPath(contextLoader));

        Loader loader = new Loader(contextLoader, pool);

        loader.delegateLoadingOf("org.apache.tapestry.");
View Full Code Here


        String componentClassName = StateHolder.class.getName();
        Class asoClass = ReadOnlyBean.class;

        ClassPool pool = new ClassPool();
        ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
        pool.appendClassPath(new LoaderClassPath(contextLoader));

        Loader loader = new Loader(contextLoader, pool);

        loader.delegateLoadingOf("org.apache.tapestry.");
View Full Code Here

    }
   
    public static ClassPool newClassPool() {
        ClassPool classPool = new ClassPool();
        classPool.appendSystemPath();
        classPool.appendClassPath(new LoaderClassPath(Enhancer.class.getClassLoader()));
        classPool.appendClassPath(new ApplicationClassesClasspath());
        return classPool;
    }

    /**
 
View Full Code Here

   
    public static ClassPool newClassPool() {
        ClassPool classPool = new ClassPool();
        classPool.appendSystemPath();
        classPool.appendClassPath(new LoaderClassPath(Enhancer.class.getClassLoader()));
        classPool.appendClassPath(new ApplicationClassesClasspath());
        return classPool;
    }

    /**
     * Construct a javassist CtClass from an application class.
View Full Code Here

    ClassPool pool = POOL_MAP.get(loader);
    if( pool == null )
    {
      pool = new ClassPool(true);
      pool.appendClassPath(new LoaderClassPath(loader));
      POOL_MAP.put(loader, pool);
    }
    return pool;
  }
View Full Code Here

      catch (ClassNotFoundException e) {
         // OK, it is not present, we have to generate a shim
         LOGGER.debug("com.codahale.metrics.MetricRegistry not found, generating stub");

         ClassPool classPool = new ClassPool();
         classPool.appendClassPath(new LoaderClassPath(this.getClass().getClassLoader()));

         try {
            CtClass targetCt = classPool.makeClass("com.codahale.metrics.MetricRegistry");
            targetCt.setModifiers(Modifier.PUBLIC | Modifier.FINAL);
View Full Code Here

      Class wrapperType;
      try
      {
         ClassPool pool = new ClassPool(true);
         pool.appendClassPath(new LoaderClassPath(loader));
         CtClass clazz = pool.makeClass(wrapperName);
         clazz.setSuperclass(pool.get(WrapperType.class.getName()));

         for (WrappedParameter param : wrappedParameters)
         {
View Full Code Here

        // other instance is hotswapped
        Foo bFoo = new Foo();
        bFoo.sayHello();

        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");
View Full Code Here

     */
    public static CtClass fromByte(final String name, final byte[] bytecode, final ClassLoader loader) {
        try {
            ClassPool cp = new ClassPool(null);
            cp.insertClassPath(new ByteArrayClassPath(name, bytecode));
            cp.appendClassPath(new LoaderClassPath(loader));
            return cp.get(name);
        }
        catch (Exception e) {
            throw new WrappedRuntimeException(e);
        }
View Full Code Here

      Class wrapperType;
      try
      {
         ClassPool pool = new ClassPool(true);
         pool.appendClassPath(new LoaderClassPath(loader));
         CtClass clazz = pool.makeClass(wrapperName);
         clazz.setSuperclass(pool.get(WrapperType.class.getName()));

         for (WrappedParameter param : wrappedParameters)
         {
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.