Examples of MethodMatcher


Examples of org.apache.hivemind.methodmatch.MethodMatcher

        methodFab.addCatch(RuntimeException.class, body);
    }

    protected void addServiceMethods(InterceptorStack stack, ClassFab fab, List parameters)
    {
        MethodMatcher matcher = buildMethodMatcher(parameters);

        MethodIterator mi = new MethodIterator(stack.getServiceInterface());

        while (mi.hasNext())
        {
View Full Code Here

Examples of org.apache.hivemind.methodmatch.MethodMatcher

    }

    private MethodMatcher buildMethodMatcher(List parameters)
    {
        MethodMatcher result = null;

        Iterator i = parameters.iterator();
        while (i.hasNext())
        {
            MethodContribution mc = (MethodContribution) i.next();

            if (result == null)
                result = new MethodMatcher();

            result.put(mc.getMethodPattern(), mc);
        }

        return result;
    }
View Full Code Here

Examples of org.apache.hivemind.methodmatch.MethodMatcher

        methodFab.addCatch(RuntimeException.class, body);
    }

    protected void addServiceMethods(InterceptorStack stack, ClassFab fab, List parameters)
    {
        MethodMatcher matcher = buildMethodMatcher(parameters);

        MethodIterator mi = new MethodIterator(stack.getServiceInterface());

        while (mi.hasNext())
        {
View Full Code Here

Examples of org.apache.hivemind.methodmatch.MethodMatcher

    }

    private MethodMatcher buildMethodMatcher(List parameters)
    {
        MethodMatcher result = null;

        Iterator i = parameters.iterator();
        while (i.hasNext())
        {
            MethodContribution mc = (MethodContribution) i.next();

            if (result == null)
                result = new MethodMatcher();

            result.put(mc.getMethodPattern(), mc);
        }

        return result;
    }
View Full Code Here

Examples of org.jmock.internal.matcher.MethodMatcher

    {
        return (T) capturingImposter;
    }
   
    public void createExpectationFrom(Invocation invocation) {
        expectation.setMethodMatcher(new MethodMatcher(invocation.getInvokedMethod()));
       
        if (capturedParameterMatchers.isEmpty()) {
            expectation.setParametersMatcher(new ParametersMatcher(invocation.getParametersAsArray()));
        }
        else {
View Full Code Here

Examples of org.nutz.aop.MethodMatcher

    List<Method> aops = this.getAopMethod(mirror);
    List<InterceptorPair> ipList = new ArrayList<InterceptorPair>();
    if (aops.size() < 1)
      return ipList;
    for (Method m : aops) {
      MethodMatcher mm = new SimpleMethodMatcher(m);
      for (String nm : m.getAnnotation(Aop.class).value())
        ipList.add(new InterceptorPair(ioc.get(MethodInterceptor.class, nm), mm));
    }
    return ipList;
  }
View Full Code Here

Examples of org.springframework.aop.MethodMatcher

  public static boolean canApply(Pointcut pc, Class targetClass, boolean hasIntroductions) {
    if (!pc.getClassFilter().matches(targetClass)) {
      return false;
    }

    MethodMatcher methodMatcher = pc.getMethodMatcher();
    IntroductionAwareMethodMatcher introductionAwareMethodMatcher = null;
    if (methodMatcher instanceof IntroductionAwareMethodMatcher) {
      introductionAwareMethodMatcher = (IntroductionAwareMethodMatcher) methodMatcher;
    }

    Set classes = new HashSet(ClassUtils.getAllInterfacesForClassAsSet(targetClass));
    classes.add(targetClass);
    for (Iterator it = classes.iterator(); it.hasNext();) {
      Class clazz = (Class) it.next();
      Method[] methods = clazz.getMethods();
      for (int j = 0; j < methods.length; j++) {
        if ((introductionAwareMethodMatcher != null &&
            introductionAwareMethodMatcher.matches(methods[j], targetClass, hasIntroductions)) ||
            methodMatcher.matches(methods[j], targetClass)) {
          return true;
        }
      }
    }
View Full Code Here

Examples of org.springframework.aop.MethodMatcher

    if (pointcut == Pointcut.TRUE) {
      return true;
    }
    if (pointcut.getClassFilter().matches(targetClass)) {
      // Only check if it gets past first hurdle.
      MethodMatcher mm = pointcut.getMethodMatcher();
      if (mm.matches(method, targetClass)) {
        // We may need additional runtime (argument) check.
        return (!mm.isRuntime() || mm.matches(method, targetClass, args));
      }
    }
    return false;
  }
View Full Code Here

Examples of org.springframework.aop.MethodMatcher

   * @return a composable pointcut that builds on the original AspectJ expression pointcut
   * @see #getPointcut()
   */
  public final Pointcut buildSafePointcut() {
    Pointcut pc = getPointcut();
    MethodMatcher safeMethodMatcher = MethodMatchers.intersection(
        new AdviceExcludingMethodMatcher(this.aspectJAdviceMethod), pc.getMethodMatcher());
    return new ComposablePointcut(pc.getClassFilter(), safeMethodMatcher);
  }
View Full Code Here

Examples of org.springframework.aop.MethodMatcher

      if (advisor instanceof PointcutAdvisor) {
        // Add it conditionally.
        PointcutAdvisor pointcutAdvisor = (PointcutAdvisor) advisor;
        if (config.isPreFiltered() || pointcutAdvisor.getPointcut().getClassFilter().matches(targetClass)) {
          MethodInterceptor[] interceptors = registry.getInterceptors(advisor);
          MethodMatcher mm = pointcutAdvisor.getPointcut().getMethodMatcher();
          if (MethodMatchers.matches(mm, method, targetClass, hasIntroductions)) {
            if (mm.isRuntime()) {
              // Creating a new object instance in the getInterceptors() method
              // isn't a problem as we normally cache created chains.
              for (int j = 0; j < interceptors.length; j++) {
                interceptorList.add(new InterceptorAndDynamicMethodMatcher(interceptors[j], mm));
              }
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.