org.apache.tapestry5.ioc.internal
public class: PerThreadOperationTracker [javadoc |
source]
java.lang.Object
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker
All Implemented Interfaces:
OperationTracker
Manages a per-thread OperationTracker using a ThreadLocal.
| Method from org.apache.tapestry5.ioc.internal.PerThreadOperationTracker Summary: |
|---|
|
cleanup, get, invoke, run |
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.apache.tapestry5.ioc.internal.PerThreadOperationTracker Detail: |
synchronized void cleanup() {
if (perThread.get().isEmpty()) perThread.remove();
}
|
synchronized OperationTracker get() {
return perThread.get();
}
|
public T invoke(String description,
Invokable<T> operation) {
try
{
return get().invoke(description, operation);
}
finally
{
cleanup();
}
}
|
public void run(String description,
Runnable operation) {
try
{
get().run(description, operation);
}
finally
{
cleanup();
}
}
|