Class GrouperFuture<T>
java.lang.Object
edu.internet2.middleware.grouper.util.GrouperFuture<T>
- Type Parameters:
T
- type of return
- All Implemented Interfaces:
Future<T>
like a normal future but keeps a reference to the callable,
and exceptions are wrapped in RuntimeException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel
(boolean mayInterruptIfRunning) get()
if grouper callable, this is a convenience method for getting that typeboolean
boolean
isDone()
static boolean
waitForJob
(GrouperFuture<?> future, int secondsToWait) static void
waitForJob
(List<GrouperFuture> futures, int threadPoolSize, List<GrouperCallable> callablesWithProblems) relies on the callable being a GrouperCallable.
-
Constructor Details
-
GrouperFuture
- Parameters:
theFuture
-theCallable
-
-
-
Method Details
-
getCallable
- Returns:
- the grouperCallable
-
getGrouperCallable
if grouper callable, this is a convenience method for getting that type- Returns:
- the grouperCallable
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<T>
- See Also:
-
isDone
public boolean isDone() -
get
-
get
-
waitForJob
- Parameters:
future
-secondsToWait
- -1 to wait forever- Returns:
- true if done, false if not (can also call future.isDone(), and future.get())
-
waitForJob
public static void waitForJob(List<GrouperFuture> futures, int threadPoolSize, List<GrouperCallable> callablesWithProblems) relies on the callable being a GrouperCallable. make sure there arent more threads than the max. pass in 0 to wait for all.- Parameters:
futures
-threadPoolSize
-callablesWithProblems
- pass in a list to capture which jobs had problems. if null, then jsut throw exceptions as they happen
-