use of org.jpos.q2.QFactory 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.q2.QFactory in project jPOS by jpos.
the class QServer method addServerSocketFactory.
private void addServerSocketFactory() throws ConfigurationException {
QFactory factory = getFactory();
Element persist = getPersist();
Element serverSocketFactoryElement = persist.getChild("server-socket-factory");
if (serverSocketFactoryElement != null) {
ISOServerSocketFactory serverSocketFactory = (ISOServerSocketFactory) factory.newInstance(serverSocketFactoryElement.getAttributeValue("class"));
factory.setLogger(serverSocketFactory, serverSocketFactoryElement);
factory.setConfiguration(serverSocketFactory, serverSocketFactoryElement);
server.setSocketFactory(serverSocketFactory);
}
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class TaskAdaptor method initService.
protected void initService() throws Exception {
QFactory factory = getServer().getFactory();
Element e = getPersist();
task = factory.newInstance(e.getChildTextTrim("class"));
factory.setLogger(task, e);
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class KeyStoreAdaptor method initService.
protected void initService() throws Exception {
Element e = getPersist();
QFactory factory = getServer().getFactory();
ks = (SecureKeyStore) factory.newInstance(getImpl());
factory.setLogger(ks, e);
factory.setConfiguration(ks, e);
NameRegistrar.register(getName(), ks);
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class SMAdaptor method initService.
protected void initService() throws Exception {
Element e = getPersist();
QFactory factory = getServer().getFactory();
sm = (SMAdapter) factory.newInstance(getImpl());
factory.setLogger(sm, e);
factory.setConfiguration(sm, e);
}
Aggregations