Class MapBasedConfiguration
java.lang.Object
org.opensaml.core.config.provider.MapBasedConfiguration
- All Implemented Interfaces:
Configuration
A configuration implementation which stores registered configuration instances in a
local instance of
ConcurrentHashMap.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tderegister(Class<T> configClass, String partitionName) Deregister a configuration instance.<T> TObtain the registered configuration instance.getPartition(String partitionName) Get the Map instance which corresponds to the specified partition name.<T,I extends T>
voidRegister a configuration instance.
-
Field Details
-
storage
Storage for registered configuration objects.
-
-
Constructor Details
-
MapBasedConfiguration
public MapBasedConfiguration()Constructor.
-
-
Method Details
-
get
Obtain the registered configuration instance.- Specified by:
getin interfaceConfiguration- Type Parameters:
T- the type of configuration being retrieved, typically an interface- Parameters:
configClass- the configuration class identifier, typically an interfacepartitionName- the partition name to use- Returns:
- the instance of the registered configuration interface, or null
-
register
public <T,I extends T> void register(@Nonnull Class<T> configClass, @Nonnull I configuration, @Nonnull String partitionName) Register a configuration instance.- Specified by:
registerin interfaceConfiguration- Type Parameters:
T- the type of configuration being registered, typically an interfaceI- the configuration implementation being registered, which will be an instance ofT- Parameters:
configClass- the type of configuration class being registered, typically an interfaceconfiguration- the configuration implementation instance being registeredpartitionName- the partition name to use
-
deregister
Deregister a configuration instance.- Specified by:
deregisterin interfaceConfiguration- Type Parameters:
T- the type of configuration being deregistered, typically an interface- Parameters:
configClass- the type of configuration class being deregistered , typically an interfacepartitionName- the partition name to use- Returns:
- the configuration implementation instance which was deregistered, or null
-
getPartition
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
-