Class AnnotatedMethodDestroyable

  • All Implemented Interfaces:
    Destroyable

    public class AnnotatedMethodDestroyable
    extends java.lang.Object
    implements Destroyable
    Destroyable annotation used to call @PostConstruct annotated methods on context destroy.
    Since:
    30.06.2014
    • Constructor Summary

      Constructors 
      Constructor Description
      AnnotatedMethodDestroyable​(java.lang.reflect.Method method, java.lang.Object instance)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void preDestroy()
      Called on context shutdown (by default on jvm shutdown), but may be called manually through destroy manager ru.vyarus.guice.ext.managed.destroyable.DestroyableManager#destroy().
      • Methods inherited from class java.lang.Object

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

      • AnnotatedMethodDestroyable

        public AnnotatedMethodDestroyable​(java.lang.reflect.Method method,
                                          java.lang.Object instance)
    • Method Detail

      • preDestroy

        public void preDestroy()
                        throws java.lang.Exception
        Description copied from interface: Destroyable
        Called on context shutdown (by default on jvm shutdown), but may be called manually through destroy manager ru.vyarus.guice.ext.managed.destroyable.DestroyableManager#destroy(). Will be called one time no matter how many time destroy will be asked by manager. It is safe to avoid explicit exception handling (except special cases required by logic).
        Specified by:
        preDestroy in interface Destroyable
        Throws:
        java.lang.Exception - on any unrecoverable error