@Override public void cancel() { if (delegate != null) { delegate.cancel(); } else { cancelled = true; } }
@Override public void cancel() { if (delegate != null) { delegate.cancel(); } else { cancelled = true; } }
@Override public void cancel() { if (delegate != null) { delegate.cancel(); } else { cancelled = true; } }
@Override public void cancel() { request.cancel(); }
@Override public void cancel() { request.cancel(); }
@Override public void cancel() { request.cancel(); }
/** * Assign the delegated {@link DispatchRequest} for this object. * <p/> * If the code that requested the command to be executed has already chosen to cancel the {@link DispatchRequest}, * the {@link DispatchRequest} that has been passed will be immediately cancelled. * * @param delegate The {@link DispatchRequest} object. */ public void setDelegate(DispatchRequest delegate) { if (cancelled) { if (delegate != null) { this.delegate.cancel(); } } else { if (delegate == null) { throw new NullPointerException("delegate"); } if (this.delegate != null) { throw new RuntimeException("Delegate can only be set once."); } this.delegate = delegate; } }
/** * Populates the {@link DelegatingDispatchRequest} object with a {@link DispatchRequest}. * <p/> * If the code that requested the command to be executed has already chosen to cancel the {@link DispatchRequest}, * the {@link DispatchRequest} that has been passed will be immediately cancelled. * * @param delegate The {@link DispatchRequest} object. */ public void setDelegate(DispatchRequest delegate) { if (cancelled) { if (delegate != null) { this.delegate.cancel(); } } else { if (delegate == null) { throw new NullPointerException("delegate"); } if (this.delegate != null) { throw new RuntimeException("Delegate can only be set once."); } this.delegate = delegate; } }
/** * Populates the {@link DelegatingDispatchRequest} object with a * {@link DispatchRequest}. <p/> If the code that requested the command to be * executed has already chosen to cancel the {@link DispatchRequest}, the * {@link DispatchRequest} that has been passed will be immediately cancelled. * * @param delegate The {@link DispatchRequest} object. */ public void setDelegate(DispatchRequest delegate) { if (cancelled) { if (delegate != null) { this.delegate.cancel(); } } else { if (delegate == null) { throw new NullPointerException("delegate"); } if (this.delegate != null) { throw new RuntimeException("Delegate can only be set once."); } this.delegate = delegate; } }