use of org.wso2.carbon.humantask.core.api.event.HumanTaskEventListener in project carbon-business-process by wso2.
the class HumanTaskServer method initEventProcessor.
//
/**
* Event processor initialisation logic.
* As of now we have a set of event listeners which we register at the server startup.
*
* @throws HumanTaskServerException : If the event listener object instantiation fails.
*/
private void initEventProcessor() throws HumanTaskServerException {
EventProcessor eventProcessor = new EventProcessor();
for (String eventListenerClassName : serverConfig.getEventListenerClassNames()) {
try {
Class eventListenerClass = this.getClass().getClassLoader().loadClass(eventListenerClassName);
HumanTaskEventListener eventListener = (HumanTaskEventListener) eventListenerClass.newInstance();
eventProcessor.addEventListener(eventListener);
} catch (Exception e) {
log.fatal("Couldn't initialize the event listener for class: " + eventListenerClassName, e);
throw new HumanTaskServerException("Couldn't initialize a event listener: " + eventListenerClassName, e);
}
}
this.eventProcessor = eventProcessor;
}
Aggregations