Example usage for javax.servlet AsyncEvent getSuppliedRequest

List of usage examples for javax.servlet AsyncEvent getSuppliedRequest

Introduction

In this page you can find the example usage for javax.servlet AsyncEvent getSuppliedRequest.

Prototype

public ServletRequest getSuppliedRequest() 

Source Link

Document

Gets the ServletRequest from this AsyncEvent.

Usage

From source file:org.apache.vysper.xmpp.extension.xep0124.BoshBackedSessionContext.java

protected void handleAsyncEventError(AsyncEvent event) {
    final ServletRequest suppliedRequest = event.getSuppliedRequest();
    final ServletResponse suppliedResponse = event.getSuppliedResponse();
    BoshRequest boshRequest = (BoshRequest) suppliedRequest.getAttribute(BOSH_REQUEST_ATTRIBUTE);
    BoshResponse boshResponse = (BoshResponse) suppliedRequest.getAttribute(BOSH_RESPONSE_ATTRIBUTE);

    // works at least for jetty:
    final Exception exceptionObject = (Exception) suppliedRequest.getAttribute("javax.servlet.error.exception");
    final Throwable throwable = event.getThrowable() != null ? event.getThrowable() : exceptionObject;

    final Long rid = boshRequest == null ? null : boshRequest.getRid();
    LOGGER.warn("SID = " + getSessionId() + " - JID = " + getInitiatingEntity() + " - RID = " + rid
            + " - async error on event ", event.getClass(), throwable);
}