Examples of ResourceMethod


Examples of org.restlet.ext.jaxrs.internal.wrappers.ResourceMethod

            tlContext.set(callContext);
            try {
                ResObjAndMeth resObjAndMeth;
                resObjAndMeth = requestMatching();
                callContext.setReadOnly();
                ResourceMethod resourceMethod = resObjAndMeth.resourceMethod;
                resourceObject = resObjAndMeth.resourceObject;
                Object result = invokeMethod(resourceMethod, resourceObject);
                handleResult(result, resourceMethod);
            } catch (WebApplicationException e) {
                // the message of the Exception is not used in the
View Full Code Here

Examples of org.restlet.ext.jaxrs.internal.wrappers.ResourceMethod

        }
        if (resourceMethods.isEmpty()) {
            excHandler.noResourceMethodForAccMediaTypes(supporting);
        }
        // (b) and (c)
        ResourceMethod bestResourceMethod = getBestMethod(resourceMethods,
                givenMediaType, accMediaTypes, httpMethod);
        MatchingResult mr = bestResourceMethod.getPathRegExp().match(u);
        addPathVarsToMap(mr, callContext);
        String matchedUriPart = mr.getMatched();
        if (matchedUriPart.length() > 0) {
            Object jaxRsResObj = resObj.getJaxRsResourceObject();
            callContext.addForMatched(jaxRsResObj, matchedUriPart);
View Full Code Here

Examples of org.restlet.ext.jaxrs.internal.wrappers.ResourceMethod

        }
        if (mms2.isEmpty()) {
            return Util.getFirstKey(mms1);
        }
        for (final MediaType accMediaType : accMediaTypes) {
            ResourceMethod bestResMethod = null;
            for (final Map.Entry<ResourceMethod, List<MediaType>> mm : mms2
                    .entrySet()) {
                for (final MediaType methodMediaType : mm.getValue()) {
                    if (accMediaType.includes(methodMediaType)) {
                        final ResourceMethod currentResMethod = mm.getKey();
                        if (bestResMethod == null) {
                            bestResMethod = currentResMethod;
                        } else {
                            if (requHttpMethod.equals(Method.HEAD)) {
                                // special handling for HEAD
                                final Method bestMethodHttp;
                                bestMethodHttp = bestResMethod.getHttpMethod();
                                if (bestMethodHttp.equals(Method.GET)
                                        && currentResMethod.getHttpMethod()
                                                .equals(Method.HEAD)) {
                                    // ignore HEAD method
                                } else if (bestMethodHttp.equals(Method.HEAD)
                                        && currentResMethod.getHttpMethod()
                                                .equals(Method.GET)) {
                                    bestResMethod = currentResMethod;
                                } else {
                                    // use one of the methods, e.g. the first
                                }
View Full Code Here

Examples of org.restlet.ext.jaxrs.internal.wrappers.ResourceMethod

    public static void removeNotSupportedHttpMethod(
            Collection<ResourceMethod> resourceMethods,
            org.restlet.data.Method httpMethod, boolean alsoGet) {
        final Iterator<ResourceMethod> methodIter = resourceMethods.iterator();
        while (methodIter.hasNext()) {
            final ResourceMethod resourceMethod = methodIter.next();
            if (!resourceMethod.isHttpMethodSupported(httpMethod, alsoGet)) {
                methodIter.remove();
            }
        }
    }
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.