define constant for timeout result

This commit is contained in:
Yasser Zamani
2017-12-24 12:10:50 +03:30
parent fb8f139b06
commit bffa47acf1
2 changed files with 7 additions and 1 deletions
@@ -27,6 +27,12 @@ import java.util.concurrent.Executor;
* @since 2.6
*/
public class AsyncAction implements Callable {
/**
* The action invocation was successful but did not return the result before timeout.
*/
public static final String TIMEOUT = "timeout";
private Callable callable;
private Long timeout;
private Executor executor;
@@ -132,7 +132,7 @@ public class DefaultAsyncManager implements AsyncManager, AsyncListener {
@Override
public void onTimeout(AsyncEvent asyncEvent) throws IOException {
LOG.debug("Processing timeout for " + asyncEvent.getAsyncContext());
setAsyncActionResultAndDispatch("timeout");
setAsyncActionResultAndDispatch(AsyncAction.TIMEOUT);
}
@Override