Package org.apache.cxf.jaxrs.impl

Examples of org.apache.cxf.jaxrs.impl.AsyncResponseImpl


    public Object invoke(Exchange exchange, Object request) {
        Response response = exchange.get(Response.class);
        if (response == null) {
            AsyncResponse asyncResp = exchange.get(AsyncResponse.class);
            if (asyncResp != null) {
                AsyncResponseImpl asyncImpl = (AsyncResponseImpl)asyncResp;
                asyncImpl.prepareContinuation();
                asyncImpl.handleTimeout();
                return handleAsyncResponse(exchange, asyncImpl.getResponseObject());
            }
        }
        if (response != null) {
            return new MessageContentsList(response);
        }
View Full Code Here


        try {
            if (setServiceLoaderAsContextLoader(inMessage)) {
                contextLoader = ClassLoaderUtils
                    .setThreadContextClassloader(resourceObject.getClass().getClassLoader());
            }
            AsyncResponseImpl asyncResponse = null;
            if (!ori.isSubResourceLocator()) {
                asyncResponse = (AsyncResponseImpl)inMessage.get(AsyncResponse.class);
            }
            result = invoke(exchange, resourceObject, methodToInvoke, params);
            if (asyncResponse != null) {
                if (!asyncResponse.isSuspended() && !asyncResponse.isResumedByApplication()) {
                    asyncResponse.suspendContinuation();
                } else {
                    result = handleAsyncResponse(exchange, asyncResponse.getResponseObject());
                }
            }
        } catch (Fault ex) {
            return handleFault(ex, inMessage, cri, methodToInvoke);
        } finally {
View Full Code Here

        InputStream is = message.getContent(InputStream.class);

        if (parameter.getType() == ParameterType.REQUEST_BODY) {
           
            if (parameterClass == AsyncResponse.class) {
                return new AsyncResponseImpl(message);
            }
           
            String contentType = (String)message.get(Message.CONTENT_TYPE);

            if (contentType == null) {
View Full Code Here

        InputStream is = message.getContent(InputStream.class);

        if (parameter.getType() == ParameterType.REQUEST_BODY) {
           
            if (parameterClass == AsyncResponse.class) {
                return new AsyncResponseImpl(message);
            }
           
            String contentType = (String)message.get(Message.CONTENT_TYPE);

            if (contentType == null) {
View Full Code Here

        if (responseList != null) {
            return responseList;
        }
        AsyncResponse asyncResp = exchange.get(AsyncResponse.class);
        if (asyncResp != null) {
            AsyncResponseImpl asyncImpl = (AsyncResponseImpl)asyncResp;
            asyncImpl.prepareContinuation();
            asyncImpl.handleTimeout();
            return handleAsyncResponse(exchange, asyncImpl.getResponseObject());
        }
       
        ResourceProvider provider = getResourceProvider(exchange);
        Object rootInstance = null;
        try {
View Full Code Here

        try {
            if (setServiceLoaderAsContextLoader(inMessage)) {
                contextLoader = ClassLoaderUtils
                    .setThreadContextClassloader(resourceObject.getClass().getClassLoader());
            }
            AsyncResponseImpl asyncResponse = null;
            if (!ori.isSubResourceLocator()) {
                asyncResponse = (AsyncResponseImpl)inMessage.get(AsyncResponse.class);
            }
            result = invoke(exchange, resourceObject, methodToInvoke, params);
            if (asyncResponse != null) {
                if (!asyncResponse.isSuspended() && !asyncResponse.isResumedByApplication()) {
                    asyncResponse.suspendContinuation();
                } else {
                    result = handleAsyncResponse(exchange, asyncResponse.getResponseObject());
                }
            }
        } catch (Fault ex) {
            return handleFault(ex, inMessage, cri, methodToInvoke);
        } finally {
View Full Code Here

        if (responseList != null) {
            return responseList;
        }
        AsyncResponse asyncResp = exchange.get(AsyncResponse.class);
        if (asyncResp != null) {
            AsyncResponseImpl asyncImpl = (AsyncResponseImpl)asyncResp;
            asyncImpl.prepareContinuation();
            asyncImpl.handleTimeout();
            return handleAsyncResponse(exchange, asyncImpl.getResponseObject());
        }
       
        ResourceProvider provider = getResourceProvider(exchange);
        Object rootInstance = null;
        try {
View Full Code Here

        try {
            if (setServiceLoaderAsContextLoader(inMessage)) {
                contextLoader = ClassLoaderUtils
                    .setThreadContextClassloader(resourceObject.getClass().getClassLoader());
            }
            AsyncResponseImpl asyncResponse = null;
            if (!ori.isSubResourceLocator()) {
                asyncResponse = (AsyncResponseImpl)inMessage.get(AsyncResponse.class);
            }
            result = invoke(exchange, resourceObject, methodToInvoke, params);
            if (asyncResponse != null) {
                if (!asyncResponse.isSuspended() && !asyncResponse.isResumedByApplication()) {
                    asyncResponse.suspendContinuation();
                    providerFactory.clearThreadLocalProxies();
                } else {
                    result = handleAsyncResponse(exchange, asyncResponse.getResponseObject());
                }
            }
        } catch (Fault ex) {
            return handleFault(ex, inMessage, cri, methodToInvoke);
        } finally {
View Full Code Here

        InputStream is = message.getContent(InputStream.class);

        if (parameter.getType() == ParameterType.REQUEST_BODY) {
           
            if (parameterClass == AsyncResponse.class) {
                return new AsyncResponseImpl(message);
            }
           
            String contentType = (String)message.get(Message.CONTENT_TYPE);

            if (contentType == null) {
View Full Code Here

        InputStream is = message.getContent(InputStream.class);

        if (parameter.getType() == ParameterType.REQUEST_BODY) {
           
            if (parameterClass == AsyncResponse.class) {
                return new AsyncResponseImpl(message);
            }
           
            String contentType = (String)message.get(Message.CONTENT_TYPE);

            if (contentType == null) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxrs.impl.AsyncResponseImpl

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.