Examples of MethodHolder


Examples of org.jboss.interceptor.model.MethodHolder

   }

   public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable
   {
      ReflectionUtils.ensureAccessible(thisMethod);
      if (getInterceptionStack().contains(new MethodHolder(thisMethod, true)))
         return thisMethod.invoke(target, args);
      try
      {
         getInterceptionStack().add(new MethodHolder(thisMethod, true));

         if (!thisMethod.getDeclaringClass().equals(LifecycleMixin.class))
         {
            if (!org.jboss.interceptor.util.InterceptionUtils.isInterceptionCandidate(thisMethod))
               return thisMethod.invoke(target, args);
            return executeInterception(thisMethod, args, InterceptionType.AROUND_INVOKE);
         } else
         {
            if (thisMethod.getName().equals(InterceptionUtils.POST_CONSTRUCT))
            {
               return executeInterception(null, null, InterceptionType.POST_CONSTRUCT);
            } else if (thisMethod.getName().equals(InterceptionUtils.PRE_DESTROY))
            {
               return executeInterception(null, null, InterceptionType.PRE_DESTROY);
            }
         }
          return null;
      } finally
      {
         getInterceptionStack().remove(new MethodHolder(thisMethod, true));
      }


   }
View Full Code Here

Examples of org.jboss.weld.serialization.MethodHolder

    private Method getMethod(String name, Class<?>... parameterTypes) throws NoSuchMethodException {
        return getClass().getDeclaredMethod(name, parameterTypes);
    }

    private void assertReferenceSerializable(Method method) throws Exception {
        MethodHolder reference = MethodHolder.of(method);
        Utils.deserialize(Utils.serialize(reference));
    }
View Full Code Here

Examples of org.jibeframework.core.app.method.MethodHolder

  public boolean annotatedMethodExists(Class<? extends Annotation> annotation, String id) {
    return holders.get(annotation).containsKey(id);
  }

  public Object invoke(Class<? extends Annotation> annotationClass, String methodId, Object... args) {
    MethodHolder holder = resolveAnnotatedMethodHolder(annotationClass, methodId, args);
    Object retValue = holder.invoke();
    return retValue;
  }
View Full Code Here

Examples of org.jibeframework.core.app.method.MethodHolder

    Object retValue = holder.invoke();
    return retValue;
  }

  public Object invoke(String value, Object... args) {
    MethodHolder holder = resolveHolder(value, args);
    Object retValue = holder.invoke();
    return retValue;
  }
View Full Code Here

Examples of org.jibeframework.core.app.method.MethodHolder

        || AnnotationUtils.findAnnotation(userClass, UIController.class) != null) {
      Method[] methods = userClass.getMethods();
      for (int i = 0; i < methods.length; i++) {
        if (methods[i].getName().equals(methodName)) {
          Object[] resolvedArguments = argumentsResolver.resolveArguments(methods[i], args);
          candidates.add(new MethodHolder(methodId, bean, methods[i], resolvedArguments));
        }
      }
      if (candidates.isEmpty()) {
        throw new JibeRuntimeException("Method " + methodId + " could not be found");
      }
      Double bestGuess = null;
      MethodHolder bestCandidate = null;
      for (MethodHolder candidate : candidates) {
        double guess = candidate.getQuality();
        if (bestGuess == null || guess > bestGuess) {
          bestGuess = guess;
          bestCandidate = candidate;
View Full Code Here

Examples of org.jibeframework.core.app.method.MethodHolder

  public void handleRequest(Context context) {
    Object retValue = null;
    try {
      final String remoteMethod = (String) context.getParams().get("remoteMethod");
      argumentsResolver.initializeArgumentCandidates(context);
      MethodHolder methodHolder = methodService.resolveHolder(remoteMethod);
      if (methodHolder != null) {
        Interceptor interceptor = methodHolder.getMethod().getAnnotation(Interceptor.class);
        if (interceptor != null) {
          for (String intercName : interceptor.value()) {
            methodService.invokeServiceMethod(intercName);
          }
        }
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.