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
Public Constructors |
|
ProviderList(int caller, boolean useNative)
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
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)
public
synchronized
void
addProviderAtFront
(Provider p, Oid mechOid)
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.
|