Interface ProviderRegistry
- All Known Implementing Classes:
ProviderRegistryImpl
public interface ProviderRegistry
The implementation of the factory registry used to store
the bundle registrations.
-
Method Summary
Modifier and TypeMethodDescriptiongetService
(String providerId) Locate and instantiate an instance of a service provider defined in the META-INF/services directory of tracked bundles.Class
<?> getServiceClass
(String providerId) Locate and return the class for a service provider defined in the META-INF/services directory of tracked bundles.getServiceClasses
(String providerId) Locate all services that match a given provider id and return the implementation classesgetServices
(String providerId) Locate all services that match a given provider id and create instances.Class
<?> Locate a class by its factory id indicator.Locate all class files that match a given factory id.
-
Method Details
-
locate
Locate a class by its factory id indicator. .- Parameters:
factoryId
- The factory id (generally, a fully qualified class name).- Returns:
- The Class corresponding to this factory id. Returns null if this is not registered or the indicated class can't be loaded.
-
locateAll
Locate all class files that match a given factory id.- Parameters:
factoryId
- The target factory identifier.- Returns:
- A List containing the class objects corresponding to the factory identifier. Returns an empty list if no matching classes can be located.
-
getService
Locate and instantiate an instance of a service provider defined in the META-INF/services directory of tracked bundles.- Parameters:
providerId
- The name of the target interface class.- Returns:
- The service instance. Returns null if no service defintions can be located.
- Throws:
Exception
- Any classloading or other exceptions thrown during the process of creating this service instance.
-
getServices
Locate all services that match a given provider id and create instances.- Parameters:
providerId
- The target provider identifier.- Returns:
- A List containing the instances corresponding to the provider identifier. Returns an empty list if no matching classes can be located or created
-
getServiceClass
Locate and return the class for a service provider defined in the META-INF/services directory of tracked bundles.- Parameters:
providerId
- The name of the target interface class.- Returns:
- The provider class. Returns null if no service defintions can be located.
- Throws:
Exception
- Any classloading or other exceptions thrown during the process of loading this service provider class.ClassNotFoundException
-
getServiceClasses
Locate all services that match a given provider id and return the implementation classes- Parameters:
providerId
- The target provider identifier.- Returns:
- A List containing the classes corresponding to the provider identifier. Returns an empty list if no matching classes can be located.
-