Class Services
java.lang.Object
org.apache.harmony.security.fortress.Services
public class Services extends Object
This class contains information about all registered providers and preferred
implementations for all "serviceName.algName".
-
Constructor Summary
Constructors Constructor Description Services() -
Method Summary
Modifier and Type Method Description static intgetCacheVersion()Returns the current cache version.static ProvidergetProvider(String name)Returns the provider with the specified name.static Provider[]getProviders()Returns a copy of the registered providers as an array.static List<Provider>getProvidersList()Returns a copy of the registered providers as a list.static Provider.ServicegetSecureRandomService()Returns the default SecureRandom service description.static Provider.ServicegetService(String key)Looks up the requested service by type and algorithm.static voidinitServiceInfo(Provider p)Adds information about provider services into HashMap.static intinsertProviderAt(Provider provider, int position)Inserts a provider at a specified 1-based position.static booleanisEmpty()Returns true if services contain any provider information.static voidremoveProvider(int providerNumber)Removes the provider at the specified 1-based position.static voidsetNeedRefresh()In addition to being used here when the list of providers changes, this method is also used by the Provider implementation to indicate that a provides list of services has changed.
-
Constructor Details
-
Services
public Services()
-
-
Method Details
-
getProviders
Returns a copy of the registered providers as an array. -
getProvidersList
Returns a copy of the registered providers as a list. -
getProvider
Returns the provider with the specified name. -
insertProviderAt
Inserts a provider at a specified 1-based position. -
removeProvider
public static void removeProvider(int providerNumber)Removes the provider at the specified 1-based position. -
initServiceInfo
Adds information about provider services into HashMap. -
isEmpty
public static boolean isEmpty()Returns true if services contain any provider information. -
getService
Looks up the requested service by type and algorithm. The service key should be provided in the same format used when registering a service with a provider, for example, "KeyFactory.RSA". Callers can cache the returned service information but such caches should be validated against the result of Service.getCacheVersion() before use. -
getSecureRandomService
Returns the default SecureRandom service description. -
setNeedRefresh
public static void setNeedRefresh()In addition to being used here when the list of providers changes, this method is also used by the Provider implementation to indicate that a provides list of services has changed. -
getCacheVersion
public static int getCacheVersion()Returns the current cache version. This has the possible side effect of updating the cache if needed.
-