Package com.oorian
Class OorianThreadMonitor
java.lang.Object
com.oorian.OorianThreadMonitor
Static utility class for monitoring thread completion events.
OorianThreadMonitor provides a mechanism for components to be notified when request processing threads complete their work. Listeners are stored as weak references to prevent memory leaks.
This is typically called by OorianServlet after completing
request processing to allow cleanup of thread-specific resources.
Usage:
OorianThreadMonitor.registerListener(() -> {
// Perform cleanup when thread completes
ThreadLocalResource.cleanup();
});
- Since:
- 2025
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidregisterListener(OorianThreadListener listener) Registers a listener to be notified when threads complete.static voidNotifies all registered listeners that the current thread has completed.
-
Constructor Details
-
OorianThreadMonitor
public OorianThreadMonitor()
-
-
Method Details
-
registerListener
Registers a listener to be notified when threads complete.The listener is stored as a weak reference and will be automatically removed when no longer strongly referenced elsewhere.
- Parameters:
listener- the listener to register
-
threadComplete
public static void threadComplete()Notifies all registered listeners that the current thread has completed.Called by the framework after request processing is finished.
-