This class stores an ordered list of pairs of the form
<provider, oid>. 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 an entry of the form <provider, oid> 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 <provider, null>, then it is viewed more
liberally and is simply skipped over if the provider does not claim to
support the requested mechanism.
| Modifier and Type | Class and Description |
|---|---|
| private static class | ProviderList.
Stores a provider and a mechanism oid indicating that the provider should be used for the mechanism. |
| Modifier and Type | Field and Description |
|---|---|
| private final GSSCaller | |
| public static final Oid | |
| private final HashMap | |
| private final HashSet | |
| private final ArrayList | |
| private static final String | |
| private static final int | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | Returns: true if there is at least one mechanism that this provider contributed, false otherwisethe provider to query p)Helper routine to go through all properties contained in a provider and add its mechanisms to the list of supported mechanisms. |
| public synchronized void | |
| public synchronized void | |
| private static GSSException | |
| public synchronized MechanismFactory | |
| public synchronized MechanismFactory | Returns: a MechanismFactory for the desired mechanism.the oid of the desired mechanism mechOid, Provider p)Obtains a MechanismFactory for a given mechanism. |
| private MechanismFactory | getMechFactory(ProviderList.
the preferences entry that contains the provider and
either a null of an explicit oid that matched the oid of the
desired mechanism. e,the oid of the desired mechanism mechOid)Helper routine that uses a preferences entry to obtain an implementation of a MechanismFactory from it. |
| private static MechanismFactory | getMechFactoryImpl(Provider
the provider whose classloader must be used for
instantiating the desired MechanismFactory
@ param className the name of the MechanismFactory class p, String className, Oid mechOid, GSSCaller caller)Helper routine to obtain a MechanismFactory implementation from the same class loader as the provider of this implementation. |
| public Oid[] | |
| private Oid | |
| private boolean | Returns: true if this is a GSS-API property, false otherwise.Determines if the given provider property represents a GSS-API Oid to MechanismFactory mapping. |
| caller | back to summary |
|---|---|
| private final GSSCaller caller | |
| DEFAULT_MECH_OID | back to summary |
|---|---|
| public static final Oid DEFAULT_MECH_OID | |
| factories | back to summary |
|---|---|
| private final HashMap<ProviderList. | |
| mechs | back to summary |
|---|---|
| private final HashSet<Oid> mechs | |
| preferences | back to summary |
|---|---|
| private final ArrayList<ProviderList. | |
| PROV_PROP_PREFIX | back to summary |
|---|---|
| private static final String PROV_PROP_PREFIX | |
| PROV_PROP_PREFIX_LEN | back to summary |
|---|---|
| private static final int PROV_PROP_PREFIX_LEN | |
| SPI_MECH_FACTORY_TYPE | back to summary |
|---|---|
| private static final String SPI_MECH_FACTORY_TYPE | |
| ProviderList | back to summary |
|---|---|
| public ProviderList(GSSCaller caller, boolean useNative) | |
| addAllMechsFromProvider | back to summary |
|---|---|
| private boolean addAllMechsFromProvider(Provider p) Helper routine to go through all properties contained in a provider and add its mechanisms to the list of supported mechanisms. If no default mechanism has been assigned so far, it sets the default MechanismFactory and Oid as well.
| |
| addProviderAtEnd | back to summary |
|---|---|
| public synchronized void addProviderAtEnd(Provider p, Oid mechOid) throws GSSException | |
| addProviderAtFront | back to summary |
|---|---|
| public synchronized void addProviderAtFront(Provider p, Oid mechOid) throws GSSException | |
| createGSSException | back to summary |
|---|---|
| private static GSSException createGSSException(Provider p, String className, String trailingMsg, Exception cause) | |
| getMechFactory | back to summary |
|---|---|
| public synchronized MechanismFactory getMechFactory(Oid mechOid) throws GSSException | |
| getMechFactory | back to summary |
|---|---|
| public synchronized MechanismFactory getMechFactory(Oid mechOid, Provider p) throws GSSException 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.
| |
| getMechFactory | back to summary |
|---|---|
| private MechanismFactory getMechFactory(ProviderList. Helper routine that uses a preferences entry to obtain an implementation of a MechanismFactory from it.
| |
| getMechFactoryImpl | back to summary |
|---|---|
| private static MechanismFactory getMechFactoryImpl(Provider p, String className, Oid mechOid, GSSCaller caller) throws GSSException Helper routine to obtain a MechanismFactory implementation from the same class loader as the provider of this implementation.
| |
| getMechs | back to summary |
|---|---|
| public Oid[] getMechs() | |
| getOidFromMechFactoryProperty | back to summary |
|---|---|
| private Oid getOidFromMechFactoryProperty(String prop) throws GSSException | |
| isMechFactoryProperty | back to summary |
|---|---|
| private boolean isMechFactoryProperty(String prop) Determines if the given provider property represents a GSS-API Oid to MechanismFactory mapping.
| |
The ProviderList maintains an ordered list of PreferencesEntry's and iterates through them as it tries to instantiate MechanismFactory's.
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object other)
Overrides java. Indicates whether some other object is "equal to" this one. |
| pack-priv Oid | |
| pack-priv Provider | |
| public int | |
| pack-priv boolean | |
| pack-priv boolean | Returns: true if the provider in this entry should be queried for this mechanism.Determines if this entry is applicable to the desired mechanism. |
| public String |
| PreferencesEntry | back to summary |
|---|---|
| pack-priv PreferencesEntry(Provider p, Oid oid) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getOid | back to summary |
|---|---|
| pack-priv Oid getOid() | |
| getProvider | back to summary |
|---|---|
| pack-priv Provider getProvider() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| implies | back to summary |
|---|---|
| pack-priv boolean implies(Object other) Determines if a preference implies another. A preference
implies another if the latter is subsumed by the
former. e.g., | |
| impliesMechanism | back to summary |
|---|---|
| pack-priv boolean impliesMechanism(Oid oid) Determines if this entry is applicable to the desired mechanism. The entry is applicable to the desired mech if it contains the same oid or if it contains a null oid indicating that it is applicable to all mechs.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |