Class Services


  • public class Services
    extends Object
    This class contains information about all registered providers and preferred implementations for all "serviceName.algName".
    • Constructor Detail

      • Services

        public Services()
    • Method Detail

      • getProviders

        public static ArrayList<Provider> getProviders()
        Returns the actual registered providers.
      • 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.
      • getServices

        public static ArrayList<Provider.Service> getServices​(String type)
        Looks up the requested service by type. The service type and should be provided in the same format used when registering a service with a provider, for example, "KeyFactory". Callers can cache the returned service information but such caches should be validated against the result of Service.getCacheVersion() before use. Returns null if there are no services of the given type found.
      • getServices

        public static ArrayList<Provider.Service> getServices​(String type,
                                                              String algorithm)
        Looks up the requested service by type and algorithm. The service type and should be provided in the same format used when registering a service with a provider, for example, "KeyFactory" and "RSA". Callers can cache the returned service information but such caches should be validated against the result of Service.getCacheVersion() before use. Returns null if there are no services found.
      • 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.