edu.internet2.middleware.grouper.util
Class GrouperCallable<T>

java.lang.Object
  extended by edu.internet2.middleware.grouper.util.GrouperCallable<T>
Type Parameters:
T -
All Implemented Interfaces:
java.util.concurrent.Callable<T>

public abstract class GrouperCallable<T>
extends java.lang.Object
implements java.util.concurrent.Callable<T>


Constructor Summary
GrouperCallable(java.lang.String theLogLabel)
          construct with log label, use the static session if it exists
GrouperCallable(java.lang.String theLogLabel, GrouperSession theGrouperSession)
           
 
Method Summary
 T call()
           
abstract  T callLogic()
          Computes a result
 T callLogicWithSessionIfExists()
          Computes a result
 java.lang.String getLogLabel()
          describes the callable
static void throwRuntimeException(java.lang.Throwable throwable)
          convert exception
static void tryCallablesWithProblems(java.util.Collection<GrouperCallable> callablesWithProblems)
          note, call this in your grouper session, this runs in current thread
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrouperCallable

public GrouperCallable(java.lang.String theLogLabel,
                       GrouperSession theGrouperSession)
Parameters:
theGrouperSession -
theLogLabel -

GrouperCallable

public GrouperCallable(java.lang.String theLogLabel)
construct with log label, use the static session if it exists

Parameters:
theLogLabel -
Method Detail

getLogLabel

public java.lang.String getLogLabel()
describes the callable

Returns:
the logLabel

tryCallablesWithProblems

public static void tryCallablesWithProblems(java.util.Collection<GrouperCallable> callablesWithProblems)
note, call this in your grouper session, this runs in current thread

Parameters:
callablesWithProblems -

throwRuntimeException

public static void throwRuntimeException(java.lang.Throwable throwable)
convert exception

Parameters:
throwable -

call

public final T call()
             throws java.lang.Exception
Specified by:
call in interface java.util.concurrent.Callable<T>
Throws:
java.lang.Exception
See Also:
Callable.call()

callLogicWithSessionIfExists

public final T callLogicWithSessionIfExists()
Computes a result

Returns:
computed result

callLogic

public abstract T callLogic()
Computes a result

Returns:
computed result