use of org.jpos.core.Configurable in project jPOS by jpos.
the class DirPollAdaptor method initService.
protected void initService() throws Exception {
QFactory factory = getServer().getFactory();
dirPoll = createDirPoll();
dirPoll.setPath(getPath());
dirPoll.setThreadPool(new ThreadPool(1, poolSize));
dirPoll.setPollInterval(pollInterval);
if (priorities != null)
dirPoll.setPriorities(priorities);
dirPoll.setLogger(getLog().getLogger(), getLog().getRealm());
Configuration cfg = factory.getConfiguration(getPersist());
dirPoll.setConfiguration(cfg);
dirPoll.createDirs();
Object dpp = factory.newInstance(getProcessor());
if (dpp instanceof LogSource) {
((LogSource) dpp).setLogger(getLog().getLogger(), getLog().getRealm());
}
if (dpp instanceof Configurable) {
((Configurable) dpp).setConfiguration(cfg);
}
dirPoll.setProcessor(dpp);
}
use of org.jpos.core.Configurable in project jPOS by jpos.
the class ISOServer method setConfiguration.
@Override
public void setConfiguration(Configuration cfg) throws ConfigurationException {
this.cfg = cfg;
configureConnectionPerms();
backlog = cfg.getInt("backlog", 0);
ignoreISOExceptions = cfg.getBoolean("ignore-iso-exceptions");
String ip = cfg.get("bind-address", null);
if (ip != null) {
try {
bindAddr = InetAddress.getByName(ip);
} catch (UnknownHostException e) {
throw new ConfigurationException("Invalid bind-address " + ip, e);
}
}
if (socketFactory == null) {
socketFactory = this;
}
if (socketFactory != this && socketFactory instanceof Configurable) {
((Configurable) socketFactory).setConfiguration(cfg);
}
}
Aggregations