Package org.apache.hadoop.lib.lang
Class RunnableCallable
java.lang.Object
org.apache.hadoop.lib.lang.RunnableCallable
Adapter class that allows
Runnables and Callables to
be treated as the other.-
Constructor Summary
ConstructorsConstructorDescriptionRunnableCallable(Runnable runnable) Constructor that takes a runnable.RunnableCallable(Callable<?> callable) Constructor that takes a callable. -
Method Summary
-
Constructor Details
-
RunnableCallable
Constructor that takes a runnable.- Parameters:
runnable- runnable.
-
RunnableCallable
Constructor that takes a callable.- Parameters:
callable- callable.
-
-
Method Details
-
call
Invokes the wrapped callable/runnable as a callable. -
run
public void run()Invokes the wrapped callable/runnable as a runnable.- Specified by:
runin interfaceRunnable- Throws:
RuntimeException- thrown by the wrapped callable/runnable invocation.
-
toString
Returns the class name of the wrapper callable/runnable.
-