Interface ServiceRegistry

    • Method Detail

      • getParentServiceRegistry

        ServiceRegistry getParentServiceRegistry()
        Retrieve this registry's parent registry.
        Returns:
        The parent registry. May be null.
      • getService

        <R extends Service> R getService​(Class<R> serviceRole)
        Retrieve a service by role. If service is not found, but a ServiceInitiator is registered for this service role, the service will be initialized and returned.
        Type Parameters:
        R - The service role type
        Parameters:
        serviceRole - The service role
        Returns:
        The requested service or null if the service was not found.
        Throws:
        UnknownServiceException - Indicates the service was not known.
        API Note:
        We cannot return <R extends Service<T>> here because the service might come from the parent.
      • requireService

        default <R extends Service> R requireService​(Class<R> serviceRole)
        Retrieve a service by role. If service is not found, but a ServiceInitiator is registered for this service role, the service will be initialized and returned.
        Type Parameters:
        R - The service role type
        Parameters:
        serviceRole - The service role
        Returns:
        The requested service .
        Throws:
        UnknownServiceException - Indicates the service was not known.
        NullServiceException - Indicates the service was null.
        API Note:
        We cannot return <R extends Service<T>> here because the service might come from the parent.