Interface Dependency

  • All Superinterfaces:
    Value<java.lang.Object>
    All Known Implementing Classes:
    OptionalDependency, ServiceRegistrationImpl

    interface Dependency
    extends Value<java.lang.Object>
    AbstractDependency represents the dependencies of a service. The counterpart of this dependency relation is AbstractDependent.
    See Also:
    Dependent
    • Method Detail

      • addDependent

        void addDependent​(Dependent dependent)
        Add a dependent to this dependency, establishing the dependency relation between this dependency and its dependent. This method must not be called under a lock.
        Parameters:
        dependent - the dependent to add
      • removeDependent

        void removeDependent​(Dependent dependent)
        Remove a dependent from this dependency, breaking the dependency relation between this dependency and its dependent. This method must not be called under a lock.
        Parameters:
        dependent - the dependent to remove
      • addDemand

        void addDemand()
        Notify that a dependent entered active mode. This method must not be called under a lock.
      • removeDemand

        void removeDemand()
        Notify that a dependent left active mode. This method must not be called under a lock.
      • dependentStarted

        void dependentStarted()
        Notify that a dependent is starting. This method must not be called under a lock.
      • dependentStopped

        void dependentStopped()
        Notify that a dependent is stopping. This method must not be called under a lock.
      • getValue

        java.lang.Object getValue()
                           throws java.lang.IllegalStateException
        Get the installed instance value, if any exists.
        Specified by:
        getValue in interface Value<java.lang.Object>
        Returns:
        the installed service value
        Throws:
        java.lang.IllegalStateException - if an error occurs
      • getName

        ServiceName getName()
        Get the name of this dependency.
        Returns:
        the name
      • getDependencyController

        ServiceControllerImpl<?> getDependencyController()
        Get the controller for this dependency, or null if there is none currently.
        Returns:
        the controller, or null for none