use of org.jpos.q2.QFactory in project jPOS by jpos.
the class LoggerAdaptor method addListener.
private void addListener(Element e) throws ConfigurationException {
QFactory factory = getServer().getFactory();
String clazz = e.getAttributeValue("class");
LogListener listener = (LogListener) factory.newInstance(clazz);
if (listener instanceof Configurable) {
try {
((Configurable) listener).setConfiguration(factory.getConfiguration(e));
} catch (ConfigurationException ex) {
throw new ConfigurationException(ex);
}
}
logger.addListener(listener);
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class CardAgentAdaptor method startService.
protected void startService() throws Exception {
Object obj = getObject();
if (obj instanceof Configurable) {
QFactory factory = getServer().getFactory();
Element e = getPersist();
((Configurable) obj).setConfiguration(factory.getConfiguration(e));
}
CardAgentLookup.add((CardAgent) getObject());
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class TransactionManager method initStatusListeners.
protected void initStatusListeners(Element config) throws ConfigurationException {
final Iterator iter = config.getChildren("status-listener").iterator();
while (iter.hasNext()) {
final Element e = (Element) iter.next();
final QFactory factory = getFactory();
final TransactionStatusListener listener = (TransactionStatusListener) factory.newInstance(e.getAttributeValue("class"));
factory.setConfiguration(listener, config);
addListener(listener);
}
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class DailyTaskAdaptor method startService.
protected void startService() throws Exception {
if (task instanceof Configurable) {
Element e = getPersist();
QFactory factory = getServer().getFactory();
((Configurable) task).setConfiguration(factory.getConfiguration(e));
}
(thisThread = new Thread(this)).start();
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class DailyTaskAdaptor method initService.
protected void initService() throws Exception {
QFactory factory = getServer().getFactory();
Element e = getPersist();
task = (Runnable) factory.newInstance(e.getChildTextTrim("class"));
factory.setLogger(task, e);
}
Aggregations