Package javassist

Examples of javassist.LoaderClassPath


                                              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

   *
   * @param loader
   */
  private void loadClassInClassloader(ClassLoader loader) {
    if (!classLoaders.containsKey(loader)) {
      classPool.insertClassPath(new LoaderClassPath(loader));
      classLoaders.put(loader, loader);
    }
  }
View Full Code Here

        if (loader == null || loader == _loader || _loaders.contains(loader))
            return;

        _loader.addDelegateLoader(loader);

        ClassPath path = new LoaderClassPath(loader);

        appendClassPath(path);

        _loaders.add(loader);
    }
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

    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

   private JavassistProxyFactory() throws Exception
   {
      classPool = new ClassPool();
      classPool.importPackage("java.sql");
      classPool.appendClassPath(new LoaderClassPath(this.getClass().getClassLoader()));

      // Connection is special, it has a checkClosed() call at the beginning
      String methodBody = "{ checkClosed(); try { return delegate.method($$); } catch (SQLException e) { throw checkException(e); } }";
      generateProxyClass(Connection.class, ConnectionProxy.class, methodBody);
View Full Code Here

   private JavassistProxyFactory() throws Exception
   {
      classPool = new ClassPool();
      classPool.importPackage("java.sql");
      classPool.appendClassPath(new LoaderClassPath(this.getClass().getClassLoader()));

      // Connection is special, it has a checkClosed() call at the beginning
      String methodBody = "{ checkClosed(); try { return delegate.method($$); } catch (SQLException e) { throw checkException(e); } }";
      generateProxyClass(Connection.class, ConnectionProxy.class, methodBody);
View Full Code Here

   }

   private void init(ClassLoader loader)
   {
      pool = new ClassPool(true);
      pool.appendClassPath(new LoaderClassPath(loader));
   }
View Full Code Here

TOP

Related Classes of javassist.LoaderClassPath

Copyright © 2018 www.massapicom. 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.