use of org.jpos.core.ConfigurationException in project jPOS by jpos.
the class MD5Filter method setConfiguration.
/**
* @param cfg
* <ul>
* <li>key - initial key
* <li>fields - Space separated field list
* </ul>
*/
public void setConfiguration(Configuration cfg) throws ConfigurationException {
key = cfg.get("key");
String fieldList = cfg.get("fields");
if (fieldList == null)
throw new ConfigurationException("'fields' property not present");
StringTokenizer st = new StringTokenizer(fieldList);
int[] f = new int[st.countTokens()];
for (int i = 0; i < f.length; i++) f[i] = Integer.parseInt(st.nextToken());
fields = f;
}
use of org.jpos.core.ConfigurationException in project jPOS by jpos.
the class XSLTFilter method setConfiguration.
/**
* configure filter.
*
* <ul>
* <li>xsltfile - source XSL-T file
* <li>reread - something != "no" will re-read source file
* </ul>
*
* @param cfg new ConfigurationFile
*/
public void setConfiguration(Configuration cfg) throws ConfigurationException {
try {
transformer = tfactory.newTransformer(new StreamSource(cfg.get("xsltfile")));
String s = cfg.get("reread");
reread = s == null || s.equals("no");
} catch (Exception e) {
throw new ConfigurationException(e);
}
}
use of org.jpos.core.ConfigurationException in project jPOS by jpos.
the class ChannelAdaptor method initSpaceAndQueues.
protected void initSpaceAndQueues() throws ConfigurationException {
Element persist = getPersist();
sp = grabSpace(persist.getChild("space"));
in = persist.getChildTextTrim("in");
out = persist.getChildTextTrim("out");
writeOnly = "yes".equalsIgnoreCase(getPersist().getChildTextTrim("write-only"));
if (in == null || (out == null && !writeOnly)) {
throw new ConfigurationException("Misconfigured channel. Please verify in/out queues");
}
String s = persist.getChildTextTrim("reconnect-delay");
// reasonable default
delay = s != null ? Long.parseLong(s) : 10000;
keepAlive = "yes".equalsIgnoreCase(persist.getChildTextTrim("keep-alive"));
ignoreISOExceptions = "yes".equalsIgnoreCase(persist.getChildTextTrim("ignore-iso-exceptions"));
String t = persist.getChildTextTrim("timeout");
timeout = t != null && t.length() > 0 ? Long.parseLong(t) : 0l;
ready = getName() + ".ready";
reconnect = getName() + ".reconnect";
waitForWorkersOnStop = "yes".equalsIgnoreCase(persist.getChildTextTrim("wait-for-workers-on-stop"));
}
use of org.jpos.core.ConfigurationException in project jPOS by jpos.
the class MUXPool method initService.
public void initService() throws ConfigurationException {
Element e = getPersist();
muxName = toStringArray(e.getChildTextTrim("muxes"));
strategy = getStrategy(e.getChildTextTrim("strategy"));
overrideMTIs = toStringArray(e.getChildTextTrim("follower-override"));
originalChannelField = e.getChildTextTrim("original-channel-field");
splitField = e.getChildTextTrim("split-field");
checkEnabled = cfg.getBoolean("check-enabled");
sp = grabSpace(e.getChild("space"));
mux = new MUX[muxName.length];
try {
for (int i = 0; i < mux.length; i++) mux[i] = QMUX.getMUX(muxName[i]);
} catch (NameRegistrar.NotFoundException ex) {
throw new ConfigurationException(ex);
}
NameRegistrar.register("mux." + getName(), this);
}
use of org.jpos.core.ConfigurationException in project jPOS by jpos.
the class QMUX method initService.
public void initService() throws ConfigurationException {
Element e = getPersist();
sp = grabSpace(e.getChild("space"));
isp = cfg.getBoolean("reuse-space", false) ? sp : new TSpace();
in = e.getChildTextTrim("in");
out = e.getChildTextTrim("out");
if (in == null || out == null) {
throw new ConfigurationException("Misconfigured QMUX. Please verify in/out queues");
}
ignorerc = e.getChildTextTrim("ignore-rc");
key = toStringArray(DEFAULT_KEY, ", ", null);
returnRejects = cfg.getBoolean("return-rejects", false);
for (Element keyElement : e.getChildren("key")) {
String mtiOverride = keyElement.getAttributeValue("mti");
if (mtiOverride != null && mtiOverride.length() >= 2) {
mtiKey.put(mtiOverride.substring(0, 2), toStringArray(keyElement.getTextTrim(), ", ", null));
} else {
key = toStringArray(e.getChildTextTrim("key"), ", ", DEFAULT_KEY);
}
}
ready = toStringArray(e.getChildTextTrim("ready"));
mtiMapping = toStringArray(e.getChildTextTrim("mtimapping"));
if (mtiMapping == null || mtiMapping.length != 3)
mtiMapping = new String[] { nomap, nomap, "0022446789" };
addListeners();
unhandled = e.getChildTextTrim("unhandled");
NameRegistrar.register("mux." + getName(), this);
}
Aggregations