Package loci.common.services
Class ServiceFactory
java.lang.Object
loci.common.services.ServiceFactory
Runtime instantiation of services.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor loading service configuration from the default location.ServiceFactory(String path) Constructor loading service configuration from a given location. -
Method Summary
Modifier and TypeMethodDescription<T extends Service>
TgetInstance(Class<T> type) Retrieves an instance of a given service.
-
Constructor Details
-
ServiceFactory
Constructor loading service configuration from the default location.- Throws:
DependencyException- If there is an error locating or reading from the default configuration location.
-
ServiceFactory
Constructor loading service configuration from a given location.- Parameters:
path- Location to load service configuration from.- Throws:
DependencyException- If there is an error locating or reading frompath.
-
-
Method Details
-
getInstance
Retrieves an instance of a given service.- Type Parameters:
T- generic service type- Parameters:
type- Interface type of the service.- Returns:
- A newly instantiated service.
- Throws:
DependencyException- If there is an error instantiating the service instance requested.
-