Class MapBasedConfiguration

java.lang.Object
org.opensaml.core.config.provider.MapBasedConfiguration
All Implemented Interfaces:
Configuration

public class MapBasedConfiguration extends Object implements Configuration
A configuration implementation which stores registered configuration instances in a local instance of ConcurrentHashMap.
  • Field Details

  • Constructor Details

    • MapBasedConfiguration

      public MapBasedConfiguration()
      Constructor.
  • Method Details

    • get

      public <T> T get(Class<T> configClass, String partitionName)
      Obtain the registered configuration instance.
      Specified by:
      get in interface Configuration
      Type Parameters:
      T - the type of configuration being retrieved, typically an interface
      Parameters:
      configClass - the configuration class identifier, typically an interface
      partitionName - the partition name to use
      Returns:
      the instance of the registered configuration interface, or null
    • register

      public <T, I extends T> void register(Class<T> configClass, I configuration, String partitionName)
      Register a configuration instance.
      Specified by:
      register in interface Configuration
      Type Parameters:
      T - the type of configuration being registered, typically an interface
      I - the configuration implementation being registered, which will be an instance of T
      Parameters:
      configClass - the type of configuration class being registered, typically an interface
      configuration - the configuration implementation instance being registered
      partitionName - the partition name to use
    • deregister

      public <T> T deregister(Class<T> configClass, String partitionName)
      Deregister a configuration instance.
      Specified by:
      deregister in interface Configuration
      Type Parameters:
      T - the type of configuration being deregistered, typically an interface
      Parameters:
      configClass - the type of configuration class being deregistered , typically an interface
      partitionName - the partition name to use
      Returns:
      the configuration implementation instance which was deregistered, or null
    • getPartition

      private Map<String,Object> getPartition(String partitionName)
      Get the Map instance which corresponds to the specified partition name.
      Parameters:
      partitionName - the partition name to use
      Returns:
      the Map corresponding to the partition name. A new empty Map will be created if necessary