use of com.tremolosecurity.provisioning.listeners.DynamicQueueListeners in project OpenUnison by TremoloSecurity.
the class SendMessageThread method initListeners.
@Override
public void initListeners() throws ProvisioningException {
this.listenerSessions = new HashMap<String, JMSSessionHolder>();
if (this.cfgMgr.getCfg().getProvisioning() == null || this.cfgMgr.getCfg().getProvisioning().getListeners() == null) {
logger.warn("No listeners defined");
return;
}
try {
for (MessageListenerType mlt : this.cfgMgr.getCfg().getProvisioning().getListeners().getListener()) {
addMessageListener(mlt);
}
if (cfgMgr.getCfg().getProvisioning().getListeners().getDynamicListeners() != null && cfgMgr.getCfg().getProvisioning().getListeners().getDynamicListeners().isEnabled()) {
DynamicPortalUrlsType dynamicMessageListeners = cfgMgr.getCfg().getProvisioning().getListeners().getDynamicListeners();
String className = dynamicMessageListeners.getClassName();
HashMap<String, Attribute> cfgAttrs = new HashMap<String, Attribute>();
for (ParamType pt : dynamicMessageListeners.getParams()) {
Attribute attr = cfgAttrs.get(pt.getName());
if (attr == null) {
attr = new Attribute(pt.getName());
cfgAttrs.put(pt.getName(), attr);
}
attr.getValues().add(pt.getValue());
}
DynamicQueueListeners dynamicQueueListener = (DynamicQueueListeners) Class.forName(className).newInstance();
dynamicQueueListener.loadDynamicQueueListeners(cfgMgr, this, cfgAttrs);
}
} catch (Exception e) {
logger.warn("Could not initialize listeners", e);
}
}
Aggregations