Package com.almende.util.AnnotationUtil

Examples of com.almende.util.AnnotationUtil.AnnotatedMethod


      final CallTuple tuple = NamespaceUtil.get(destination,
          request.getMethod());
      final Object realDest = tuple.getDestination();
      final String realMethod = tuple.getMethodName();
     
      final AnnotatedMethod annotatedMethod = getMethod(realDest,
          realMethod, requestParams, auth);
      if (annotatedMethod == null) {
        throw new JSONRPCException(
            JSONRPCException.CODE.METHOD_NOT_FOUND,
            "Method '"
                + request.getMethod()
                + "' not found. The method does not exist or you are not authorized.");
      }
     
      final Method method = annotatedMethod.getActualMethod();
      final Object[] params = castParams(request.getParams(),
          annotatedMethod.getParams(), requestParams);
      Object result = method.invoke(realDest, params);
      if (result == null) {
        result = JOM.createNullNode();
      }
      resp.setResult(result);
View Full Code Here


   *            the args
   * @return the jSON request
   */
  public static JSONRequest createRequest(final Method method,
      final Object[] args) {
    AnnotatedMethod annotatedMethod = null;
    try {
      annotatedMethod = new AnnotationUtil.AnnotatedMethod(method);
    } catch (final Exception e) {
      LOG.log(Level.WARNING, "Method can't be used as annotated method",
          e);
      throw new IllegalArgumentException("Method '" + method.getName()
          + "' can't be used as annotated method.", e);
    }
    final List<AnnotatedParam> annotatedParams = annotatedMethod
        .getParams();
   
    final ObjectNode params = JOM.createObjectNode();
   
    for (int i = 0; i < annotatedParams.size(); i++) {
View Full Code Here

TOP

Related Classes of com.almende.util.AnnotationUtil.AnnotatedMethod

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.