Package org.apache.tapestry5.ioc
Interface OperationTracker
-
- All Known Subinterfaces:
ComponentPageElementResources,InternalRegistry
- All Known Implementing Classes:
ComponentPageElementResourcesImpl,OperationTrackerImpl,PerThreadOperationTracker,QuietOperationTracker,RegistryImpl
public interface OperationTracker
Used to track some set of operations in such a way that a failure (a thrown RuntimeException) will be logged along with a trace of the stack of operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceOperationTracker.NonLoggableExceptionAnnotation to be be used in exception classes whose instances are not meant to be logged in OperationTracker.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Tinvoke(java.lang.String description, Invokable<T> operation)As withrun(String, Runnable), but the operation may return a value.<T> Tperform(java.lang.String description, IOOperation<T> operation)As withinvoke(String, Invokable), but the operation may throw anIOException.voidrun(java.lang.String description, java.lang.Runnable operation)Executes the operation.
-
-
-
Method Detail
-
run
void run(java.lang.String description, java.lang.Runnable operation)
Executes the operation. If the operation throws aRuntimeExceptionit will be logged and rethrown wrapped as aOperationException.- Parameters:
description- used if there is an exceptionoperation- to execute
-
invoke
<T> T invoke(java.lang.String description, Invokable<T> operation)
As withrun(String, Runnable), but the operation may return a value.- Parameters:
description- used if there is an exceptionoperation- to invoke- Returns:
- result of operation
-
perform
<T> T perform(java.lang.String description, IOOperation<T> operation) throws java.io.IOException
As withinvoke(String, Invokable), but the operation may throw anIOException.- Parameters:
description- used if there is an exception (outside of IOException)operation- to perform- Returns:
- result of operation
- Throws:
java.io.IOException- Since:
- 5.4
-
-