org.dvb.spi
Class ProviderRegistry

java.lang.Object
  extended by org.dvb.spi.ProviderRegistry

public class ProviderRegistry
extends java.lang.Object

Registry of providers.

Since:
MHP 1.1.3

Method Summary
 java.lang.String[] getInstalledProviders()
          Return the names of all installed providers.
static ProviderRegistry getInstance()
          Return the singleton provider registry as seen by the calling application.
 java.lang.String getProviderVersion(java.lang.String provider)
          Return the version of an installed provider.
 void registerSystemBound(SystemBoundProvider p)
          Registers a provider.
 void registerXletBound(XletBoundProvider p)
          Registers a provider.
 void unregister(Provider p)
          Unregister a provider.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ProviderRegistry getInstance()
Return the singleton provider registry as seen by the calling application.

Returns:
the provider registry

registerXletBound

public void registerXletBound(XletBoundProvider p)
                       throws ProviderFailedInstallationException
Registers a provider. Note that providers might be installed "automatically" by the terminal, e.g. due to signalling.

Parameters:
p - the provider to register
Throws:
java.lang.IllegalArgumentException - if Provider does not export a valid set of services as determined by Provider.getServiceProviderInterfaces(), or if the provider does not have have a non-null Xlet context.
ProviderFailedInstallationException - if the organisation_id in the name of the provider does not match the organisation_id in a certificate which can authenticate the provider class.
java.lang.SecurityException - if the caller, for all of the SPIs implemented by the provider, does not have a ProviderPermission whose name is the fully qualified name of the class returned by Provider getServiceProviderInterfaces and whose action is "xlet".
See Also:
Provider.getServiceProviderInterfaces(), XletBoundProvider.getBoundXletContext(), XletBoundProvider.getBoundPBPXletContext()

registerSystemBound

public void registerSystemBound(SystemBoundProvider p)
                         throws ProviderFailedInstallationException
Registers a provider. Note that providers might be installed "automatically" by the terminal, e.g. due to signalling.

Parameters:
p - the provider to register
Throws:
java.lang.IllegalArgumentException - if Provider does not expoort a valid set of services as determined by Provider.getServiceProviderInterfaces()
ProviderFailedInstallationException - if the organisation_id in the name of the provider does not match the organisation_id in a certificate which can authenticate the provider class.
java.lang.SecurityException - if the caller, for all of the SPIs implemented by the provider, does not have a ProviderPermission whose name is the fully qualified name of the class returned by Provider getServiceProviderInterfaces and whose action is "system".
See Also:
Provider.getServiceProviderInterfaces()

unregister

public void unregister(Provider p)
Unregister a provider. Xlets that "manually" register a provider using one of the register methods of this class shall unregister that provider before returning from a successful destroyXlet call.

Parameters:
p - the provider to unregister
See Also:
Xlet.destroyXlet(boolean)

getInstalledProviders

public java.lang.String[] getInstalledProviders()
Return the names of all installed providers. These are the names returned by the getName methods on those Providers. Provider names shall be encoded as defined for permission request file in the main body of the present document. For example "0x0000000B.EMV_PK11.VISA_REVOLVER".

Returns:
the names of all installed providers
See Also:
Provider.getName()

getProviderVersion

public java.lang.String getProviderVersion(java.lang.String provider)
Return the version of an installed provider.

Parameters:
provider - the name of a provider as returned by the method getInstalledProviders
Returns:
the version of the specified provider
Throws:
java.lang.IllegalArgumentException - if the provider name is not one of those installed, i.e. is not one returned from a call to getInstalledProviders
See Also:
Provider.getVersion()