***  This class provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.deployment
Class Environment

com.sas.services.deployment.Environment
All Implemented Interfaces:
com.sas.services.connection.ConnectionResources, java.io.Serializable

public class Environment
implements com.sas.services.connection.ConnectionResources, java.io.Serializable

An encapsulation of runtime resources provided by the container. For example, resources provided to J2EE connectors through javax.resource.spi.BootstrapContext might be encapsulated here. Applications can also use objects of this class to provide a simulated JAAS configuration to Foundation Services so that Foundation Services can be deployed in an environment without a "real" JAAS configuration.

Since:
9.2
See Also:
Serialized Form

Constructor Summary
Environment()
          Create an Environment object.
 
Method Summary
 java.util.List getAppConfigurationEntry(java.lang.String appConfigurationEntryName)
          Return the JAAS application configuration entry for Foundation Services.
 void setAppConfigurationEntry(javax.security.auth.login.AppConfigurationEntry[] appConfigurationEntry)
          Set the simulated JAAS application configuration entry.
 

Constructor Detail

Environment

public Environment()
Create an Environment object.

Method Detail

setAppConfigurationEntry

public void setAppConfigurationEntry(javax.security.auth.login.AppConfigurationEntry[] appConfigurationEntry)
Set the simulated JAAS application configuration entry. This method allows an application to change the JAAS configuration used by Foundation Services at runtime without calling javax.security.auth.login.Configuration.setConfiguration(). That method sets the new JAAS configuration globally and may affect the operation of other parts of the system that depend on JAAS.

Applications may use this method to change the JAAS configuration for a Foundation Services deployment that has already been deployed. The new JAAS configuration will take effect immediately. However, the behavior of any existing UserContext objects at the time this method is called is undefined. Therefore, it is a best practice to call this method only before deploying Foundation Services or after destroying all UserContext objects.

The following code provides a sample that shows how one might define an AppConfigurationEntry for an OMILoginModule.

     import java.util.HashMap;
     import java.util.Map;
     import javax.security.auth.login.AppConfigurationEntry;
     import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;

     import com.sas.services.security.login.LoginPropertyConstants;
     import com.sas.services.security.login.OMILoginModule;

     Map optionsMap = new HashMap(5);
     optionsMap.put(
        LoginPropertyConstants.PROPERTYNAME_HOST,
        "xxx.yyy.com");
     optionsMap.put(
        LoginPropertyConstants.PROPERTYNAME_PORT,
        "8561");
     optionsMap.put(
        "repository",
        "Foundation");
     optionsMap.put(
        LoginPropertyConstants.PROPERTYNAME_DOMAIN,
        "DefaultAuth");
     optionsMap.put(
        LoginPropertyConstants.PROPERTYNAME_DEBUG,
        LoginPropertyConstants.PROPERTYVALUE_FALSE);

     AppConfigurationEntry[] appConfigurationEntries = new AppConfigurationEntry[]  {
       new AppConfigurationEntry(
         OMILoginModule.class.getName(), 
         LoginModuleControlFlag.OPTIONAL, 
         optionsMap)
     };       
 

Parameters:
appConfigurationEntry - the simulated JAAS application configuration entry or null if there are no entries.

getAppConfigurationEntry

public java.util.List getAppConfigurationEntry(java.lang.String appConfigurationEntryName)
Return the JAAS application configuration entry for Foundation Services. If an entry has been provided by calling setAppConfigurationEntry(), that entry will be returned. Otherwise, this method will look up the entry in the JAAS configuration and return it. If there is no entry with the given name, this method will return null.

The returned object is an unmodifiable list whose elements are all instances of javax.security.auth.login.AppConfigurationEntry.

Parameters:
appConfigurationEntryName - Name of the desired application configuration entry.
Returns:
the JAAS application configuration entry for Foundation Services

***  This class provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.