use of org.talend.esb.sam.agent.lifecycle.ClientListenerImpl in project tesb-rt-se by Talend.
the class EventCollector method init.
/**
* Instantiates a new event collector.
*/
@PostConstruct
public void init() {
// init Bus and LifeCycle listeners
if (bus != null && sendLifecycleEvent) {
ServerLifeCycleManager slcm = bus.getExtension(ServerLifeCycleManager.class);
if (null != slcm) {
ServiceListenerImpl svrListener = new ServiceListenerImpl();
svrListener.setSendLifecycleEvent(sendLifecycleEvent);
svrListener.setQueue(queue);
svrListener.setMonitoringServiceClient(monitoringServiceClient);
slcm.registerListener(svrListener);
}
ClientLifeCycleManager clcm = bus.getExtension(ClientLifeCycleManager.class);
if (null != clcm) {
ClientListenerImpl cltListener = new ClientListenerImpl();
cltListener.setSendLifecycleEvent(sendLifecycleEvent);
cltListener.setQueue(queue);
cltListener.setMonitoringServiceClient(monitoringServiceClient);
clcm.registerListener(cltListener);
}
}
executor = Executors.newFixedThreadPool(this.executorPoolSize);
scheduler = new Timer();
scheduler.scheduleAtFixedRate(new TimerTask() {
public void run() {
sendEventsFromQueue();
}
}, 0, getDefaultInterval());
}
Aggregations