Examples of ResourceMethod


Examples of com.sun.jersey.server.impl.model.method.ResourceMethod

            final ResourceMethod rm,
            final ResourceMethodMap rmm) {
        final List<ResourceMethod> rml = rmm.get(rm.getHttpMethod());
        if (rml != null) {
            boolean conflict = false;
            ResourceMethod erm = null;
            for (int i = 0; i < rml.size() && !conflict; i++) {
                erm = rml.get(i);

                conflict = MediaTypes.intersects(rm.getConsumes(), erm.getConsumes())
                        && MediaTypes.intersects(rm.getProduces(), erm.getProduces());
            }

            if (conflict) {
                if (rm.getAbstractResourceMethod().hasEntity()) {
                    Errors.error(String.format("Consuming media type conflict. " +
                            "The resource methods %s and %s can consume the same media type",
                            rm.getAbstractResourceMethod().getMethod(), erm.getAbstractResourceMethod().getMethod()));
                } else {
                    Errors.error(String.format("Producing media type conflict. " +
                            "The resource methods %s and %s can produce the same media type",
                            rm.getAbstractResourceMethod().getMethod(), erm.getAbstractResourceMethod().getMethod()));
                }
            }

            if (conflict)
                return false;
View Full Code Here

Examples of com.sun.jersey.server.impl.model.method.ResourceMethod

            headList = new ArrayList<ResourceMethod>();
        }

        for (final ResourceMethod getMethod : getList) {
            if (!containsMediaOfMethod(headList, getMethod)) {
                final ResourceMethod headMethod = new ResourceHeadWrapperMethod(getMethod);
                methodMap.put(headMethod);
                headList = methodMap.get(HttpMethod.HEAD);
            }
        }
    }
View Full Code Here

Examples of com.sun.jersey.server.impl.model.method.ResourceMethod

        final List<ResourceMethod> l = methodMap.get("OPTIONS");
        if (l != null) {
            return;
        }

        ResourceMethod optionsMethod = wadlFactory.createWadlOptionsMethod(methodMap, resource, p);
        if (optionsMethod == null) {
            optionsMethod = new ResourceHttpOptionsMethod(methodMap);
        }
        methodMap.put(optionsMethod);
    }
View Full Code Here

Examples of org.codehaus.enunciate.contract.jaxrs.ResourceMethod

   * </ol>
   *
   * @return An example resource method, or if no good examples were found.
   */
  public ResourceMethod findExampleResourceMethod() {
    ResourceMethod example = null;
    List<RootResource> resources = getRootResources();
    for (RootResource root : resources) {
      List<ResourceMethod> methods = root.getResourceMethods(true);
      for (ResourceMethod method : methods) {
        if (method.getAnnotation(DocumentationExample.class) != null && !method.getAnnotation(DocumentationExample.class).exclude()) {
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.core.dispatch.ResourceMethod

        {
          logger.error("Overloaded rest method: " + method.getDeclaringClass().getName() + "." + method.getName() + " found. It is not supported for Crux REST services.");
        }
        else
        {
          ResourceMethod invoker = new ResourceMethod(clazz, method, httpMethod);
          rootSegment.addPath(pathExpression, invoker);
          restMethodNames.add(method.getName());
          size++;
          return new RestMethodRegistrationInfo(pathExpression, invoker);
        }
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.core.dispatch.ResourceMethod

    if (!isResponseMediaTypeAllowed(accepts))
    {
      throw new NotAcceptableException("No match for accept header");
    }

    ResourceMethod invoker = null;

    for (ResourceMethod rm : methods)
    {
      if (rm.getHttpMethod() != null && rm.getHttpMethod().equals(httpMethod))
      {
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.core.dispatch.ResourceMethod

    matcher.region(start, path.length());

    if (matcher.matches())
    {
      // we consumed entire path string
      ResourceMethod invoker = match(request.getHttpMethod(), request);
      if (invoker == null)
      {
        throw new NotFoundException("Could not find resource for relative : " + path + " of full path: " + request.getUri().getRequestUri());
      }
      uriInfo.pushMatchedURI(path, Encode.decode(path));
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.core.dispatch.ResourceMethod

   public ResourceMethod matchSimple(HttpRequest request, String path, int start)
   {
      UriInfo uriInfo = request.getUri();
      if (start + segment.length() == path.length()) // we've reached end of string
      {
        ResourceMethod invoker = match(request.getHttpMethod(), request);
         if (invoker == null)
            throw new NotFoundException("Could not find resource for relative : " + path + " of full path: " + request.getUri().getRequestUri());

         uriInfo.pushMatchedURI(path, Encode.decode(path));
         return invoker;
View Full Code Here

Examples of org.glassfish.jersey.server.model.ResourceMethod

        }

        @Override
        public void onEvent(RequestEvent event) {
            if (event.getType() == RequestEvent.Type.ON_EXCEPTION) {
                final ResourceMethod method = event.getUriInfo().getMatchedResourceMethod();
                final ExceptionMeterMetric metric = (method != null) ?
                        this.exceptionMeters.get(method.getInvocable().getDefinitionMethod()) : null;

                if (metric != null) {
                    if (metric.cause.isAssignableFrom(event.getException().getClass()) ||
                            (event.getException().getCause() != null &&
                                    metric.cause.isAssignableFrom(event.getException().getCause().getClass()))) {
View Full Code Here

Examples of org.glassfish.jersey.server.model.ResourceMethod

            switch (event.getType()) {
                case RESOURCE_METHOD_START:
                    this.methodTimeStart = now;
                    break;
                case RESOURCE_METHOD_FINISHED:
                    final ResourceMethod method = event.getUriInfo().getMatchedResourceMethod();
                    methodStats = new MethodStats(method, methodTimeStart, now - methodTimeStart);
                    break;
                case EXCEPTION_MAPPING_FINISHED:
                    exceptionMapperEvents.add(event);
                    break;
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.