|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.io.support.PropertiesLoaderSupport
org.springframework.beans.factory.config.PropertyResourceConfigurer
org.springframework.beans.factory.config.PropertyOverrideConfigurer
ch.elca.el4j.core.config.JndiPropertyOverrideConfigurer
public class JndiPropertyOverrideConfigurer
This class allows overriding of Spring configurations using JNDI to retrieve values to override. The JNDI entries may be marked with a special prefix or a distinct JNDI context is used, which contains only override properties. This class allows configuring web or EJB applications at deploy time.
This class falls back on the PropertyOverrideConfigurer
's
behaviour, if there are any JNDI-related problems.
JndiPropertyPlaceholderConfigurer
Field Summary | |
---|---|
static String |
DEFAULT_KEY_PREFIX
The default key prefix that signals an override property. |
Fields inherited from class org.springframework.beans.factory.config.PropertyOverrideConfigurer |
---|
DEFAULT_BEAN_NAME_SEPARATOR |
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport |
---|
logger, XML_FILE_EXTENSION |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
JndiPropertyOverrideConfigurer()
|
Method Summary | |
---|---|
protected Properties |
createProperties(NamingEnumeration<NameClassPair> enumeration)
Iterates over all entries of the given JNDI context and extracts valid configuration override properties. |
JndiConfigurationHelper |
getJndiPropertyConfigurationgHelper()
|
String |
getKeyPrefix()
|
protected String |
getPropertyName(String name)
Computes the configuration property's name. |
protected boolean |
isConfigProperty(String name)
Checks whether the given name represents a configuration property. |
protected void |
processProperties(ConfigurableListableBeanFactory beanFactory,
Properties props)
|
void |
setJndiPropertyConfigurationgHelper(JndiConfigurationHelper jndiPropertyConfigurationgHelper)
Sets the JNDI configuration helper. |
void |
setKeyPrefix(String keyPrefix)
Sets the prefix of JNDI resources we're interested in. |
Methods inherited from class org.springframework.beans.factory.config.PropertyOverrideConfigurer |
---|
applyPropertyValue, hasPropertyOverridesFor, processKey, setBeanNameSeparator, setIgnoreInvalidKeys |
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer |
---|
convertProperties, convertProperty, convertPropertyValue, getOrder, postProcessBeanFactory, setOrder |
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport |
---|
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_KEY_PREFIX
Constructor Detail |
---|
public JndiPropertyOverrideConfigurer()
Method Detail |
---|
public String getKeyPrefix()
public void setKeyPrefix(String keyPrefix)
springConfig.
.
keyPrefix
- The JNDI name prefix.public JndiConfigurationHelper getJndiPropertyConfigurationgHelper()
JndiConfigurationHelper
.public void setJndiPropertyConfigurationgHelper(JndiConfigurationHelper jndiPropertyConfigurationgHelper)
jndiPropertyConfigurationgHelper
- The JNDI configuration helper.protected void processProperties(ConfigurableListableBeanFactory beanFactory, Properties props) throws BeansException
processProperties
in class PropertyOverrideConfigurer
BeansException
protected Properties createProperties(NamingEnumeration<NameClassPair> enumeration) throws NamingException
enumeration
- The enumeration of all properties of the given JNDI context.
NamingException
- If a naming exception is encountered.protected boolean isConfigProperty(String name)
null
or consisting of spaces only) or if the
name starts with teh given prefix.
name
- The name to check.
true
if it's a configuration property,
false
otherwise.protected String getPropertyName(String name)
name
- A JNDI resource name that is a valid configuration property, i.e.
that makes the isConfigProperty(String)
resulting in
true
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |