Package org.jboss.jca.common.metadata.ra.ra16

Examples of org.jboss.jca.common.metadata.ra.ra16.Path


      throw new RuntimeException("Failed to add routes for " + routeControllerClass + ".", t);
    }

    for (Method routeMethod : routeControllerClass.getDeclaredMethods()) {
      String routeMethodName = routeMethod.getName();
      Path pathAnnotation = routeMethod.getAnnotation(Path.class);
      Paths pathsAnnotation = routeMethod.getAnnotation(Paths.class);
      if (pathAnnotation != null || pathsAnnotation != null) {
        String actionName;
        if (routeMethodName.endsWith("Action")) {
          actionName = routeMethodName.substring(0, routeMethodName.length() - "Action".length());
        }
        else {
          actionName = routeMethodName;
        }

        ERXRoute.Method method = null;
        // Search annotations for @PUT, @GET, etc.
        for (Annotation annotation : routeMethod.getAnnotations()) {
          HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class);
          if (httpMethod != null) {
            if (method == null) {
              method = httpMethod.value();
            }
            else {
              throw new IllegalArgumentException(routeControllerClass.getSimpleName() + "." + routeMethod.getName() + " is annotated as more than one http method.");
            }
          }
        }

        // Finally default declared REST actions to @GET
        if (method == null) {
          method = ERXRoute.Method.Get;
        }

        if (pathAnnotation != null) {
          addRoute(new ERXRoute(entityName, pathAnnotation.value(), method, routeControllerClass, actionName));
          declaredRoutesFound = true;
        }
        if (pathsAnnotation != null) {
          for (Path path : pathsAnnotation.value()) {
            addRoute(new ERXRoute(entityName, path.value(), method, routeControllerClass, actionName));
View Full Code Here


                  configProperty.trimToSize();

                  //building and returning object
                  if (configProperty.size() != 0)
                  {
                     return new Activationspec16(activationspecClass, requiredConfigProperty, configProperty, id);
                  }
                  else
                  {
                     return new Activationspec15(activationspecClass, requiredConfigProperty, id);
                  }
View Full Code Here

                  configProperty.trimToSize();

                  //building and returning object
                  if (configProperty.size() != 0)
                  {
                     return new Activationspec16Impl(activationspecClass, requiredConfigProperty, configProperty, id);
                  }
                  else
                  {
                     return new Activationspec15Impl(activationspecClass, requiredConfigProperty, id);
                  }
View Full Code Here

      if (activation.messageListeners() != null)
      {
         messageListeners = new ArrayList<MessageListener>(activation.messageListeners().length);
         for (Class asClass : activation.messageListeners())
         {
            Activationspec16 asMeta = new Activationspec16Impl(new XsdString(annotation.getClassName(), null),
                                                               requiredConfigProperties,
                                                               validProperties,
                                                               null);
            MessageListener mlMeta = new MessageListenerImpl(new XsdString(asClass.getName(), null), asMeta, null);
            messageListeners.add(mlMeta);
View Full Code Here

                  configProperty.trimToSize();

                  //building and returning object
                  if (configProperty.size() != 0)
                  {
                     return new Activationspec16Impl(activationspecClass, requiredConfigProperty, configProperty, id);
                  }
                  else
                  {
                     return new Activationspec15Impl(activationspecClass, requiredConfigProperty, id);
                  }
View Full Code Here

      if (activation.messageListeners() != null)
      {
         messageListeners = new ArrayList<MessageListener>(activation.messageListeners().length);
         for (Class asClass : activation.messageListeners())
         {
            Activationspec16 asMeta = new Activationspec16Impl(new XsdString(annotation.getClassName(), null), null,
                                                               validProperties,
                                                               null);
            MessageListener mlMeta = new MessageListenerImpl(new XsdString(asClass.getName(), null), asMeta, null);
            messageListeners.add(mlMeta);
View Full Code Here

      if (activation.messageListeners() != null)
      {
         messageListeners = new ArrayList<MessageListener>(activation.messageListeners().length);
         for (Class asClass : activation.messageListeners())
         {
            Activationspec16 asMeta = new Activationspec16Impl(new XsdString(annotation.getClassName(), null),
                                                               requiredConfigProperties,
                                                               validProperties,
                                                               null);
            MessageListener mlMeta = new MessageListenerImpl(new XsdString(asClass.getName(), null), asMeta, null);
            messageListeners.add(mlMeta);
View Full Code Here

                  configProperty.trimToSize();

                  //building and returning object
                  if (configProperty.size() != 0)
                  {
                     return new Activationspec16Impl(activationspecClass, requiredConfigProperty, configProperty, id);
                  }
                  else
                  {
                     return new Activationspec15Impl(activationspecClass, requiredConfigProperty, id);
                  }
View Full Code Here

                  configProperty.trimToSize();

                  //building and returning object
                  if (configProperty.size() != 0)
                  {
                     return new Activationspec16Impl(activationspecClass, requiredConfigProperty, configProperty, id);
                  }
                  else
                  {
                     return new Activationspec15Impl(activationspecClass, requiredConfigProperty, id);
                  }
View Full Code Here

      if (activation.messageListeners() != null)
      {
         messageListeners = new ArrayList<MessageListener>(activation.messageListeners().length);
         for (Class asClass : activation.messageListeners())
         {
            Activationspec16 asMeta = new Activationspec16Impl(new XsdString(annotation.getClassName(), null),
                                                               requiredConfigProperties,
                                                               validProperties,
                                                               null);
            MessageListener mlMeta = new MessageListenerImpl(new XsdString(asClass.getName(), null), asMeta, null);
            messageListeners.add(mlMeta);
View Full Code Here

TOP

Related Classes of org.jboss.jca.common.metadata.ra.ra16.Path

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.