Interface APIProvider

  • All Known Implementing Classes:
    DefaultAPIProvider

    public interface APIProvider
    To keep our dependencies simple in the current Openstack4J, we utilize ServiceLoader to load a provider who is responsible for loading the implementation for any of the defined API interfaces. This allows us to avoid pulling in extra 3rd party dependencies such as Guice, Inject, etc. It also allows us flexibility on the provider which may be overriden and choose to bind modules and simple delegate out the get(Class) calls
    Author:
    Jeremy Unruh
    • Method Detail

      • initialize

        void initialize()
        Called after the APIProvider is constructed. This allows the provider to pre-initialize or bind any interface implementations if desired
      • get

        <T> T get​(Class<T> api)
        Gets the implementation for the specified interface type
        Type Parameters:
        T - the Openstack4j API type
        Parameters:
        api - the API interface
        Returns:
        the implementation for T
        Throws:
        ApiNotFoundException - if the API cannot be found