Package javassist

Examples of javassist.CtClass.defrost()


         {
            CtClass clazz = update.clazz;
            JoinpointStatusUpdate.ClassJoinpoints wrapTargets = update.newlyAdvisedJoinpoints;
            JoinpointStatusUpdate.ClassJoinpoints unwrapTargets = update.newlyUnadvisedJoinpoints;

            clazz.defrost();
            fieldAccessTransformer.wrap(clazz, wrapTargets.fieldReads, wrapTargets.fieldWrites);
            fieldAccessTransformer.unwrap(clazz, unwrapTargets.fieldReads, unwrapTargets.fieldWrites);
            constructorExecutionTransformer.wrap(clazz, wrapTargets.constructorExecutions);
            constructorExecutionTransformer.unwrap(clazz, unwrapTargets.constructorExecutions);
            methodExecutionTransformer.wrap(clazz, wrapTargets.methodExecutions);
View Full Code Here


               if (classes.contains(clazz))
               {
                  continue;
               }
               // check if clazz should be added to classes
               clazz.defrost();
               byte[] previousByteCode = clazz.toBytecode();
               clazz.defrost();
               clazz.instrument(converter);
               if (!java.util.Arrays.equals(clazz.toBytecode(), previousByteCode))
               {
View Full Code Here

                  continue;
               }
               // check if clazz should be added to classes
               clazz.defrost();
               byte[] previousByteCode = clazz.toBytecode();
               clazz.defrost();
               clazz.instrument(converter);
               if (!java.util.Arrays.equals(clazz.toBytecode(), previousByteCode))
               {
                  classes.add(clazz);
               }
View Full Code Here

               clazz.instrument(converter);
               if (!java.util.Arrays.equals(clazz.toBytecode(), previousByteCode))
               {
                  classes.add(clazz);
               }
               clazz.defrost();
            }
         }
         // notifies code conversion observers
         fieldAccessTransformer.codeConverted();
         constructorExecutionTransformer.codeConverted();
View Full Code Here

         // registers the classes bytecodes to be hot swapped
         for (CtClass clazz : classes)
         {
            AOPClassPool classPool = (AOPClassPool) clazz.getClassPool();
            clazz.defrost();
            hotSwapper.registerChange(classPool.getClassLoader().loadClass(clazz.getName()),
                  clazz.toBytecode());
         }
         // performs the hot swap of registered classes
         hotSwapper.hotSwap();
View Full Code Here

             * this behavior.
             */
            if (!name.startsWith(CGLIB_ENHANCER) && !name.startsWith(CGLIB_METHOD_WRAPPER)) {
                final CtClass ctClass = classPool.get(name);
                if (ctClass.isFrozen()) {
                    ctClass.defrost();
                }
                bytes = ctClass.toBytecode();
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here

      try {
        if (!details.isDirectory()) {
          CtClass clazz = loadClassFile(details.getFile());

          if (this.transformation.shouldTransform(clazz)) {
            clazz.defrost();
            this.transformation.applyTransformations(clazz);
            clazz.writeFile(this.destinationDir);
          }
        }
      } catch (Exception e) {
View Full Code Here

        if (transformed) {
          result = cc.toClass();
        }
      }
     
      cc.defrost();
    } catch (Exception ex) {
      throw new ClassNotFoundException("classWork failed on " + className + ": " + ex.getMessage(), ex);
    }

    return result;
View Full Code Here

    *         present
    */
   public static String getInvisibleAnnotationStringValue(Class<?> clazz,
            Class<? extends Annotation> annotation, String name) {
      CtClass ctClass = GwtClassPool.getCtClass(clazz);
      ctClass.defrost();

      AnnotationsAttribute attr = (AnnotationsAttribute) ctClass.getClassFile().getAttribute(
               AnnotationsAttribute.visibleTag);
      if (attr == null) {
         attr = (AnnotationsAttribute) ctClass.getClassFile().getAttribute(
View Full Code Here

    *         present
    */
   public static String getInvisibleAnnotationStringValue(Method method,
            Class<? extends Annotation> annotation, String name) {
      CtClass ctClass = GwtClassPool.getCtClass(method.getDeclaringClass());
      ctClass.defrost();

      AnnotationsAttribute attr = (AnnotationsAttribute) ctClass.getClassFile().getMethod(
               method.getName()).getAttribute(AnnotationsAttribute.visibleTag);
      if (attr == null) {
         attr = (AnnotationsAttribute) ctClass.getClassFile().getMethod(method.getName()).getAttribute(
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.