Package javassist

Examples of javassist.CtClass.instrument()


            final CtClass ctClass = klass.getCtClass();
            ClassInfo classInfo = JavassistClassInfo.getClassInfo(ctClass, context.getLoader());
            if (classFilter(definition, new ExpressionContext(PointcutType.CALL, classInfo, classInfo), ctClass)) {
                continue;
            }
            ctClass.instrument(new ExprEditor() {
                public void edit(MethodCall methodCall) throws CannotCompileException {
                    try {
                        CtBehavior where;
                        try {
                            where = methodCall.where();
View Full Code Here


            final ClassInfo classInfo = JavassistClassInfo.getClassInfo(ctClass, context.getLoader());
            if (classFilter(ctClass, new ExpressionContext(PointcutType.SET, classInfo, classInfo), definition)
                && classFilter(ctClass, new ExpressionContext(PointcutType.GET, classInfo, classInfo), definition)) {
                continue;
            }
            ctClass.instrument(new ExprEditor() {
                public void edit(FieldAccess fieldAccess) throws CannotCompileException {
                    try {
                        CtBehavior where = null;
                        try {
                            where = fieldAccess.where();
View Full Code Here

        for (CtClass nc : nestedClasses)
        {
            add(nc.getName());
        }

        ctClass.instrument(new ExprEditor()
        {
            public void edit(ConstructorCall c) throws CannotCompileException
            {
                if (c.getMethodName().equals("this"))
                    return;
View Full Code Here

   */
  public void onLoad(ClassPool pool, String classname) throws NotFoundException, CannotCompileException {
    logger.trace("onLoad called for class " + classname);
    CtClass clas = pool.get(classname);
    if (existEditorForClass(classname))
      clas.instrument(getEditorForClass(classname));   
    if (existConverterForClass(classname))
      clas.instrument(getConverterForClass(classname));
//    if (classname.equals("it.unina.seclab.jafimon.test.DummyTest")) {
//      clas.instrument(new CustomEditor());
//    }
View Full Code Here

    logger.trace("onLoad called for class " + classname);
    CtClass clas = pool.get(classname);
    if (existEditorForClass(classname))
      clas.instrument(getEditorForClass(classname));   
    if (existConverterForClass(classname))
      clas.instrument(getConverterForClass(classname));
//    if (classname.equals("it.unina.seclab.jafimon.test.DummyTest")) {
//      clas.instrument(new CustomEditor());
//    }
  }
View Full Code Here

      // to the JVM
      //
      if (initialized) {
        if (theTranslator.existConverterForClass(className)) {
          log.info("Instrumenting " + className + " with Converter");
          ctc.instrument(theTranslator.getConverterForClass(className));
        }
        if (theTranslator.existEditorForClass(className)) {
          log.info("Instrumenting " + className + " with Editor");
          ctc.instrument(theTranslator.getEditorForClass(className));
        }
View Full Code Here

          log.info("Instrumenting " + className + " with Converter");
          ctc.instrument(theTranslator.getConverterForClass(className));
        }
        if (theTranslator.existEditorForClass(className)) {
          log.info("Instrumenting " + className + " with Editor");
          ctc.instrument(theTranslator.getEditorForClass(className));
        }
      }
     
      byte[] b = ctc.toBytecode();
      Class c = defineClass(className, b, 0, b.length);
View Full Code Here

            // filter caller classes
            if (classFilter(definition, classMetaData, ctClass)) {
                return;
            }

            ctClass.instrument(
                    new ExprEditor() {
                        public void edit(FieldAccess fieldAccess) throws CannotCompileException {
                            try {
                                CtBehavior where = null;
                                try {
View Full Code Here

            if (classFilter(definition, classMetaData, ctClass)) {
                return;
            }

            ctClass.instrument(
                    new ExprEditor() {
                        public void edit(Handler handlerExpr) throws CannotCompileException {
                            try {
                                CtClass exceptionClass = null;
                                try {
View Full Code Here

            // filter not RuW ready classes
            if (classFilter(definition, classMetaData, ctClass)) {
                return;
            }

            ctClass.instrument(
                    new ExprEditor() {
                        public void edit(MethodCall methodCall) throws CannotCompileException {
                            try {
                                CtBehavior where = null;
                                try {
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.