Class LifecycleManager

    • Field Detail

      • lifecycles

        private final java.util.Map<java.lang.Class<?>,​BeanLifecycle> lifecycles
      • stoppableBeans

        private final java.util.Deque<java.lang.Object> stoppableBeans
    • Constructor Detail

      • LifecycleManager

        public LifecycleManager()
    • Method Detail

      • manage

        public boolean manage​(java.lang.Class<?> clazz)
        Description copied from interface: BeanManager
        Decides whether instances of the given bean type should be reported to this manager.
        Specified by:
        manage in interface BeanManager
        Parameters:
        clazz - The bean type
        Returns:
        true if instances of the bean should be reported; otherwise false
      • manage

        public PropertyBinding manage​(BeanProperty<?> property)
        Description copied from interface: BeanManager
        Asks this manager to manage the given bean property.
        Specified by:
        manage in interface BeanManager
        Parameters:
        property - The bean property
        Returns:
        Non-null binding if the bean property was managed; otherwise null
      • manage

        public boolean manage​(java.lang.Object bean)
        Description copied from interface: BeanManager
        Asks this manager to manage the given bean instance.
        Specified by:
        manage in interface BeanManager
        Parameters:
        bean - The bean instance
        Returns:
        true if the bean instance was managed; otherwise false
      • unmanage

        public boolean unmanage​(java.lang.Object bean)
        Description copied from interface: BeanManager
        Asks this manager to unmanage the given bean instance.
        Specified by:
        unmanage in interface BeanManager
        Parameters:
        bean - The bean instance
        Returns:
        true if the bean instance was unmanaged; otherwise false
      • unmanage

        public boolean unmanage()
        Description copied from interface: BeanManager
        Asks this manager to unmanage all the bean instances it knows about.
        Specified by:
        unmanage in interface BeanManager
        Returns:
        true if any bean instances were unmanaged; otherwise false
      • activate

        protected void activate​(java.lang.Object bean)
        Description copied from class: BeanScheduler
        Customized activation of the given bean.
        Specified by:
        activate in class BeanScheduler
        Parameters:
        bean - The bean to activate
      • buildLifecycle

        private boolean buildLifecycle​(java.lang.Class<?> clazz)
        Attempts to build a JSR250 lifecycle for the given bean type.
        Parameters:
        clazz - The bean type
        Returns:
        true if the bean defines a lifecycle; otherwise false
      • lifecycleFor

        private BeanLifecycle lifecycleFor​(java.lang.Object bean)
        Looks up the JSR250 lifecycle previously built for this bean.
        Parameters:
        bean - The bean instance
        Returns:
        Lifecycle for the bean
      • pushStoppable

        private void pushStoppable​(java.lang.Object bean)
      • removeStoppable

        private boolean removeStoppable​(java.lang.Object bean)
      • popStoppable

        private java.lang.Object popStoppable()