public abstract class IIOServiceProvider extends Objectimplements RegisterableService
IIORegistry class.
| Modifier and Type | Field and Description |
|---|---|
protected String |
vendorName
A
String to be returned from
getVendorName, initially
null.
|
protected String |
version
A
String to be returned from
getVersion, initially null.
|
| Constructor and Description |
|---|
IIOServiceProvider()
Constructs a blank
IIOServiceProvider.
|
IIOServiceProvider(String
Constructs an
IIOServiceProvider with a given vendor name and version identifier.
|
| Modifier and Type | Method and Description |
|---|---|
abstract String |
getDescription(Locale
Returns a brief, human-readable description of this service provider and its associated implementation.
|
String |
getVendorName()
Returns the name of the vendor responsible for creating this service provider and its associated implementation.
|
String |
getVersion()
Returns a string describing the version number of this service provider and its associated implementation.
|
void |
onDeregistration(ServiceRegistry
A callback that will be whenever the Spi class has been deregistered from a
ServiceRegistry.
|
void |
onRegistration(ServiceRegistry
A callback that will be called exactly once after the Spi class has been instantiated and registered in a
ServiceRegistry.
|
protected StringvendorName
String to be returned from
getVendorName, initially
null. Constructors should set this to a non-
null value.
protected Stringversion
String to be returned from
getVersion, initially null. Constructors should set this to a non-
null value.
public IIOServiceProvider(StringvendorName, String version)
IIOServiceProvider with a given vendor name and version identifier.
vendorName - the vendor name.
version - a version identifier.
IllegalArgumentException - if
vendorName is
null.
IllegalArgumentException - if
version is
null.
public IIOServiceProvider()
IIOServiceProvider. It is up to the subclass to initialize instance variables and/or override method implementations in order to ensure that the
getVendorName and
getVersion methods will return non-
null values.
public void onRegistration(ServiceRegistryregistry, Class <?> category)
ServiceRegistry. This may be used to verify that the environment is suitable for this service, for example that native libraries can be loaded. If the service cannot function in the environment where it finds itself, it should deregister itself from the registry.
Only the registry should call this method.
The default implementation does nothing.
onRegistration in interface
RegisterableService
registry - a
ServiceRegistry where this object has been registered.
category - a
Class object indicating the registry category under which this object has been registered.
ServiceRegistry.registerServiceProvider(Object provider)
public void onDeregistration(ServiceRegistryregistry, Class <?> category)
ServiceRegistry.
Only the registry should call this method.
The default implementation does nothing.
onDeregistration in interface
RegisterableService
registry - a
ServiceRegistry from which this object is being (wholly or partially) deregistered.
category - a
Class object indicating the registry category from which this object is being deregistered.
ServiceRegistry.deregisterServiceProvider(Object provider)
public StringgetVendorName()
The default implementation returns the value of the vendorName instance variable.
null
String containing the name of the vendor.
public StringgetVersion()
The default implementation returns the value of the version instance variable.
null
String containing the version of this service provider.
public abstract StringgetDescription(Locale locale)
Locale, if possible.
locale - a
Locale for which the return value should be localized.
String containing a description of this service provider.