Examples of MethodJoinPoint


Examples of org.codehaus.aspectwerkz.joinpoint.MethodJoinPoint

         * @Around interceptServlet
         */
        public Object catchGetRequestParameters(JoinPoint joinPoint)
            throws Throwable
        {
            MethodJoinPoint jp = (MethodJoinPoint) joinPoint;
            SampleServlet servlet = (SampleServlet) jp.getTargetInstance();
            Hashtable params = servlet.getRequestParameters(
                (HttpServletRequest) jp.getParameters()[0]);
            assertNotNull(params.get("param1"));
            assertNotNull(params.get("param2"));
            assertEquals("value1", params.get("param1"));
            assertEquals("value2", params.get("param2"));
            return null;
View Full Code Here

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

Examples of org.jboss.aop.joinpoint.MethodJoinpoint

               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

Examples of org.jboss.aop.joinpoint.MethodJoinpoint

      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

Examples of org.jboss.aop.joinpoint.MethodJoinpoint

   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

Examples of org.jboss.aop.joinpoint.MethodJoinpoint

{
   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

Examples of org.jboss.aop.joinpoint.MethodJoinpoint

{
   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

Examples of org.jboss.aop.joinpoint.MethodJoinpoint

               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

Examples of org.jboss.aop.joinpoint.MethodJoinpoint

               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

Examples of org.jboss.aop.joinpoint.MethodJoinpoint

   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
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.