Class JndiPropertiesLoader
- java.lang.Object
-
- com.saperion.common.config.loader.AbstractPropertiesLoader
-
- com.saperion.common.config.loader.JndiPropertiesLoader
-
- All Implemented Interfaces:
PropertiesLoader
public class JndiPropertiesLoader extends AbstractPropertiesLoader
This
PropertiesLoaderloadsPropertiesvia JNDI. The JNDI lookup path to be used can be configured by using the according constructor.An instance of this
FilePropertiesLoadercan be used in several threads concurrently.- Author:
- sts
- See Also:
JndiPropertiesLoader(String)
-
-
Constructor Summary
Constructors Constructor Description JndiPropertiesLoader(java.lang.String jndiPath)Constructs aJndiPropertiesLoaderusing the given JNDI lookup path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetLookupLocation(PropertiesResource propertiesResource)Returns the JNDI lookup path used by thisPropertiesLoaderinstance when it tries to load thePropertiesResourcevia JNDI.java.util.Propertiesload(PropertiesResource propertiesResource)Loads the givenPropertiesResourceif present.java.lang.StringtoString()-
Methods inherited from class com.saperion.common.config.loader.AbstractPropertiesLoader
loadAsMap
-
-
-
-
Constructor Detail
-
JndiPropertiesLoader
public JndiPropertiesLoader(java.lang.String jndiPath)
Constructs aJndiPropertiesLoaderusing the given JNDI lookup path. JNDI lookup path is appended as prefix to thePropertiesResourcename when thisPropertiesLoaderloads aPropertiesResource.- Parameters:
jndiPath- the JNDI lookup path to use for loading thePropertiesResources via JNDI. May not be null or empty.
-
-
Method Detail
-
load
public java.util.Properties load(PropertiesResource propertiesResource) throws ConfigurationException
Description copied from interface:PropertiesLoaderLoads the givenPropertiesResourceif present. Returns the properties as aPropertiesobject.- Parameters:
propertiesResource- thePropertiesResourceto load.- Returns:
- the loaded
Properties - Throws:
ConfigurationException- if thePropertiesResourcecould not be loaded.- See Also:
PropertiesResource,Properties
-
getLookupLocation
public java.lang.String getLookupLocation(PropertiesResource propertiesResource)
Returns the JNDI lookup path used by thisPropertiesLoaderinstance when it tries to load thePropertiesResourcevia JNDI.- Parameters:
propertiesResource- the resource in question.- Returns:
- JNDI lookup path used by this
PropertiesLoaderinstance for the givenPropertiesResource.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-