public class PerThreadOperationTracker extends java.lang.Object implements OperationTracker
Constructor and Description |
---|
PerThreadOperationTracker(org.slf4j.Logger logger) |
Modifier and Type | Method and Description |
---|---|
<T> T |
invoke(java.lang.String description,
Invokable<T> operation)
As with
OperationTracker.run(String, Runnable) , but the operation may return a value. |
<T> T |
perform(java.lang.String description,
IOOperation<T> operation)
As with
OperationTracker.invoke(String, Invokable) , but the operation may throw an IOException . |
void |
run(java.lang.String description,
java.lang.Runnable operation)
Executes the operation.
|
public PerThreadOperationTracker(org.slf4j.Logger logger)
public void run(java.lang.String description, java.lang.Runnable operation)
OperationTracker
RuntimeException
it will be logged and rethrown
wrapped as a OperationException
.run
in interface OperationTracker
description
- used if there is an exceptionoperation
- to executepublic <T> T invoke(java.lang.String description, Invokable<T> operation)
OperationTracker
OperationTracker.run(String, Runnable)
, but the operation may return a value.invoke
in interface OperationTracker
description
- used if there is an exceptionoperation
- to invokepublic <T> T perform(java.lang.String description, IOOperation<T> operation) throws java.io.IOException
OperationTracker
OperationTracker.invoke(String, Invokable)
, but the operation may throw an IOException
.perform
in interface OperationTracker
description
- used if there is an exception (outside of IOException)operation
- to performjava.io.IOException
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.