Search in sources :

Example 1 with Continuation

use of org.apache.cxf.continuations.Continuation in project camel by apache.

the class CxfRsInvoker method performInvocation.

protected Object performInvocation(Exchange cxfExchange, final Object serviceObject, Method method, Object[] paramArray) throws Exception {
    Object response = null;
    if (endpoint.isPerformInvocation()) {
        response = super.performInvocation(cxfExchange, serviceObject, method, paramArray);
    }
    paramArray = insertExchange(method, paramArray, cxfExchange);
    OperationResourceInfo ori = cxfExchange.get(OperationResourceInfo.class);
    if (ori.isSubResourceLocator()) {
        // don't delegate the sub resource locator call to camel processor
        return method.invoke(serviceObject, paramArray);
    }
    Continuation continuation;
    if (!endpoint.isSynchronous() && (continuation = getContinuation(cxfExchange)) != null) {
        LOG.trace("Calling the Camel async processors.");
        return asyncInvoke(cxfExchange, serviceObject, method, paramArray, continuation, response);
    } else {
        LOG.trace("Calling the Camel sync processors.");
        return syncInvoke(cxfExchange, serviceObject, method, paramArray, response);
    }
}
Also used : Continuation(org.apache.cxf.continuations.Continuation) OperationResourceInfo(org.apache.cxf.jaxrs.model.OperationResourceInfo)

Aggregations

Continuation (org.apache.cxf.continuations.Continuation)1 OperationResourceInfo (org.apache.cxf.jaxrs.model.OperationResourceInfo)1