use of org.jpos.q2.QFactory in project jPOS by jpos.
the class TransactionManager method createParticipant.
public TransactionParticipant createParticipant(Element e) throws ConfigurationException {
QFactory factory = getFactory();
TransactionParticipant participant = (TransactionParticipant) factory.newInstance(e.getAttributeValue("class"));
factory.setLogger(participant, e);
QFactory.invoke(participant, "setTransactionManager", this, TransactionManager.class);
factory.setConfiguration(participant, e);
String realm = e.getAttributeValue("realm");
if (realm != null && realm.trim().length() > 0)
realm = ":" + realm;
else
realm = "";
names.put(participant, Caller.shortClassName(participant.getClass().getName()) + realm);
return participant;
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class QFactory2Test method testDestroyQBeanThrowsNullPointerException1.
@Test
public void testDestroyQBeanThrowsNullPointerException1() throws Throwable {
String[] args = new String[0];
Hashtable<String, String> hashtable = new Hashtable<String, String>(100, 100.0F);
hashtable.put("testString", "testString");
try {
new QFactory(ObjectName.getInstance("testQFactoryParam1", hashtable), null).destroyQBean(new Q2(args), new ObjectName("testQFactoryParam1", "testQFactoryParam2", "testQFactoryParam3"), new ChannelAdaptor());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class QMUX method addListeners.
private void addListeners() throws ConfigurationException {
QFactory factory = getFactory();
Iterator iter = getPersist().getChildren("request-listener").iterator();
while (iter.hasNext()) {
Element l = (Element) iter.next();
ISORequestListener listener = (ISORequestListener) factory.newInstance(l.getAttributeValue("class"));
factory.setLogger(listener, l);
factory.setConfiguration(listener, l);
addISORequestListener(listener);
}
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class QServer method addListeners.
private void addListeners() throws ConfigurationException {
QFactory factory = getFactory();
Iterator iter = getPersist().getChildren("request-listener").iterator();
while (iter.hasNext()) {
Element l = (Element) iter.next();
ISORequestListener listener = (ISORequestListener) factory.newInstance(l.getAttributeValue("class"));
factory.setLogger(listener, l);
factory.setConfiguration(listener, l);
server.addISORequestListener(listener);
}
}
use of org.jpos.q2.QFactory in project jPOS by jpos.
the class QServer method addISOServerConnectionListeners.
private void addISOServerConnectionListeners() throws ConfigurationException {
QFactory factory = getFactory();
Iterator iter = getPersist().getChildren("connection-listener").iterator();
while (iter.hasNext()) {
Element l = (Element) iter.next();
ISOServerEventListener listener = (ISOServerEventListener) factory.newInstance(l.getAttributeValue("class"));
factory.setLogger(listener, l);
factory.setConfiguration(listener, l);
server.addServerEventListener(listener);
}
}
Aggregations