Interface ServiceLocator

    • Method Detail

      • getSingletonService

        @NotNull
        <T> T getSingletonService​(@NotNull
                                  Class<T> serviceClass)
                           throws ServiceNotFoundException
        Searches for singleton service of specified type
        Parameters:
        serviceClass - type of the service
        Returns:
        found service, never null
        Throws:
        ServiceNotFoundException - if specified service was not found or if more than one service found
      • findSingletonService

        @Nullable
        <T> T findSingletonService​(@NotNull
                                   Class<T> serviceClass)
        Searches for singleton service of specified type
        Parameters:
        serviceClass - type of the service
        Returns:
        found service or null if there's no such service
        Throws:
        RuntimeException - if more than one service found
      • getServices

        @NotNull
        <T> Collection<T> getServices​(@NotNull
                                      Class<T> serviceClass)
        Searches for all bean instances of type
        Parameters:
        serviceClass - - type to search
        Returns:
        collection of classes that implements T