Search in sources :

Example 1 with HTTPSession

use of org.apache.cxf.transport.http.HTTPSession in project cxf by apache.

the class JAXWSHttpSpiDestination method serviceRequest.

protected void serviceRequest(final HttpServletRequest req, final HttpServletResponse resp) throws IOException {
    if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("Service http request on thread: " + Thread.currentThread());
    }
    Message inMessage = new MessageImpl();
    ExchangeImpl exchange = new ExchangeImpl();
    exchange.setInMessage(inMessage);
    setupMessage(inMessage, null, req.getServletContext(), req, resp);
    ((MessageImpl) inMessage).setDestination(this);
    exchange.setSession(new HTTPSession(req));
    try {
        incomingObserver.onMessage(inMessage);
        resp.flushBuffer();
    } catch (SuspendedInvocationException ex) {
        if (ex.getRuntimeException() != null) {
            throw ex.getRuntimeException();
        }
    // else nothing to do
    } catch (Fault ex) {
        Throwable cause = ex.getCause();
        if (cause instanceof RuntimeException) {
            throw (RuntimeException) cause;
        }
        throw ex;
    } catch (RuntimeException ex) {
        throw ex;
    } finally {
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Finished servicing http request on thread: " + Thread.currentThread());
        }
    }
}
Also used : Message(org.apache.cxf.message.Message) HTTPSession(org.apache.cxf.transport.http.HTTPSession) Fault(org.apache.cxf.interceptor.Fault) SuspendedInvocationException(org.apache.cxf.continuations.SuspendedInvocationException) MessageImpl(org.apache.cxf.message.MessageImpl) ExchangeImpl(org.apache.cxf.message.ExchangeImpl)

Aggregations

SuspendedInvocationException (org.apache.cxf.continuations.SuspendedInvocationException)1 Fault (org.apache.cxf.interceptor.Fault)1 ExchangeImpl (org.apache.cxf.message.ExchangeImpl)1 Message (org.apache.cxf.message.Message)1 MessageImpl (org.apache.cxf.message.MessageImpl)1 HTTPSession (org.apache.cxf.transport.http.HTTPSession)1