Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.AdviceMethodProperties


           StringBuffer beforeCall, StringBuffer call, JoinPointGenerator generator, JoinPointInfo info) throws NotFoundException;
     
      private final boolean appendAdviceCall(AdviceSetup setup,
            StringBuffer beforeCall, StringBuffer call, JoinPointGenerator generator)
      {
         AdviceMethodProperties properties = setup.getAdviceMethodProperties();
         if (properties == null)
         {
            return false;
         }
         call.append(setup.getAspectFieldName());
         call.append(".");
         call.append(setup.getAdviceName());
         call.append("(");

         final int[] args = properties.getArgs();
         boolean argsFound = false;
         if (args.length > 0)
         {
            final Class<?>[] adviceParams = properties.getAdviceMethod().getParameterTypes();
            if (properties.isAdviceOverloaded())
            {
               appendCast(call, adviceParams[0]);
            }
            argsFound = appendParameter(beforeCall, call, args[0], adviceParams[0], properties,
                  generator);
            for (int i = 1 ; i < args.length ; i++)
            {
               call.append(", ");
               if (properties.isAdviceOverloaded())
               {
                  appendCast(call, adviceParams[i]);
               }
               argsFound = appendParameter(beforeCall, call, args[i], adviceParams[i],
                     properties, generator) || argsFound;
View Full Code Here


      public boolean appendAdviceCall(AdviceSetup setup, String key,
            StringBuffer beforeCall, StringBuffer call, JoinPointGenerator generator, JoinPointInfo info)
      {
         boolean result = false;
        
         AdviceMethodProperties properties = setup.getAdviceMethodProperties();
         if (properties == null || properties.getAdviceMethod() == null)
         {
            // throw new RuntimeException("DEBUG ONLY Properties was null " +
            // aroundSetups[i].getAspectClass().getName() + "." + aroundSetups[i].getAdviceName());
            return false;
         }
View Full Code Here

      }

      public boolean appendAdviceCall(AdviceSetup setup, String key,
            StringBuffer beforeCall, StringBuffer call, JoinPointGenerator generator, JoinPointInfo info) throws NotFoundException
      {
         AdviceMethodProperties properties = setup.getAdviceMethodProperties();
         if (properties != null && !properties.isAdviceVoid())
         {
            call.append(key);
         }
         return super.appendAdviceCall(setup, beforeCall, call, generator);
      }
View Full Code Here

         {
            if (!allSetups[i].shouldInvokeAspect())
            {
               continue;
            }
            AdviceMethodProperties properties = getAdviceMethodProperties(info, allSetups[i]);
            AdviceType type = allSetups[i].getType();
            int index = type.ordinal();
            if (aspects[index] == null)
            {
               aspects[index] = new ArrayList<AdviceSetup>();
View Full Code Here

           StringBuffer beforeCall, StringBuffer call, JoinPointGenerator generator, JoinPointInfo info) throws NotFoundException;
     
      private final boolean appendAdviceCall(AdviceSetup setup,
            StringBuffer beforeCall, StringBuffer call, JoinPointGenerator generator)
      {
         AdviceMethodProperties properties = setup.getAdviceMethodProperties();
         if (properties == null)
         {
            return false;
         }
         call.append(setup.getAspectFieldName());
         call.append(".");
         call.append(setup.getAdviceName());
         call.append("(");

         final int[] args = properties.getArgs();
         boolean argsFound = false;
         if (args.length > 0)
         {
            final Class[] adviceParams = properties.getAdviceMethod().getParameterTypes();
            if (properties.isAdviceOverloaded())
            {
               appendCast(call, adviceParams[0]);
            }
            argsFound = appendParameter(beforeCall, call, args[0], adviceParams[0], properties,
                  generator);
            for (int i = 1 ; i < args.length ; i++)
            {
               call.append(", ");
               if (properties.isAdviceOverloaded())
               {
                  appendCast(call, adviceParams[i]);
               }
               argsFound = appendParameter(beforeCall, call, args[i], adviceParams[i],
                     properties, generator) || argsFound;
View Full Code Here

            return false;
         }
     
         boolean result = false;
        
         AdviceMethodProperties properties = setup.getAdviceMethodProperties();
         if (properties == null || properties.getAdviceMethod() == null)
         {
            // throw new RuntimeException("DEBUG ONLY Properties was null " +
            // aroundSetups[i].getAspectClass().getName() + "." + aroundSetups[i].getAdviceName());
            return false;
         }
View Full Code Here

      }

      public boolean appendAdviceCall(AdviceSetup setup, String key,
            StringBuffer beforeCall, StringBuffer call, JoinPointGenerator generator, JoinPointInfo info) throws NotFoundException
      {
         AdviceMethodProperties properties = setup.getAdviceMethodProperties();
         if (properties != null && !properties.isAdviceVoid())
         {
            call.append(key);
         }
         return super.appendAdviceCall(setup, beforeCall, call, generator);
      }
View Full Code Here

/*     */
/*     */   protected AdviceMethodProperties getAdviceMethodProperties(JoinPointBean joinPoint, JoinPointGenerator.AdviceSetup setup)
/*     */   {
/* 149 */     FieldAccess fieldAccess = (FieldAccess)joinPoint;
/* 150 */     Field field = fieldAccess.getField();
/* 151 */     return new AdviceMethodProperties(joinPoint, setup.getAspectClass(), setup.getAdviceName(), JOINPOINT_TYPE, fieldAccess.isRead() ? READ_INVOCATION_TYPE : WRITE_INVOCATION_TYPE, fieldAccess.isRead() ? field.getGenericType() : Void.TYPE, new Type[] { fieldAccess.isRead() ? new Type[0] : field.getGenericType() }, new Class[] { fieldAccess.isRead() ? new Class[0] : field.getType() }, null, field.getDeclaringClass(), hasTargetObject());
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   protected AdviceMethodProperties getAdviceMethodProperties(JoinPointBean joinPoint, JoinPointGenerator.AdviceSetup setup)
/*     */   {
/* 144 */     Method method = ((MethodCallByMethod)joinPoint).getMethod();
/* 145 */     return new AdviceMethodProperties(joinPoint, setup.getAspectClass(), setup.getAdviceName(), JOINPOINT_TYPE, INVOCATION_TYPE, method.getGenericReturnType(), method.getGenericParameterTypes(), method.getParameterTypes(), method.getGenericExceptionTypes(), method.getDeclaringClass(), hasTargetObject(), ((MethodCallByMethod)joinPoint).getCallingClass(), hasCallingObject());
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   protected AdviceMethodProperties getAdviceMethodProperties(JoinPointBean joinPoint, JoinPointGenerator.AdviceSetup setup)
/*     */   {
/* 114 */     Constructor ctor = ((Construction)joinPoint).getConstructor();
/* 115 */     return new AdviceMethodProperties(joinPoint, setup.getAspectClass(), setup.getAdviceName(), JOINPOINT_TYPE, INVOCATION_TYPE, ctor.getDeclaringClass(), ctor.getGenericParameterTypes(), ctor.getParameterTypes(), ctor.getGenericExceptionTypes(), ctor.getDeclaringClass(), true);
/*     */   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.advice.AdviceMethodProperties

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.