/** * 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); }