Interface StorkServiceRegistry


  • public interface StorkServiceRegistry
    The central API of Stork
    • Method Detail

      • getService

        Service getService​(String serviceName)
        Retrieves the Service associated with the given name.
        Parameters:
        serviceName - the service name, must not be null
        Returns:
        the service
        Throws:
        NoSuchServiceDefinitionException - if there is no service associated with the given name.
      • defineIfAbsent

        StorkServiceRegistry defineIfAbsent​(String name,
                                            ServiceDefinition definition)
        Adds a service to the list of services managed by Stork. The service is only added if there is no service with that name already defined. Otherwise, the service definition is ignored.
        Parameters:
        name - the service name, must not be null or blank
        definition - the definition, must not be null
        Returns:
        the Stork instance. // TODO Define exception.
      • getServices

        Map<String,​Service> getServices()
        Returns:
        all the services managed by Stork. The returned map is immutable.