goldengate.common.future
Class GgCompletedFuture

java.lang.Object
  extended by goldengate.common.future.GgFuture
      extended by goldengate.common.future.GgCompletedFuture
Direct Known Subclasses:
GgFailedFuture, GgSucceededFuture

public abstract class GgCompletedFuture
extends GgFuture

Future completed

Author:
Frederic Bregier

Constructor Summary
protected GgCompletedFuture()
           
 
Method Summary
 GgFuture await()
          Waits for this future to be completed.
 boolean await(long timeoutMillis)
          Waits for this future to be completed within the specified time limit.
 boolean await(long timeout, TimeUnit unit)
          Waits for this future to be completed within the specified time limit.
 GgFuture awaitUninterruptibly()
          Waits for this future to be completed without interruption.
 boolean awaitUninterruptibly(long timeoutMillis)
          Waits for this future to be completed within the specified time limit without interruption.
 boolean awaitUninterruptibly(long timeout, TimeUnit unit)
          Waits for this future to be completed within the specified time limit without interruption.
 boolean cancel()
          Cancels the operation associated with this future and notifies all listeners if canceled successfully.
 boolean isCancelled()
          Returns true if and only if this future was canceled by a GgFuture.cancel() method.
 boolean isDone()
          Returns true if and only if this future is complete, regardless of whether the operation was successful, failed, or canceled.
 boolean setFailure(Throwable cause)
          Marks this future as a failure and notifies all listeners.
 boolean setSuccess()
          Marks this future as a success and notifies all listeners.
 
Methods inherited from class goldengate.common.future.GgFuture
getCause, isFailed, isSuccess, rethrowIfFailed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GgCompletedFuture

protected GgCompletedFuture()
Method Detail

await

public GgFuture await()
               throws InterruptedException
Description copied from class: GgFuture
Waits for this future to be completed.

Overrides:
await in class GgFuture
Returns:
The GgFuture
Throws:
InterruptedException - if the current thread was interrupted

await

public boolean await(long timeout,
                     TimeUnit unit)
              throws InterruptedException
Description copied from class: GgFuture
Waits for this future to be completed within the specified time limit.

Overrides:
await in class GgFuture
Returns:
true if and only if the future was completed within the specified time limit
Throws:
InterruptedException - if the current thread was interrupted

await

public boolean await(long timeoutMillis)
              throws InterruptedException
Description copied from class: GgFuture
Waits for this future to be completed within the specified time limit.

Overrides:
await in class GgFuture
Returns:
true if and only if the future was completed within the specified time limit
Throws:
InterruptedException - if the current thread was interrupted

awaitUninterruptibly

public GgFuture awaitUninterruptibly()
Description copied from class: GgFuture
Waits for this future to be completed without interruption. This method catches an InterruptedException and discards it silently.

Overrides:
awaitUninterruptibly in class GgFuture
Returns:
The GgFuture

awaitUninterruptibly

public boolean awaitUninterruptibly(long timeout,
                                    TimeUnit unit)
Description copied from class: GgFuture
Waits for this future to be completed within the specified time limit without interruption. This method catches an InterruptedException and discards it silently.

Overrides:
awaitUninterruptibly in class GgFuture
Returns:
true if and only if the future was completed within the specified time limit

awaitUninterruptibly

public boolean awaitUninterruptibly(long timeoutMillis)
Description copied from class: GgFuture
Waits for this future to be completed within the specified time limit without interruption. This method catches an InterruptedException and discards it silently.

Overrides:
awaitUninterruptibly in class GgFuture
Returns:
true if and only if the future was completed within the specified time limit

isDone

public boolean isDone()
Description copied from class: GgFuture
Returns true if and only if this future is complete, regardless of whether the operation was successful, failed, or canceled.

Overrides:
isDone in class GgFuture
Returns:
True if the future is complete

setFailure

public boolean setFailure(Throwable cause)
Description copied from class: GgFuture
Marks this future as a failure and notifies all listeners.

Overrides:
setFailure in class GgFuture
Returns:
true if and only if successfully marked this future as a failure. Otherwise false because this future is already marked as either a success or a failure.

setSuccess

public boolean setSuccess()
Description copied from class: GgFuture
Marks this future as a success and notifies all listeners.

Overrides:
setSuccess in class GgFuture
Returns:
true if and only if successfully marked this future as a success. Otherwise false because this future is already marked as either a success or a failure.

cancel

public boolean cancel()
Description copied from class: GgFuture
Cancels the operation associated with this future and notifies all listeners if canceled successfully.

Overrides:
cancel in class GgFuture
Returns:
true if and only if the operation has been canceled. false if the operation can't be canceled or is already completed.

isCancelled

public boolean isCancelled()
Description copied from class: GgFuture
Returns true if and only if this future was canceled by a GgFuture.cancel() method.

Overrides:
isCancelled in class GgFuture
Returns:
True if the future was canceled


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.