/** * Get the exception raised by a callback. Will always be null if the * callback has not been executed; will only be non-null after any success. * @return a callback */ public Exception getCallbackException() { return command.getException(); }
/** * Create an instance of the service * @param name service name * @param callback callback to invoke * @param delay delay -or 0 for no delay * @param terminate terminate this service after the callback? */ public WorkflowCallbackService(String name, Callable<V> callback, int delay, boolean terminate) { super(name); Preconditions.checkNotNull(callback, "Null callback argument"); this.callback = callback; this.delay = delay; command = new ServiceTerminatingCallable<V>( terminate ? this : null, callback); }
/** * Create an instance of the service * @param name service name * @param callback callback to invoke * @param delay delay -or 0 for no delay * @param terminate terminate this service after the callback? */ public WorkflowCallbackService(String name, Callable<V> callback, int delay, boolean terminate) { super(name); Preconditions.checkNotNull(callback, "Null callback argument"); this.callback = callback; this.delay = delay; command = new ServiceTerminatingCallable<V>( terminate ? this : null, callback); }
/** * Get the exception raised by a callback. Will always be null if the * callback has not been executed; will only be non-null after any success. * @return a callback */ public Exception getCallbackException() { return command.getException(); }