public class AsyncDelegateErrorCallback extends Object implements ErrorCallback<Message>
Constructor and Description |
---|
AsyncDelegateErrorCallback(HasAsyncTaskRef task,
ErrorCallback delegate)
Creates an error callback that optionally wraps another error callback.
|
Modifier and Type | Method and Description |
---|---|
boolean |
error(Message message,
Throwable throwable)
Cancels future executions of the task by calling
AsyncTask.cancel(boolean) on the AsyncTask that controls its execution. |
public AsyncDelegateErrorCallback(HasAsyncTaskRef task, ErrorCallback delegate)
task
- The task whose failures will be handled by this wrapper callback.
Must not be null.delegate
- The ErrorCallback that should be wrapped. Can be null, in which
case errors in executions of task
are logged to System.out.public boolean error(Message message, Throwable throwable)
AsyncTask.cancel(boolean)
on the AsyncTask that controls its execution.error
in interface ErrorCallback<Message>
message
- The message or request for which the failure occurred.throwable
- The exception thrown or null if not availableerror()
method. If there is no delegate, the return
value is always true
.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.