P
- type of the information providerS
- type of the provider servicepublic abstract class AbstractProviderRegistry<P extends Provider,S extends ProviderService<P>> extends java.lang.Object implements ProviderRegistry<P,S>
Constructor and Description |
---|
AbstractProviderRegistry() |
Modifier and Type | Method and Description |
---|---|
protected abstract S |
createProviderService(P provider)
Creates a new provider service bound to the specified provider.
|
protected P |
defaultProvider()
Returns the default fall-back provider.
|
protected P |
getProvider(DeviceId deviceId)
Returns the provider for the specified device ID based on URI scheme.
|
protected P |
getProvider(ProviderId providerId)
Returns the provider registered with the specified provider ID or null
if none is found for the given provider family and default fall-back is
not supported.
|
protected P |
getProvider(java.lang.String scheme)
Returns the provider registered with the specified scheme.
|
java.util.Set<ProviderId> |
getProviders()
Returns a set of currently registered provider identities.
|
S |
register(P provider)
Registers the supplied provider with the core.
|
void |
unregister(P provider)
Unregisters the supplied provider.
|
protected abstract S createProviderService(P provider)
provider
- providerprotected P defaultProvider()
public S register(P provider)
ProviderRegistry
register
in interface ProviderRegistry<P extends Provider,S extends ProviderService<P>>
provider
- provider to be registeredpublic void unregister(P provider)
ProviderRegistry
IllegalStateException
.
Unregistering a provider that has not been previously registered results in a no-op.
unregister
in interface ProviderRegistry<P extends Provider,S extends ProviderService<P>>
provider
- provider to be unregisteredpublic java.util.Set<ProviderId> getProviders()
ProviderRegistry
getProviders
in interface ProviderRegistry<P extends Provider,S extends ProviderService<P>>
protected P getProvider(ProviderId providerId)
providerId
- provider identifierprotected P getProvider(DeviceId deviceId)
deviceId
- device identifierprotected P getProvider(java.lang.String scheme)
scheme
- provider scheme