Search in sources :

Example 1 with HttpRequest

use of com.duangframework.core.common.dto.http.request.HttpRequest in project duangframework by tcrct.

the class MainProcess method doWork.

@Override
public IResponse doWork(IRequest req, IResponse res) throws Exception {
    HttpRequest request = (HttpRequest) req;
    HttpResponse response = (HttpResponse) res;
    if (ToolsKit.isEmpty(request)) {
        throw new EmptyNullException("request is null");
    }
    if (ToolsKit.isEmpty(response)) {
        throw new EmptyNullException("response is null");
    }
    String target = request.getRequestURI().toString();
    AsyncContext asyncContext = new AsyncContextThreadImpl(target, request, response);
    return asyncContext.complete();
// AsyncContext asyncContext = new AsyncContextQueueImpl(target, request, response);
// return asyncContext.complete();
}
Also used : HttpRequest(com.duangframework.core.common.dto.http.request.HttpRequest) EmptyNullException(com.duangframework.core.exceptions.EmptyNullException) HttpResponse(com.duangframework.core.common.dto.http.response.HttpResponse) AsyncContext(com.duangframework.core.common.dto.http.request.AsyncContext)

Aggregations

AsyncContext (com.duangframework.core.common.dto.http.request.AsyncContext)1 HttpRequest (com.duangframework.core.common.dto.http.request.HttpRequest)1 HttpResponse (com.duangframework.core.common.dto.http.response.HttpResponse)1 EmptyNullException (com.duangframework.core.exceptions.EmptyNullException)1