public final class

ProviderList

extends Object
java.lang.Object
   ↳ sun.security.jgss.ProviderList

Class Overview

This class stores the list of providers that this GSS-Implementation is configured to use. The GSSManagerImpl class queries this class whenever it needs a mechanism's factory.

This class stores an ordered list of pairs of the form . When it attempts to instantiate a mechanism defined by oid o, it steps through the list looking for an entry with oid=o, or with oid=null. (An entry with oid=null matches all mechanisms.) When it finds such an entry, the corresponding provider is approached for the mechanism's factory class. At instantiation time this list in initialized to contain those system wide providers that contain a property of the form "GssApiMechanism.x.y.z..." where "x.y.z..." is a numeric object identifier with numbers x, y, z, etc. Such a property is defined to map to that provider's implementation of the MechanismFactory interface for the mechanism x.y.z... As and when a MechanismFactory is instantiated, it is cached for future use.

An application can cause more providers to be added by means of the addProviderAtFront and addProviderAtEnd methods on GSSManager which get delegated to this class. The addProviderAtFront method can also cause a change in the ordering of the providers without adding any new providers, by causing a provider to move up in a list. The method addProviderAtEnd can only add providers at the end of the list if they are not already in the list. The rationale is that an application will call addProviderAtFront when it wants a provider to be used in preference over the default ones. And it will call addProviderAtEnd when it wants a provider to be used in case the system ones don't suffice.

If a mechanism's factory is being obtained from a provider as a result of encountering a entryof the form where oid is non-null, then the assumption is that the application added this entry and it wants this mechanism to be obtained from this provider. Thus is the provider does not actually contain the requested mechanism, an exception will be thrown. However, if the entry were of the form , then it is viewed more liberally and is simply skipped over if the provider does not claim to support the requested mechanism.

Summary

Fields
public static final Oid DEFAULT_MECH_OID
Public Constructors
ProviderList(int caller, boolean useNative)
Public Methods
synchronized void addProviderAtEnd(Provider p, Oid mechOid)
synchronized void addProviderAtFront(Provider p, Oid mechOid)
synchronized MechanismFactory getMechFactory(Oid mechOid)
synchronized MechanismFactory getMechFactory(Oid mechOid, Provider p)
Obtains a MechanismFactory for a given mechanism.
Oid[] getMechs()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final Oid DEFAULT_MECH_OID

Public Constructors

public ProviderList (int caller, boolean useNative)

Public Methods

public synchronized void addProviderAtEnd (Provider p, Oid mechOid)

Throws
GSSException

public synchronized void addProviderAtFront (Provider p, Oid mechOid)

Throws
GSSException

public synchronized MechanismFactory getMechFactory (Oid mechOid)

Throws
GSSException

public synchronized MechanismFactory getMechFactory (Oid mechOid, Provider p)

Obtains a MechanismFactory for a given mechanism. If the specified provider is not null, then the impl from the provider is used. Otherwise, the most preferred impl based on the configured preferences is used.

Parameters
mechOid the oid of the desired mechanism
Returns
  • a MechanismFactory for the desired mechanism.
Throws
GSSException when the specified provider does not support the desired mechanism, or when no provider supports the desired mechanism.

public Oid[] getMechs ()