Class StartableLifecycleStrategy

    • Constructor Detail

      • StartableLifecycleStrategy

        public StartableLifecycleStrategy​(ComponentMonitor monitor)
    • Method Detail

      • getDisposeMethodName

        protected String getDisposeMethodName()
        Retrieve the lifecycle method name that represents the dispose method.
        Returns:
        the dispose method name. ('dispose')
      • getStopMethodName

        protected String getStopMethodName()
        Retrieve the lifecycle method name that represents the stop method.
        Returns:
        the stop method name ('stop')
      • getStartMethodName

        protected String getStartMethodName()
        Retrieve the lifecycle method name that represents the start method.
        Returns:
        the stop method name ('start')
      • start

        public void start​(Object component)
        Invoke the "start" method on the component instance if this is startable. It is up to the implementation of the strategy what "start" and "startable" means.
        Parameters:
        component - the instance of the component to start
      • startComponent

        protected void startComponent​(Object component)
      • stopComponent

        protected void stopComponent​(Object component)
      • disposeComponent

        protected void disposeComponent​(Object component)
      • stop

        public void stop​(Object component)
        Invoke the "stop" method on the component instance if this is stoppable. It is up to the implementation of the strategy what "stop" and "stoppable" means.
        Parameters:
        component - the instance of the component to stop
      • dispose

        public void dispose​(Object component)
        Invoke the "dispose" method on the component instance if this is disposable. It is up to the implementation of the strategy what "dispose" and "disposable" means.
        Parameters:
        component - the instance of the component to dispose
      • hasLifecycle

        public boolean hasLifecycle​(Class<?> type)
        Test if a component instance has a lifecycle.
        Parameters:
        type - the component's type
        Returns:
        true if the component has a lifecycle
      • getDisposableInterface

        protected Class getDisposableInterface()
      • getStartableInterface

        protected Class getStartableInterface()