Package 

Interface IServiceProvider


  • 
    public interface IServiceProvider
    
                        

    A service provider gives access to the implementations of a service.

    • Method Summary

      Modifier and Type Method Description
      abstract <T extends Any> Boolean hasService(Class<T> c) Determine if the service provide has the provided service.
      abstract <T extends Any> T getService(Class<T> c) Retrieve the service that is a T.
      abstract <T extends Any> T getServiceOrNull(Class<T> c) Retrieve the service that is a T.
      abstract <T extends Any> List<T> getAllServices(Class<T> c) Retrieve the list of services that are a T.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getService

         abstract <T extends Any> T getService(Class<T> c)

        Retrieve the service that is a T. If multiple services exist, the last one registered will be returned. If no service exists, an exception will be thrown.

        Parameters:
        c - The class type of the service that is to be retrieved.
      • getServiceOrNull

         abstract <T extends Any> T getServiceOrNull(Class<T> c)

        Retrieve the service that is a T. If multiple services exist, the last one registered will be returned. If no service exists, null will be returned.

        Parameters:
        c - The class type of the service that is to be retrieved.
      • getAllServices

         abstract <T extends Any> List<T> getAllServices(Class<T> c)

        Retrieve the list of services that are a T. If no service exists, an empty list will be returned.

        Parameters:
        c - The class type of the services that are to be retrieved.