Package org.openstack4j.api
Interface APIProvider
-
- All Known Implementing Classes:
DefaultAPIProvider
public interface APIProviderTo 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 theget(Class)calls- Author:
- Jeremy Unruh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Tget(Class<T> api)Gets the implementation for the specified interface typevoidinitialize()Called after the APIProvider is constructed.
-
-
-
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
-
-