Package javassist

Examples of javassist.LoaderClassPath


            NotFoundException, IOException
    {
        ClassPool pool = new ClassPool();
        // Inside Maven Surefire, the system classpath is not sufficient to find all
        // the necessary files.
        pool.appendClassPath(new LoaderClassPath(_extraLoader));

        CtClass ctClass = pool.makeClass(SYNTH_COMPONENT_CLASSNAME);

        ctClass.setSuperclass(pool.get(BasicComponent.class.getName()));
View Full Code Here


  private final CtClass compiledClass;

  public ClassFile( @Nonnull final File classFile, @Nonnull ClassLoader classLoader ) throws IOException {
    this.classFile = classFile;
    final ClassPool cp = ClassPool.getDefault();
    cp.appendClassPath( new LoaderClassPath( classLoader ) );

    final InputStream ins = new BufferedInputStream( new FileInputStream( classFile ) );
    try {
      compiledClass = cp.makeClass( ins );
    } finally {
View Full Code Here

  }

  @Nonnull
  private static CtClass getCtClass( @Nonnull final ClassLoader loader, @Nonnull String className ) throws NotFoundException {
    final ClassPool pool = new ClassPool(true);
    pool.appendClassPath(new LoaderClassPath(loader));

    return pool.get(className);
  }
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

     */
    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

        ClassLoader threadDeadlockBuffer = new URLClassLoader(new URL[0], baseClassLoader);

        Loader loader = new InternalLoader(threadDeadlockBuffer, pool);

        ClassPath path = new LoaderClassPath(loader);

        pool.appendClassPath(path);

        classesToLoad.clear();
        add(implementationClassName);
View Full Code Here

        loader = new TestPackageAwareLoader(contextClassLoader, classFactoryClassPool);

        // Inside Maven Surefire, the system classpath is not sufficient to find all
        // the necessary files.
        classFactoryClassPool.appendClassPath(new LoaderClassPath(loader));

        Logger logger = LoggerFactory.getLogger(InternalClassTransformationImplTest.class);

        classFactory = new ClassFactoryImpl(loader, classFactoryClassPool, logger);
    }
View Full Code Here

        loader = new TestPackageAwareLoader(threadDeadlockBuffer, classFactoryClassPool);

        // Inside Maven Surefire, the system classpath is not sufficient to find all
        // the necessary files.
        classFactoryClassPool.appendClassPath(new LoaderClassPath(loader));

        Logger logger = LoggerFactory.getLogger(InternalClassTransformationImplTest.class);

        classFactory = new ClassFactoryImpl(loader, classFactoryClassPool, logger);
View Full Code Here

    private void createSynthComponentClass(String name) throws CannotCompileException, NotFoundException, IOException
    {
        ClassPool pool = new ClassPool();
        // Inside Maven Surefire, the system classpath is not sufficient to find all
        // the necessary files.
        pool.appendClassPath(new LoaderClassPath(extraLoader));

        CtClass ctClass = pool.makeClass(SYNTH_COMPONENT_CLASSNAME);

        ctClass.setSuperclass(pool.get(BasicComponent.class.getName()));
View Full Code Here

        if (_loaders.contains(loader))
            return;

        _loader.addDelegateLoader(loader);

        ClassPath path = new LoaderClassPath(loader);

        appendClassPath(path);

        _loaders.add(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.