Class DestroyableManager

  • All Implemented Interfaces:
    java.lang.Runnable

    public class DestroyableManager
    extends java.lang.Object
    implements java.lang.Runnable
    Manage destroyable instances. Implements Runnable to be used as shutdown hook.
    Since:
    30.06.2014
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      Called on context shutdown to call all registered destroyable instances.
      void register​(Destroyable destroyable)
      Register destroyable instance to be called on context shutdown.
      void run()  
      • Methods inherited from class java.lang.Object

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

      • DestroyableManager

        public DestroyableManager()
    • Method Detail

      • destroy

        public void destroy()
        Called on context shutdown to call all registered destroyable instances. By default called on jvm shutdown, but may be called manually to synchronise with some other container shutdown (e.g. web container) Safe to call many times, but all destroy instances will be processed only on first call. Thread safe.
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable