Package javassist

Examples of javassist.ClassPool.makeInterface()


      // ok, continue
    }

    final Set<CtMethod> used = new HashSet<>();
    ClassPool pool = ClassPool.getDefault();
    CtClass inter = pool.makeInterface(interfaceName);
   
    try {
      CtClass returnType = pool.get(String.class.getName());
      CtClass objectType = pool.get(Object.class.getName());
View Full Code Here


            }

            CtClass originalClass = classPool.get(intf.getName());
            ClassFile originalClassFile = originalClass.getClassFile();

            CtClass newClass = classPool.makeInterface(simplifiedName);

            newClass.defrost();

            ClassFile newClassFile = newClass.getClassFile();
View Full Code Here

   
    private Class<?> defineCustomInterface(ResourceClientProxy proxy) {
        try {
            // define the dynamic class - do not put it in any known rhq package in case our jars are signed (see BZ-794503)
            ClassPool pool = ClassPoolFactory.getClassPool(ResourceClientProxy.class.getClassLoader());
            CtClass customClass = pool.makeInterface("org.rhq.bindings.client.dynamic."
                + ResourceClientProxy.class.getSimpleName() + proxy.fingerprint);

            for (String key : proxy.allProperties.keySet()) {
                Object prop = proxy.allProperties.get(key);
View Full Code Here

            String remoteType = type.getName() + "$Remote";
            try {
                return (Class<T>) Class.forName(remoteType, true, type.getClassLoader());
            } catch (ClassNotFoundException e) {
                ClassPool pool = ClassGenerator.getClassPool(type.getClassLoader());
                CtClass ctClass = pool.makeInterface(remoteType);
                ctClass.addInterface(getCtClass(pool, Remote.class.getName()));
                Method[] methods = type.getMethods();
                for (Method method : methods) {
                    CtClass[] parameters = new CtClass[method.getParameterTypes().length];
                    int i = 0;
View Full Code Here

            String remoteType = type.getName() + "$Remote";
            try {
                return (Class<T>) Class.forName(remoteType, true, type.getClassLoader());
            } catch (ClassNotFoundException e) {
                ClassPool pool = ClassGenerator.getClassPool(type.getClassLoader());
                CtClass ctClass = pool.makeInterface(remoteType);
                // ctClass.addInterface(pool.getCtClass(type.getName()));
                ctClass.addInterface(pool.getCtClass(Remote.class.getName()));
                Method[] methods = type.getMethods();
                for (Method method : methods) {
                    CtClass[] parameters = new CtClass[method.getParameterTypes().length];
View Full Code Here

      // ok, continue
    }

    final Set<CtMethod> used = new HashSet<>();
    ClassPool pool = ClassPool.getDefault();
    CtClass inter = pool.makeInterface(interfaceName);
   
    try {
      CtClass returnType = pool.get(String.class.getName());
      CtClass objectType = pool.get(Object.class.getName());
View Full Code Here

      // ok, continue
    }

    final Set<CtMethod> used = new HashSet<>();
    ClassPool pool = ClassPool.getDefault();
    CtClass inter = pool.makeInterface(interfaceName);
   
    try {
      CtClass returnType = pool.get(String.class.getName());
      CtClass objectType = pool.get(Object.class.getName());
View Full Code Here

      // ok, continue
    }

    final Set<CtMethod> used = new HashSet<>();
    ClassPool pool = ClassPool.getDefault();
    CtClass inter = pool.makeInterface(interfaceName);

    try {
      CtClass returnType = pool.get(String.class.getName());
      CtClass objectType = pool.get(Object.class.getName());
View Full Code Here

    } catch (ClassNotFoundException e1) {
      // ok, continue
    }

    ClassPool pool = ClassPool.getDefault();
    CtClass inter = pool.makeInterface(interfaceName);
    try {
      for(String name : getMethodNames(controller)) {
        CtMethod method = CtNewMethod.make(String.format("abstract String %s(Object[] args);", name), inter);
        method.setModifiers(method.getModifiers() | 128 /* Modifier.VARARGS */);
        inter.addMethod(method);
 
View Full Code Here

      // ok, continue
    }

    final Set<CtMethod> used = new HashSet<>();
    ClassPool pool = ClassPool.getDefault();
    CtClass inter = pool.makeInterface(interfaceName);
   
    try {
      CtClass returnType = pool.get(String.class.getName());
      CtClass objectType = pool.get(Object.class.getName());
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.