Class AbstractService<T>

  • Type Parameters:
    T - the value type
    All Implemented Interfaces:
    Service, Service<T>, Value<T>

    @Deprecated
    public abstract class AbstractService<T>
    extends Object
    implements Service<T>
    Deprecated.
    use Service instead. This class will be removed in a future release.
    An abstract service class which provides default implementations.
    Author:
    David M. Lloyd
    • Constructor Detail

      • AbstractService

        public AbstractService()
        Deprecated.
    • Method Detail

      • start

        public void start​(StartContext context)
                   throws StartException
        Deprecated.
        Start the service. Do not return until the service has been fully started, unless an asynchronous service start is performed. All injections will be complete before this method is called.

        If the service start involves any activities that may block, the asynchronous mechanism provided by the context should be used. See the class javadoc for details. This implementation does nothing.

        Specified by:
        start in interface Service
        Specified by:
        start in interface Service<T>
        Parameters:
        context - the context which can be used to trigger an asynchronous service start
        Throws:
        StartException - if the service could not be started for some reason
      • stop

        public void stop​(StopContext context)
        Deprecated.
        Stop the service. Do not return until the service has been fully stopped, unless an asynchronous service stop is performed. All injections will remain intact until the service is fully stopped. This method should not throw an exception.

        If the service start involves any activities that may block, the asynchronous mechanism provided by the context should be used. See the class javadoc for details. This implementation does nothing.

        Specified by:
        stop in interface Service
        Specified by:
        stop in interface Service<T>
        Parameters:
        context - the context which can be used to trigger an asynchronous service stop
      • getValue

        public T getValue()
                   throws IllegalStateException
        Deprecated.
        Get the actual dependency value. This implementation returns null.
        Specified by:
        getValue in interface Value<T>
        Returns:
        the actual dependency value
        Throws:
        IllegalStateException - if the value is time-sensitive and the current state does not allow retrieval.