Example usage for javax.servlet AsyncEvent AsyncEvent

List of usage examples for javax.servlet AsyncEvent AsyncEvent

Introduction

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

Prototype

public AsyncEvent(AsyncContext context, ServletRequest request, ServletResponse response) 

Source Link

Document

Constructs an AsyncEvent from the given AsyncContext, ServletRequest, and ServletResponse.

Usage

From source file:org.jruby.rack.mock.MockAsyncContext.java

@Override
public void complete() {
    MockHttpServletRequest mockRequest = WebUtils.getNativeRequest(request, MockHttpServletRequest.class);
    if (mockRequest != null) {
        mockRequest.setAsyncStarted(false);
    }/*from   w  w  w.  j  a va2 s. co m*/
    for (AsyncListener listener : this.listeners) {
        try {
            listener.onComplete(new AsyncEvent(this, this.request, this.response));
        } catch (IOException e) {
            throw new IllegalStateException("AsyncListener failure", e);
        }
    }
}