Package org.jboss.aop.classpool

Examples of org.jboss.aop.classpool.AOPClassPool


/*     */   }
/*     */
/*     */   protected static String createOptimizedInvocationClass(Instrumentor instrumentor, CtClass clazz, CtConstructor con, int index)
/*     */     throws NotFoundException, CannotCompileException
/*     */   {
/*  59 */     AOPClassPool pool = (AOPClassPool)instrumentor.getClassPool();
/*  60 */     CtClass conInvocation = pool.get("org.jboss.aop.joinpoint.ConstructorInvocation");
/*     */
/*  64 */     String className = getOptimizedInvocationClassName(clazz, index);
/*  65 */     boolean makeInnerClass = !Modifier.isPublic(con.getModifiers());
/*  66 */     CtClass invocation = makeInvocationClassNoCtors(pool, makeInnerClass, clazz, className, conInvocation);
/*     */
View Full Code Here


/*     */   }
/*     */
/*     */   protected static String createOptimizedInvocationClass(Instrumentor instrumentor, CtClass clazz, CtMethod method, CtMethod notAdvisedMethod)
/*     */     throws NotFoundException, CannotCompileException
/*     */   {
/*  70 */     AOPClassPool pool = (AOPClassPool)instrumentor.getClassPool();
/*  71 */     CtClass methodInvocation = pool.get("org.jboss.aop.joinpoint.MethodInvocation");
/*     */
/*  75 */     String className = getOptimizedInvocationClassName(clazz, method);
/*  76 */     boolean makeInnerClass = true;
/*  77 */     CtClass invocation = makeInvocationClass(pool, makeInnerClass, clazz, className, methodInvocation);
/*     */
View Full Code Here

/*     */   }
/*     */
/*     */   private static String createOptimizedMethodCalledInvocationClass(Instrumentor instrumentor, String className, CtClass callingClass, CtMethod method, String invocationClassName, String callerDescription)
/*     */     throws NotFoundException, CannotCompileException
/*     */   {
/* 109 */     AOPClassPool pool = (AOPClassPool)instrumentor.getClassPool();
/* 110 */     CtClass methodInvocation = pool.get(invocationClassName);
/*     */
/* 114 */     CtClass invocation = makeInvocationClass(pool, Modifier.isPrivate(method.getModifiers()), callingClass, className, methodInvocation);
/*     */
/* 120 */     CtClass[] params = method.getParameterTypes();
/* 121 */     addArgumentFieldsAndAccessors(pool, invocation, params, false);
View Full Code Here

/*     */   }
/*     */
/*     */   private static String createOptimizedConCalledInvocationClass(Instrumentor instrumentor, String className, CtClass callingClass, CtConstructor con, String invocationClassName, String callerDescription)
/*     */     throws NotFoundException, CannotCompileException
/*     */   {
/* 160 */     AOPClassPool pool = (AOPClassPool)instrumentor.getClassPool();
/* 161 */     CtClass conInvocation = pool.get(invocationClassName);
/*     */
/* 165 */     CtClass invocation = makeInvocationClass(pool, Modifier.isPrivate(con.getModifiers()), callingClass, className, conInvocation);
/*     */
/* 171 */     CtClass[] params = con.getParameterTypes();
/* 172 */     addArgumentFieldsAndAccessors(pool, invocation, params, false);
View Full Code Here

/*     */   }
/*     */
/*     */   protected static String createOptimizedInvocationClass(Instrumentor instrumentor, CtClass clazz, CtField field, boolean get)
/*     */     throws Exception
/*     */   {
/* 111 */     AOPClassPool pool = (AOPClassPool)instrumentor.getClassPool();
/* 112 */     CtClass fieldInvocation = get ? pool.get("org.jboss.aop.joinpoint.FieldReadInvocation") : pool.get("org.jboss.aop.joinpoint.FieldWriteInvocation");
/*     */
/* 117 */     String className = getOptimizedInvocationClassName(clazz, field, get);
/* 118 */     boolean makeInnerClass = true;
/*     */     try
/*     */     {
/* 124 */       CtClass existing = pool.get(className);
/* 125 */       if (existing.isFrozen())
/*     */       {
/* 127 */         existing.defrost();
/*     */       }
/*     */
View Full Code Here

/*     */   {
/* 162 */     for (Iterator iterator = methodInfos.iterator(); iterator.hasNext(); )
/*     */     {
/* 164 */       org.jboss.aop.MethodInfo methodInfo = (org.jboss.aop.MethodInfo)iterator.next();
/* 165 */       Method method = methodInfo.getMethod();
/* 166 */       AOPClassPool classPool = (AOPClassPool)clazz.getClassPool();
/* 167 */       Class[] parameterTypes = method.getParameterTypes();
/* 168 */       CtClass[] javassistParameterTypes = new CtClass[parameterTypes.length];
/* 169 */       for (int i = 0; i < parameterTypes.length; i++)
/*     */       {
/* 171 */         classPool.getLocally(parameterTypes[i].getName());
/*     */       }
/* 173 */       if (method.getName().indexOf("access$") >= 0)
/*     */       {
/*     */         continue;
/*     */       }
View Full Code Here

/*     */   {
/* 209 */     for (Iterator iterator = methodInfos.iterator(); iterator.hasNext(); )
/*     */     {
/* 211 */       org.jboss.aop.MethodInfo methodInfo = (org.jboss.aop.MethodInfo)iterator.next();
/* 212 */       Method method = methodInfo.getMethod();
/* 213 */       AOPClassPool classPool = (AOPClassPool)clazz.getClassPool();
/* 214 */       Class[] parameterTypes = method.getParameterTypes();
/* 215 */       CtClass[] javassistParameterTypes = new CtClass[parameterTypes.length];
/* 216 */       for (int i = 0; i < parameterTypes.length; i++)
/*     */       {
/* 218 */         classPool.getLocally(parameterTypes[i].getName());
/*     */       }
/* 220 */       CtMethod javassistWMethod = clazz.getDeclaredMethod(method.getName(), javassistParameterTypes);
/* 221 */       if (wrapper.isNotPrepared(javassistWMethod, 0))
/*     */       {
/*     */         continue;
View Full Code Here

/*     */   }
/*     */
/*     */   protected CtMethod buildReadWrapperPlaceHolder(CtClass clazz, CtField field, String wrapperName, int mod)
/*     */     throws NotFoundException, CannotCompileException
/*     */   {
/* 512 */     AOPClassPool classPool = (AOPClassPool)this.instrumentor.getClassPool();
/*     */
/* 514 */     String name = field.getName();
/* 515 */     CtClass ftype = field.getType();
/* 516 */     CtClass[] readParam = { classPool.get("java.lang.Object") };
/*     */
/* 520 */     String code = "{" + ftype.getName() + " var = ";
/* 521 */     if (ftype.isPrimitive())
/*     */     {
/* 523 */       if (ftype == CtClass.booleanType)
View Full Code Here

/*     */   }
/*     */
/*     */   protected CtMethod buildWriteWrapperPlaceHolder(CtClass clazz, CtField field, String wrapperName, int mod)
/*     */     throws NotFoundException, CannotCompileException
/*     */   {
/* 579 */     AOPClassPool classPool = (AOPClassPool)this.instrumentor.getClassPool();
/*     */
/* 581 */     String name = field.getName();
/* 582 */     CtClass ftype = field.getType();
/*     */
/* 585 */     CtClass[] writeParam = new CtClass[2];
/* 586 */     writeParam[0] = classPool.get("java.lang.Object");
/* 587 */     writeParam[1] = ftype;
/*     */
/* 592 */     CtMethod wmethod = CtNewMethod.make(CtClass.voidType, wrapperName, writeParam, null, "{}", clazz);
/* 593 */     wmethod.setModifiers(mod);
/* 594 */     clazz.addMethod(wmethod);
View Full Code Here

/*  61 */       if (manager.isNonAdvisableClassName(className))
/*     */       {
/*  63 */         Object localObject1 = null;
/*     */         return localObject1;
/*     */       }
/*  66 */       AOPClassPool pool = (AOPClassPool)manager.registerClassLoader(loader);
/*     */
/*  68 */       CtClass clazz = obtainCtClassInfo(pool, className, classfileBuffer);
/*     */
/*  70 */       CtClass woven = instrumentClass(manager, pool, clazz, true);
/*  71 */       if (woven != null)
/*     */       {
/*  73 */         pool.lockInCache(woven);
/*  74 */         if (AspectManager.debugClasses)
/*     */         {
/*  76 */           SecurityActions.debugWriteFile(clazz);
/*     */         }
/*  78 */         rtn = woven.toBytecode();
/*  79 */         if (AspectManager.getPrune()) woven.prune();
/*  80 */         byte[] arrayOfByte1 = rtn;
/*     */         return arrayOfByte1;
/*     */       }
/*  84 */       pool.soften(clazz);
/*     */
/*  86 */       byte[] rtn = null;
/*     */       return rtn;
/*     */     }
/*     */     catch (Exception ex)
View Full Code Here

TOP

Related Classes of org.jboss.aop.classpool.AOPClassPool

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.