Package org.apache.wink.server.internal.handlers

Examples of org.apache.wink.server.internal.handlers.SearchResult$AccumulatedData


    }

    public MultivaluedMap<String, String> getPathParameters(boolean decode) {
        if (pathParameters == null) {
            pathParameters = new MultivaluedMapImpl<String, String>();
            SearchResult searchResult = messageContext.getAttribute(SearchResult.class);
            if (searchResult == null) {
                throw new IllegalStateException("outside the scope of a request");
            }
            MultivaluedMapImpl.copy(searchResult.getData().getMatchedVariables(), pathParameters);
        }

        MultivaluedMap<String, String> map = pathParameters;
        if (decode) {
            if (decodedPathParameters == null) {
View Full Code Here


    public MultivaluedMap<String, String> getPathParameters(boolean decode) {
        logger.debug("getPathParameters({}) called", decode);
        if (pathParameters == null) {
            pathParameters = new MultivaluedMapImpl<String, String>();
            SearchResult searchResult = messageContext.getAttribute(SearchResult.class);
            if (searchResult == null) {
                throw new IllegalStateException("outside the scope of a request");
            }
            MultivaluedMapImpl.copy(searchResult.getData().getMatchedVariables(), pathParameters);
            logger.debug("getPathParameters({}) encoded path parameters are: {}",
                         decode,
                         pathParameters);
        }
View Full Code Here

    public MultivaluedMap<String, String> getPathParameters(boolean decode) {
        logger.debug("getPathParameters({}) called", decode); //$NON-NLS-1$
        if (pathParameters == null) {
            pathParameters = new MultivaluedMapImpl<String, String>();
            SearchResult searchResult = messageContext.getAttribute(SearchResult.class);
            if (searchResult == null) {
                throw new IllegalStateException(Messages
                    .getMessage("methodCallOutsideScopeOfRequestContext")); //$NON-NLS-1$
            }
            MultivaluedMapImpl.copy(searchResult.getData().getMatchedVariables(), pathParameters);
            logger.debug("getPathParameters({}) encoded path parameters are: {}", //$NON-NLS-1$
                         decode,
                         pathParameters);
        }
View Full Code Here

            RuntimeContextTLS.setRuntimeContext(null);
        }
    }

    private void releaseResources(RuntimeContext msgContext) throws Exception {
        SearchResult searchResult = msgContext.getAttribute(SearchResult.class);
        if (searchResult != null) {
            List<ResourceInstance> resourceInstances = searchResult.getData().getMatchedResources();
            for (ResourceInstance res : resourceInstances) {
                logger.trace("Releasing resource instance");
                res.releaseInstance(msgContext);
            }
        }
View Full Code Here

            RuntimeContextTLS.setRuntimeContext(null);
        }
    }

    private void releaseResources(RuntimeContext msgContext) throws Exception {
        SearchResult searchResult = msgContext.getAttribute(SearchResult.class);
        if (searchResult != null) {
            List<ResourceInstance> resourceInstances = searchResult.getData().getMatchedResources();
            for (ResourceInstance res : resourceInstances) {
                logger.debug("Releasing resource instance");
                res.releaseInstance(msgContext);
            }
        }
View Full Code Here

    public MultivaluedMap<String, String> getPathParameters(boolean decode) {
        logger.debug("getPathParameters({}) called", decode); //$NON-NLS-1$
        if (pathParameters == null) {
            pathParameters = new MultivaluedMapImpl<String, String>();
            SearchResult searchResult = messageContext.getAttribute(SearchResult.class);
            if (searchResult == null) {
                throw new IllegalStateException(Messages
                    .getMessage("methodCallOutsideScopeOfRequestContext")); //$NON-NLS-1$
            }
            MultivaluedMapImpl.copy(searchResult.getData().getMatchedVariables(), pathParameters);
            logger.debug("getPathParameters({}) encoded path parameters are: {}", //$NON-NLS-1$
                         decode,
                         pathParameters);
        }
View Full Code Here

                                             true,
                                             true);
                }
            }

            SearchResult result = context.getAttribute(SearchResult.class);
            if (result.isError()) {
                ResourceInstance instance = result.getResource();
                if (instance != null) {
                    f.format("%n-> %1$s.(No matching method)", instance.getResourceClass()
                        .getName());
                    if (logger.isTraceEnabled()) {
                        LogUtilities.logResourceMetadata(Collections.singletonList(result
                            .getResource().getRecord()), logger, true, true);
                    }
                } else {
                    f.format("No resource instance was invoked.");
                }
View Full Code Here

            try {
                ResourceInvocationData data = context.getAttribute(ResourceInvocationData.class);
                if (data == null) {
                    return;
                }
                SearchResult result = context.getAttribute(SearchResult.class);
                data.getResourceMetadata().add(result.getResource().getRecord());
                if (result.isFound()) {
                    data.getMethodMetadata().add(result.getMethod().getMetadata());
                }
            } catch (Exception e) {
                logger.trace("Encountered exception while calling addInvocation", e);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.wink.server.internal.handlers.SearchResult$AccumulatedData

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.