use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class LiquibaseMigrator method getChangeLog.
private Resource getChangeLog() {
AppConstants appConstants = AppConstants.getInstance(getApplicationContext().getClassLoader());
String changeLogFile = appConstants.getString("liquibase.changeLogFile", "DatabaseChangelog.xml");
URL resource = getResource(changeLogFile);
if (resource == null) {
String msg = "unable to find database changelog file [" + changeLogFile + "]";
msg += " classLoader [" + getConfigurationClassLoader() + "]";
log.debug(msg);
return null;
}
try {
return new BytesResource(resource.openStream(), changeLogFile);
} catch (IOException e) {
log.debug("unable to open or read changelog [" + changeLogFile + "]", e);
}
return null;
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class WsdlGenerator method getLocation.
protected String getLocation(String defaultLocation) {
AppConstants appConstants = AppConstants.getInstance(pipeLine.getAdapter().getConfiguration().getClassLoader());
String sa = appConstants.getResolvedProperty("wsdl." + getName() + ".location");
if (sa != null) {
return sa;
}
sa = appConstants.getResolvedProperty("wsdl.location");
if (sa != null) {
return sa;
}
return defaultLocation;
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class StatisticsKeeperLogger method configure.
@Override
public void configure() throws ConfigurationException {
super.configure();
AppConstants ac = AppConstants.getInstance();
if (directory == null) {
setDirectory(ac.getResolvedProperty("log.dir"));
}
if (retentionDays < 0) {
setRetentionDays(ac.getInt("statistics.retention", 7));
}
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class Migrator method configure.
public synchronized void configure(String configurationName, ClassLoader classLoader, String changeLogFile) throws ConfigurationException {
if (configurationName == null)
throw new ConfigurationException("configurationName cannot be null");
AppConstants appConstants = AppConstants.getInstance(classLoader);
if (changeLogFile == null)
changeLogFile = appConstants.getString("liquibase.changeLogFile", "DatabaseChangelog.xml");
LiquibaseClassLoader cl = new LiquibaseClassLoader(classLoader);
if (cl.getResource(changeLogFile) == null) {
log.debug("unable to find database changelog file [" + changeLogFile + "] configuration [" + configurationName + "]");
} else {
String dataSource = appConstants.getString("jdbc.migrator.dataSource", "jdbc/" + appConstants.getResolvedProperty("instance.name.lc"));
setDatasourceName(dataSource);
try {
JdbcConnection connection = new JdbcConnection(getConnection());
instance = new LiquibaseImpl(ibisContext, cl, connection, configurationName, changeLogFile);
} catch (JdbcException e) {
throw new ConfigurationException("migrator error connecting to database [" + dataSource + "]", e);
} catch (ValidationFailedException e) {
throw new ConfigurationException("liquibase validation failed", e);
} catch (LiquibaseException e) {
throw new ConfigurationException("liquibase failed to initialize", e);
}
}
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class HostnamePropertyPlaceholderConfigurer method convertProperties.
@Override
protected void convertProperties(Properties props) {
AppConstants appConstants = AppConstants.getInstance();
String hostname = appConstants.getResolvedProperty(HOSTNAME_PROPERTY);
if (StringUtils.isEmpty(hostname)) {
hostname = Misc.getHostname();
appConstants.putPropertyPlaceholderConfigurerProperty(HOSTNAME_PROPERTY, hostname);
props.put(HOSTNAME_PROPERTY, hostname);
}
}
Aggregations