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 Details

    • Services

      public Services()
  • Method Details

    • getProviders

      public static Provider[] getProviders()
      Returns a copy of the registered providers as an array.
    • getProvidersList

      public static List<Provider> getProvidersList()
      Returns a copy of the registered providers as a list.
    • getProvider

      public static Provider getProvider​(String name)
      Returns the provider with the specified name.
    • insertProviderAt

      public static int insertProviderAt​(Provider provider, int position)
      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

      public static void initServiceInfo​(Provider p)
      Adds information about provider services into HashMap.
    • isEmpty

      public static boolean isEmpty()
      Returns true if services contain any provider information.
    • getService

      public static Provider.Service getService​(String key)
      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

      public static Provider.Service 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.