当前位置: 首页>>代码示例>>Java>>正文


Java AsyncEvent.getThrowable方法代码示例

本文整理汇总了Java中javax.servlet.AsyncEvent.getThrowable方法的典型用法代码示例。如果您正苦于以下问题:Java AsyncEvent.getThrowable方法的具体用法?Java AsyncEvent.getThrowable怎么用?Java AsyncEvent.getThrowable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.servlet.AsyncEvent的用法示例。


在下文中一共展示了AsyncEvent.getThrowable方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processEvent

import javax.servlet.AsyncEvent; //导入方法依赖的package包/类
private void processEvent(AsyncEvent event) throws IOException {
    Entity prior = recorder.getTraceEntity();
    try {
        Entity entity = (Entity) event.getSuppliedRequest().getAttribute(ENTITY_ATTRIBUTE_KEY);
        recorder.setTraceEntity(entity);
        if (null != event.getThrowable()) {
            entity.addException(event.getThrowable());
        }
        filter.postFilter(event.getSuppliedRequest(), event.getSuppliedResponse());
    } finally {
        recorder.setTraceEntity(prior);
    }
}
 
开发者ID:aws,项目名称:aws-xray-sdk-java,代码行数:14,代码来源:AWSXRayServletFilter.java

示例2: onError

import javax.servlet.AsyncEvent; //导入方法依赖的package包/类
@Override
public void onError(AsyncEvent arg0) throws IOException {

    // 也要返回合理的错误信息
    try {
        OutputStream os = ac.getResponse().getOutputStream();
        HttpClientCallbackResult result = new HttpClientCallbackResult(null, os);
        HttpAsyncException exp = new HttpAsyncException(HttpAsyncException.ExceptionEvent.REQASYNC_ERROR,
                arg0.getThrowable());
        result.setRetCode(getStatusCode());
        result.setException(exp);
        callback.failed(result);
    }
    catch (RuntimeException e) {
        // ignore
    }
}
 
开发者ID:uavorg,项目名称:uavstack,代码行数:18,代码来源:AsyncReqProcWithHttpClientCallback.java

示例3: onTimeout

import javax.servlet.AsyncEvent; //导入方法依赖的package包/类
@Override
public void onTimeout(AsyncEvent arg0) throws IOException {

    // 超时,也要返回合理的错误信息
    try {
        OutputStream os = ac.getResponse().getOutputStream();
        HttpClientCallbackResult result = new HttpClientCallbackResult(null, os);
        HttpAsyncException exp = new HttpAsyncException(HttpAsyncException.ExceptionEvent.REQASYNC_TIMEOUT,
                arg0.getThrowable());
        result.setRetCode(getStatusCode());
        result.setException(exp);
        callback.failed(result);
    }
    catch (RuntimeException e) {
        // ignore
    }
}
 
开发者ID:uavorg,项目名称:uavstack,代码行数:18,代码来源:AsyncReqProcWithHttpClientCallback.java

示例4: customizeEvent

import javax.servlet.AsyncEvent; //导入方法依赖的package包/类
private AsyncEvent customizeEvent(AsyncEvent event) {
    if (servletRequest != null && servletResponse != null) {
        return new AsyncEvent(event.getAsyncContext(), servletRequest, servletResponse,
                event.getThrowable());
    } else {
        return event;
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:9,代码来源:AsyncListenerWrapper.java

示例5: customizeEvent

import javax.servlet.AsyncEvent; //导入方法依赖的package包/类
private AsyncEvent customizeEvent(AsyncEvent event) {
	if (servletRequest != null && servletResponse != null) {
		return new AsyncEvent(event.getAsyncContext(), servletRequest, servletResponse, event.getThrowable());
	} else {
		return event;
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:AsyncListenerWrapper.java

示例6: onServletError

import javax.servlet.AsyncEvent; //导入方法依赖的package包/类
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
@Override
public void onServletError(AsyncEvent asyncEvent) throws IOException {
    System.err.println("onServletError()");
    if (asyncEvent.getThrowable() != null) {
        asyncEvent.getThrowable().printStackTrace(System.err);
    }
    servletError.countDown();
    super.onServletError(asyncEvent);
}
 
开发者ID:signicat,项目名称:hystrix-servlet,代码行数:11,代码来源:AsyncWrapperServletTest.java

示例7: onError

import javax.servlet.AsyncEvent; //导入方法依赖的package包/类
@Override
public void onError(AsyncEvent event) throws IOException {
	Throwable t = event.getThrowable();
	logger.error("Async response error", t);
	sendServerError(t.getMessage());
	asyncContext.complete();
}
 
开发者ID:sfera-labs,项目名称:sfera,代码行数:8,代码来源:HttpResponse.java

示例8: onError

import javax.servlet.AsyncEvent; //导入方法依赖的package包/类
@Override
public void onError(AsyncEvent event) throws IOException {
    String error = (event.getThrowable() == null ? "UNKNOWN ERROR" : event.getThrowable().getMessage());
    logger.error("Error in async request " + error);
    handleTimeoutOrError(event, "Error processing " + error);
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:7,代码来源:AsyncDispatcherServlet.java


注:本文中的javax.servlet.AsyncEvent.getThrowable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。