|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.perf4j.TimedCallable<V>
public class TimedCallable<V>
This helper wrapper class can be used to add timing statements to an existing Callable instance, logging how long it takes for the call method to execute. Note that instances of this class are only serializable if the wrapped Callable is serializable.
Constructor Summary | |
---|---|
TimedCallable(Callable<V> task,
LoggingStopWatch stopWatch)
Wraps the existing Callable in order to time its call method. |
Method Summary | |
---|---|
V |
call()
Executes the call method of the underlying task, using the LoggingStopWatch to track the execution time. |
LoggingStopWatch |
getStopWatch()
Gets the LoggingStopWatch that will be used to time the call method execution. |
Callable<V> |
getWrappedTask()
Gets the Callable task that is wrapped by this TimedCallable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimedCallable(Callable<V> task, LoggingStopWatch stopWatch)
task
- The existing Callable whose call method is to be timed and executed. May not be null.stopWatch
- The LoggingStopWatch to use to time the call method execution. Note that this stop watch should
already have its tag and message set to what should be logged when the task is run. May not
be null.Method Detail |
---|
public Callable<V> getWrappedTask()
public LoggingStopWatch getStopWatch()
public V call() throws Exception
call
in interface Callable<V>
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |