Package de.bmiag.tapir.util.scope
Class ThreadScopeContext
- java.lang.Object
-
- de.bmiag.tapir.util.scope.ThreadScopeContext
-
public class ThreadScopeContext extends java.lang.Object
The context of a thread.- Since:
- 2.0.0
- Author:
- Oliver Libutzki <[email protected]>
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>
beans
protected java.util.Map<java.lang.String,java.lang.Runnable>
destructionCallbacks
-
Constructor Summary
Constructors Constructor Description ThreadScopeContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears beans and processes all bean destruction callbacks.void
registerDestructionCallback(java.lang.String name, java.lang.Runnable callback)
Register the given callback as to be executed after request completion.
-
-
-
Method Detail
-
registerDestructionCallback
public final void registerDestructionCallback(java.lang.String name, java.lang.Runnable callback)
Register the given callback as to be executed after request completion.- Parameters:
name
- The name of the bean.callback
- The callback of the bean to be executed for destruction.- Since:
- 2.0.0
-
clear
public final void clear()
Clears beans and processes all bean destruction callbacks.- Since:
- 2.0.0
-
-