Package org.jboss.aop.joinpoint

Examples of org.jboss.aop.joinpoint.MethodJoinpoint


   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
   {
      if (jp instanceof MethodJoinpoint == false)
         throw new IllegalArgumentException("Joinpoint is not a method: " + jp);
      MethodJoinpoint methodJoinpoint = MethodJoinpoint.class.cast(jp);
      Method method = methodJoinpoint.getMethod();
      Remove rm = (Remove) advisor.resolveAnnotation(method, Remove.class);
      if (rm == null)
      {
         log.warn("Cannot find @" + Remove.class.getName() + " for " + method + " assuming defaults");
         rm = new RemoveImpl();
View Full Code Here


               if (AspectManager.verbose)
               {
                  System.err.println("method matched binding " + binding.getPointcut().getExpr() + " " + method.toString());    
               }
               binding.addAdvisor(this);
               pointcutResolved(info, binding, new MethodJoinpoint(method));
            }
         }
      }     
   }
View Full Code Here

      throw new IllegalStateException("THIS SCOPE NOT USABLE");
   }

   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
   {
      MethodJoinpoint mj = (MethodJoinpoint)jp;
      MutexLocked props = (MutexLocked)advisor.resolveAnnotation(mj.getMethod(), MutexLocked.class);
      if (props.timeout() < 0)
      {
         return new MutexAspect.BlockingMutex();
      }
      else if (props.timeout() == 0)
View Full Code Here

   private Joinpoint getJoinpoint(Invocation invocation)
   {
      if (invocation instanceof MethodInvocation)
      {
         return new MethodJoinpoint(((MethodInvocation)invocation).getMethod());
      }
      if (invocation instanceof FieldInvocation)
      {
         return new FieldJoinpoint(((FieldInvocation)invocation).getField());
      }
View Full Code Here

{
   public static Interceptor createInterceptor(Advisor advisor, Joinpoint joinpoint, AspectDefinition def) throws Exception
   {
      if (joinpoint instanceof MethodJoinpoint)
      {
         MethodJoinpoint method = (MethodJoinpoint) joinpoint;
         if (Modifier.isStatic(method.getMethod().getModifiers()))
         {
            return (Interceptor) def.getFactory().createPerJoinpoint(advisor, joinpoint);
         }
      }
      else if (joinpoint instanceof ConstructorJoinpoint)
      {
         return (Interceptor) def.getFactory().createPerJoinpoint(advisor, joinpoint);
      }
      else if (joinpoint instanceof MethodCalledByMethodJoinpoint)
      {
         MethodCalledByMethodJoinpoint method = (MethodCalledByMethodJoinpoint) joinpoint;
         if (Modifier.isStatic(method.getCalling().getModifiers()))
         {
            return (Interceptor) def.getFactory().createPerJoinpoint(advisor, joinpoint);
         }
      }
      else if (joinpoint instanceof ConstructorCalledByMethodJoinpoint)
      {
         ConstructorCalledByMethodJoinpoint method = (ConstructorCalledByMethodJoinpoint) joinpoint;
         if (Modifier.isStatic(method.getCalling().getModifiers()))
         {
            return (Interceptor) def.getFactory().createPerJoinpoint(advisor, joinpoint);
         }
      }
      else if (joinpoint instanceof FieldJoinpoint)
View Full Code Here

{
   public static Interceptor createInterceptor(Advisor advisor, Joinpoint joinpoint, AspectDefinition def, String adviceName) throws Exception
   {
      if (joinpoint instanceof MethodJoinpoint)
      {
         MethodJoinpoint method = (MethodJoinpoint) joinpoint;
         if (Modifier.isStatic(method.getMethod().getModifiers()))
         {
            return PerVmAdvice.generateInterceptor(joinpoint, def.getFactory().createPerJoinpoint(advisor, joinpoint), adviceName);
         }
      }
      else if (joinpoint instanceof ConstructorJoinpoint)
      {
         return PerVmAdvice.generateInterceptor(joinpoint, def.getFactory().createPerJoinpoint(advisor, joinpoint), adviceName);
      }
      else if (joinpoint instanceof MethodCalledByMethodJoinpoint)
      {
         MethodCalledByMethodJoinpoint method = (MethodCalledByMethodJoinpoint) joinpoint;
         if (Modifier.isStatic(method.getCalling().getModifiers()))
         {
            return PerVmAdvice.generateInterceptor(joinpoint, def.getFactory().createPerJoinpoint(advisor, joinpoint), adviceName);
         }
      }
      else if (joinpoint instanceof ConstructorCalledByMethodJoinpoint)
      {
         ConstructorCalledByMethodJoinpoint method = (ConstructorCalledByMethodJoinpoint) joinpoint;
         if (Modifier.isStatic(method.getCalling().getModifiers()))
         {
            return PerVmAdvice.generateInterceptor(joinpoint, def.getFactory().createPerJoinpoint(advisor, joinpoint), adviceName);
         }
      }
      else if (joinpoint instanceof FieldJoinpoint)
View Full Code Here

               if (AspectManager.verbose)
               {
                  System.err.println("method matched binding " + binding.getPointcut().getExpr() + " " + method.toString());    
               }
               binding.addAdvisor(this);
               pointcutResolved(info, binding, new MethodJoinpoint(method));
            }
         }
      }     
   }
View Full Code Here

               if (AspectManager.verbose)
               {
                  System.err.println("method matched binding " + binding.getPointcut().getExpr() + " " + method.toString());    
               }
               binding.addAdvisor(this);
               pointcutResolved(info, binding, new MethodJoinpoint(method));
            }
         }
      }     
   }
View Full Code Here

   private Joinpoint getJoinpoint(Invocation invocation)
   {
      if (invocation instanceof MethodInvocation)
      {
         return new MethodJoinpoint(((MethodInvocation)invocation).getMethod());
      }
      if (invocation instanceof FieldInvocation)
      {
         return new FieldJoinpoint(((FieldInvocation)invocation).getField());
      }
View Full Code Here

  
   private void applyBinding(ArrayList<AdviceBinding> applicableBindings, AdviceBinding binding)
   {
      applicableBindings.add(binding);
      binding.addAdvisor(advisor);
      advisor.pointcutResolved(info, binding, new MethodJoinpoint(info.getMethod()));
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.joinpoint.MethodJoinpoint

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.