use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class MonitorAdapterBase method configure.
public void configure() throws ConfigurationException {
if (StringUtils.isEmpty(getName())) {
setName(ClassUtils.nameOf(this));
}
hostname = Misc.getHostname();
AppConstants appConstants = AppConstants.getInstance();
sourceId = appConstants.getResolvedProperty(SOURCE_ID_KEY);
if (StringUtils.isEmpty(sourceId)) {
throw new ConfigurationException("cannot read sourceId from [" + SOURCE_ID_KEY + "]");
}
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class ShowEnvironmentVariables method addPropertiesToXmlBuilder.
public void addPropertiesToXmlBuilder(XmlBuilder container, Properties props, String setName, List<String> propsToHide, boolean skipResolve) {
Enumeration enumeration = props.keys();
XmlBuilder propertySet = new XmlBuilder("propertySet");
propertySet.addAttribute("name", setName);
container.addSubElement(propertySet);
while (enumeration.hasMoreElements()) {
String propName = (String) enumeration.nextElement();
XmlBuilder property = new XmlBuilder("property");
property.addAttribute("name", XmlUtils.encodeCdataString(propName));
String propValue;
if (skipResolve && props instanceof AppConstants) {
propValue = ((AppConstants) props).getUnresolvedProperty(propName);
} else {
propValue = props.getProperty(propName);
}
if (propsToHide != null && propsToHide.contains(propName)) {
propValue = Misc.hide(propValue);
}
property.setCdataValue(XmlUtils.encodeCdataString(propValue));
propertySet.addSubElement(property);
}
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class FxfPropertyPlaceholderConfigurer method convertProperties.
@Override
protected void convertProperties(Properties props) {
AppConstants appConstants = AppConstants.getInstance();
String fxfDir = appConstants.getResolvedProperty("fxf.dir");
if (fxfDir == null) {
// Use default location, see was.policy too
fxfDir = System.getProperty("APPSERVER_ROOT_DIR");
if (fxfDir != null) {
fxfDir = fxfDir + File.separator + "fxf-work";
}
}
if (fxfDir != null) {
appConstants.putPropertyPlaceholderConfigurerProperty("fxf.dir", fxfDir);
props.put("fxf.dir", fxfDir);
}
log.debug("FxF directory: " + fxfDir);
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class LowerCasePropertyPlaceholderConfigurer method convertProperties.
@Override
protected void convertProperties(Properties props) {
AppConstants appConstants = AppConstants.getInstance();
String instanceName = appConstants.getProperty("instance.name");
if (instanceName != null) {
String lowerCase = instanceName.toLowerCase();
appConstants.putPropertyPlaceholderConfigurerProperty("instance.name.lc", lowerCase);
props.put("instance.name.lc", lowerCase);
}
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class OverwritePropertyPlaceholderConfigurer method convertProperties.
@Override
protected void convertProperties(Properties props) {
AppConstants appConstants = AppConstants.getInstance();
appConstants.putPropertyPlaceholderConfigurerProperty(propertyName, propertyValue);
props.put(propertyName, propertyValue);
}
Aggregations