Class 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  
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • beans

        protected final java.util.Map<java.lang.String,​java.lang.Object> beans
        Since:
        2.0.0
      • destructionCallbacks

        protected final java.util.Map<java.lang.String,​java.lang.Runnable> destructionCallbacks
        Since:
        2.0.0
    • Constructor Detail

      • ThreadScopeContext

        public ThreadScopeContext()
    • 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