Package org.jrest4guice.dao.actions

Examples of org.jrest4guice.dao.actions.Action


    return (T) Proxy.newProxyInstance(daoClazz.getClassLoader(), new Class[] { daoClazz }, this);
  }

  @SuppressWarnings("unchecked")
  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    Action action = getAction(method);
    if (action == null) {
      String msg = "无法获取" + proxy.getClass() + "." + method.getName() + "方法声明的Action实例。";
      log.error(msg);
      throw new RejectedExecutionException(msg);
    } else {
      ActionContext context = action.getContext();
      context.setAction(action);
      return context.execute(method, args);
    }
  }
View Full Code Here


  private Action getAction(Method method) {
    Annotation[] annotations = method.getAnnotations();
    for (Annotation annotation : annotations) {
      Class<? extends Annotation> clazz = annotation.annotationType();
      if (register.isActionAnnotation(clazz)) {
        Action action = register.createAction(annotation);
        action.setAnnotation(annotation);
        return action;
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.jrest4guice.dao.actions.Action

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.