Class ConfigFile
java.lang.Object
javax.security.auth.login.Configuration
com.sun.security.auth.login.ConfigFile
This class represents a default implementation for
javax.security.auth.login.Configuration.
This object stores the runtime login configuration representation,
and is the amalgamation of multiple static login
configurations that resides in files.
The algorithm for locating the login configuration file(s) and reading their
information into this Configuration object is:
-
Loop through the security properties,
login.config.url.1, login.config.url.2, ...,
login.config.url.X.
Each property value specifies a
URLpointing to a login configuration file to be loaded. Read in and load each configuration. -
The system property
java.security.auth.login.configmay also be set to aURLpointing to another login configuration file (which is the case when a user uses the -D switch at runtime). If this property is defined, and its use is allowed by the security property file (the Security property, policy.allowSystemProperty is set to true), also load that login configuration. - If the java.security.auth.login.config property is defined using "==" (rather than "="), then ignore all other specified login configurations and only load this configuration.
- If no system or security properties were set, try to read from the file, ${user.home}/.java.login.config, where ${user.home} is the value represented by the "user.home" System property.
The configuration syntax supported by this implementation
is exactly that syntax specified in the
javax.security.auth.login.Configuration class. In addition, the
security property policy.expandProperties can be used to control
whether system properties in the configuration file are expanded. If not
set, the default value is true which means that properties will
be expanded.
- Since:
- 1.4
- See Also:
-
Nested Class Summary
Nested classes/interfaces declared in class Configuration
Configuration.ParametersModifier and TypeClassDescriptionstatic interfaceThis represents a marker interface for Configuration parameters. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newConfigurationobject.ConfigFile(URI uri) Create a newConfigurationobject from the specifiedURI. -
Method Summary
Modifier and TypeMethodDescriptiongetAppConfigurationEntry(String applicationName) Retrieve an entry from theConfigurationusing an application name as an index.voidrefresh()Refresh and reload theConfigurationby re-reading all of the login configurations.Methods declared in class Configuration
getConfiguration, getInstance, getInstance, getInstance, getParameters, getProvider, getType, setConfigurationModifier and TypeMethodDescriptionstatic ConfigurationGet the installed login Configuration.static ConfigurationgetInstance(String type, Configuration.Parameters params) Returns a Configuration object of the specified type.static ConfigurationgetInstance(String type, Configuration.Parameters params, String provider) Returns a Configuration object of the specified type.static ConfigurationgetInstance(String type, Configuration.Parameters params, Provider provider) Returns a Configuration object of the specified type.Return Configuration parameters.Return the Provider of this Configuration.getType()Return the type of this Configuration.static voidsetConfiguration(Configuration configuration) Set the loginConfiguration.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
ConfigFile
public ConfigFile()Create a newConfigurationobject.- Throws:
SecurityException- if theConfigurationcan not be initialized
-
ConfigFile
Create a newConfigurationobject from the specifiedURI.- Parameters:
uri- theURI- Throws:
SecurityException- if theConfigurationcan not be initializedNullPointerException- ifuriis null
-
-
Method Details
-
getAppConfigurationEntry
Retrieve an entry from theConfigurationusing an application name as an index.- Specified by:
getAppConfigurationEntryin classConfiguration- Parameters:
applicationName- the name used to index theConfiguration- Returns:
- an array of
AppConfigurationEntrywhich correspond to the stacked configuration ofLoginModules for this application, or null if this application has no configuredLoginModules.
-
refresh
public void refresh()Refresh and reload theConfigurationby re-reading all of the login configurations.- Overrides:
refreshin classConfiguration
-