org.n52.security.authentication.config
Class ConfigurationDecorator

java.lang.Object
  extended by javax.security.auth.login.Configuration
      extended by org.n52.security.authentication.config.ConfigurationDecorator
Direct Known Subclasses:
BeanConfiguration

public class ConfigurationDecorator
extends javax.security.auth.login.Configuration

Class ConfigurationDecorator represents a decorator for a JAAS-Configuration.

It does not implement any kind of external configuration. It wrapps(decorates) another Configuration class and delegates all methods to this instance. It can be used to create chains of configurations or to change the behavior of the decorated configuration.

It also provides a 'weak' mode. In this mode only a weak reference to the wrapped configuration is stored and therewith the decorated instance can be garbaged. This mode can be used for advanced application requirements.

Version:
$Revision: $
Author:
Marko Reiprecht Created on 10.09.2007

Constructor Summary
ConfigurationDecorator(javax.security.auth.login.Configuration configuration)
          Creates a new AbstractConfigurationDecorator instance delegating to the given Configuration instance.
ConfigurationDecorator(javax.security.auth.login.Configuration configuration, boolean weak)
          Creates a new AbstractConfigurationDecorator instance delegating to the given Configuration instance.
 
Method Summary
 javax.security.auth.login.AppConfigurationEntry[] getAppConfigurationEntry(java.lang.String applicationName)
          Method getAppConfigurationEntry returns the AppConfigurationEntries for an application name by delegateing to the referenced configuration.
 javax.security.auth.login.Configuration getDelegationConfiguration()
          Returns the underlying configuration object.
 void refresh()
          Refreshs the configuration by delegating to the referenced Configuration.
 void setDelegationConfiguration(javax.security.auth.login.Configuration configuration)
          Method sets the underlying configuration object.
 void setDelegationConfiguration(javax.security.auth.login.Configuration configuration, boolean weak)
          Method sets the underlying configuration object.
 
Methods inherited from class javax.security.auth.login.Configuration
getConfiguration, setConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationDecorator

public ConfigurationDecorator(javax.security.auth.login.Configuration configuration)
Creates a new AbstractConfigurationDecorator instance delegating to the given Configuration instance.

Parameters:
configuration - of type Configuration

ConfigurationDecorator

public ConfigurationDecorator(javax.security.auth.login.Configuration configuration,
                              boolean weak)
Creates a new AbstractConfigurationDecorator instance delegating to the given Configuration instance.

Parameters:
configuration - of type Configuration, can be null.
weak - of type boolean, if true only a WeakReference is stored to the given Configuration.
Method Detail

getDelegationConfiguration

public javax.security.auth.login.Configuration getDelegationConfiguration()
Returns the underlying configuration object.

Returns:
the config type Configuration or null if garbaged or not set.

setDelegationConfiguration

public void setDelegationConfiguration(javax.security.auth.login.Configuration configuration,
                                       boolean weak)
Method sets the underlying configuration object.

Parameters:
configuration - of type Configuration, this can be null to unset the delegation configuration.
weak - of type boolean, if true only a WeakReference is stored to the given Configuration.

setDelegationConfiguration

public void setDelegationConfiguration(javax.security.auth.login.Configuration configuration)
Method sets the underlying configuration object.

Parameters:
configuration - of type Configuration.

refresh

public void refresh()
Refreshs the configuration by delegating to the referenced Configuration.

Specified by:
refresh in class javax.security.auth.login.Configuration
See Also:
Configuration.refresh()

getAppConfigurationEntry

public javax.security.auth.login.AppConfigurationEntry[] getAppConfigurationEntry(java.lang.String applicationName)
Method getAppConfigurationEntry returns the AppConfigurationEntries for an application name by delegateing to the referenced configuration.

Specified by:
getAppConfigurationEntry in class javax.security.auth.login.Configuration
Parameters:
applicationName - of type String a index name to the configuration of the calling application.
Returns:
AppConfigurationEntry[] the AppConfigurationEntries configured for the application.
See Also:
Configuration.getAppConfigurationEntry(String)


Copyright © 2004-2009 52north.org. All Rights Reserved.