Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.AdviceMethodProperties


         {
            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(AdviceSetup setup)
   {
      Method method = ((MethodByMethodInfo)info).getMethod();
      return new AdviceMethodProperties(
               setup.getAspectClass(),
               setup.getAdviceName(),
               info.getClass(),
               INVOCATION_TYPE,
               method.getReturnType(),
View Full Code Here

   }

   protected AdviceMethodProperties getAdviceMethodProperties(AdviceSetup setup)
   {
      Constructor ctor = ((ConstructionInfo)info).getConstructor();
      return new AdviceMethodProperties(
            setup.getAspectClass(),
            setup.getAdviceName(),
            info.getClass(),
            INVOCATION_TYPE,
            ctor.getDeclaringClass(),
View Full Code Here

   }

   protected AdviceMethodProperties getAdviceMethodProperties(AdviceSetup setup)
   {
      Field field = ((FieldInfo)info).getAdvisedField();
      return new AdviceMethodProperties(
               setup.getAspectClass(),
               setup.getAdviceName(),
               info.getClass(),
               (read()) ? READ_INVOCATION_TYPE : WRITE_INVOCATION_TYPE,
               (read()) ? getReturnType() : Void.TYPE,
View Full Code Here

         {
            if (setups[i].isBefore())
            {
               if (beforeAspects == null) beforeAspects = new ArrayList<AdviceSetup>();
              
               AdviceMethodProperties properties = AdviceMethodFactory.BEFORE.findAdviceMethod(getAdviceMethodProperties(setups[i]));
               if (properties != null)
               {
                  setups[i].setAdviceMethodProperties(properties);
                  beforeAspects.add(setups[i]);
                  continue;
               }
            }
            else if (setups[i].isAfter())
            {
               if (afterAspects == null) afterAspects = new ArrayList<AdviceSetup>();
               AdviceMethodProperties properties = AdviceMethodFactory.AFTER.findAdviceMethod(getAdviceMethodProperties(setups[i]));
               if (properties != null)
               {
                  setups[i].setAdviceMethodProperties(properties);
                  afterAspects.add(setups[i]);
                  continue;
               }
            }
            else if (setups[i].isThrowing())
            {
               if (throwingAspects == null) throwingAspects = new ArrayList<AdviceSetup>();
               AdviceMethodProperties properties = AdviceMethodFactory.THROWING.findAdviceMethod(getAdviceMethodProperties(setups[i]));
               if (properties != null)
               {
                  setups[i].setAdviceMethodProperties(properties);
                  throwingAspects.add(setups[i]);
                  continue;
               }
            }
            else
            {
               if (aroundAspects == null) aroundAspects = new ArrayList<AdviceSetup>();
               AdviceMethodProperties properties = AdviceMethodFactory.AROUND.findAdviceMethod(getAdviceMethodProperties(setups[i]));
               if (properties != null)
               {
                  setups[i].setAdviceMethodProperties(properties);
                  aroundAspects.add(setups[i]);
                  continue;
View Full Code Here

     
      private final boolean appendAdviceCall(AdviceSetup setup,
            StringBuffer beforeCall, StringBuffer call,
            boolean isAround, 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();
            call.append("(");
            call.append(ClassExpression.simpleType(adviceParams[0]));
            call.append(")");
            argsFound = appendParameter(beforeCall, call, args[0], adviceParams[0], properties,
                  generator);
View Full Code Here

   }

   protected AdviceMethodProperties getAdviceMethodProperties(AdviceSetup setup)
   {
      Method method = ((MethodByConInfo)info).getMethod();
      return new AdviceMethodProperties(
               setup.getAspectClass(),
               setup.getAdviceName(),
               info.getClass(),
               INVOCATION_TYPE,
               method.getReturnType(),
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.