Interface PerthreadManager

  • All Known Implementing Classes:

    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.
    • Method Detail

      • addThreadCleanupCallback

        void addThreadCleanupCallback​(java.lang.Runnable callback)
        Adds a callback to be invoked when cleanup() is invoked; callbacks are then removed.
        callback -
      • cleanup

        void cleanup()
        Immediately performs a cleanup of the thread, invoking all callback, then discarding all per-thread data stored by the manager (including the list of callbacks).
      • run

        void run​(java.lang.Runnable runnable)
        Invokes, providing a try...finally to cleanup after.
      • invoke

        <T> T invoke​(Invokable<T> invokable)
        Returns the result from the invocation, providing a try...finally to cleanup after.