|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PerthreadManager
Manages per-thread data, and provides a way for listeners to know when such data should be cleaned up. Typically, data is cleaned up at the end of the request (in a web application). Tapestry IoC has any number of objects that need to know when this event occurs, so that they can clean up any per-thread/per-request state.
Due to TAPESTRY-2141 (and the underlying JDK 1.5 bug 5025230), this service has expanded to manage per-thread data (not just end-of-request listeners).
| Method Summary | ||
|---|---|---|
void |
addThreadCleanupListener(ThreadCleanupListener listener)
Adds a listener to the hub. |
|
void |
cleanup()
Immediately performs a cleanup of the thread, notifying all listeners then discarding the thread locale and the map it stores. |
|
|
createValue()
Creates a value using a unique internal key. |
|
java.lang.Object |
get(java.lang.Object key)
Deprecated. use createValue() instead |
|
|
invoke(Invokable<T> invokable)
Returns the result from the invocation, providing a try...finally to cleanup after. |
|
void |
put(java.lang.Object key,
java.lang.Object value)
Deprecated. use createValue() instead |
|
void |
run(java.lang.Runnable runnable)
Invokes Runnable.run(), providing a try...finally to cleanup after. |
|
| Method Detail |
|---|
void addThreadCleanupListener(ThreadCleanupListener listener)
cleanup().
listener - to addvoid cleanup()
java.lang.Object get(java.lang.Object key)
createValue() instead
key - key used to retrieve object
void put(java.lang.Object key,
java.lang.Object value)
createValue() instead
<T> PerThreadValue<T> createValue()
void run(java.lang.Runnable runnable)
Runnable.run(), providing a try...finally to cleanup after.
<T> T invoke(Invokable<T> invokable)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||