Package co.cask.cdap.internal.asm

Examples of co.cask.cdap.internal.asm.ByteCodeClassLoader


    @Override
    public Class<DatumWriter<?>> load(CacheKey key) throws Exception {
      ClassDefinition classDef = new DatumWriterGenerator().generate(key.getType(), key.getSchema());

      ClassLoader typeClassloader = ClassLoaders.getClassLoader(key.getType());
      ByteCodeClassLoader classloader = classloaders.get(key.getType());
      if (classloader == null) {
        classloader = new ByteCodeClassLoader(typeClassloader);
        classloaders.put(key.getType(), classloader);
      }

      return (Class<DatumWriter<?>>) classloader.addClass(classDef, key.getType().getRawType())
                                                .loadClass(classDef.getClassName());
    }
View Full Code Here


      public Class<?> load(TypeToken<? extends HttpServiceHandler> key) throws Exception {
        // Generate the new class if it hasn't before and load it through a ByteCodeClassLoader.
        ClassDefinition classDefinition = new HttpHandlerGenerator().generate(key, pathPrefix);

        ClassLoader typeClassLoader = ClassLoaders.getClassLoader(key);
        ByteCodeClassLoader classLoader = new ByteCodeClassLoader(typeClassLoader);
        classLoader.addClass(classDefinition, key.getRawType());
        return classLoader.loadClass(classDefinition.getClassName());
      }
    });
  }
View Full Code Here

TOP

Related Classes of co.cask.cdap.internal.asm.ByteCodeClassLoader

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.