org.talend.esb.sam.agent.collector
Class EventCollectorImpl

java.lang.Object
  extended by org.talend.esb.sam.agent.collector.EventCollectorImpl
All Implemented Interfaces:
org.apache.cxf.buslifecycle.BusLifeCycleListener, org.springframework.beans.factory.InitializingBean

public class EventCollectorImpl
extends Object
implements org.apache.cxf.buslifecycle.BusLifeCycleListener, org.springframework.beans.factory.InitializingBean

Event collector collects all events and stores them in a queue. This can be a memory queue or a persistent queue. Asynchronously the events will be processed and sent to MonitoringService


Constructor Summary
EventCollectorImpl()
           
 
Method Summary
 void afterPropertiesSet()
           
 int getEventsPerMessageCall()
          Returns the number of events sent by one service call.
 List<org.talend.esb.sam.common.spi.EventFilter> getFilters()
           
 List<org.talend.esb.sam.common.spi.EventHandler> getHandlers()
           
 void initComplete()
           
 void postShutdown()
           
 void preShutdown()
           
 void sendEventsFromQueue()
          Method will be executed asynchronously from spring.
 void setBus(org.apache.cxf.Bus bus)
           
 void setDefaultInterval(long defaultInterval)
          Set default interval for sending events to monitoring service.
 void setEventsPerMessageCall(int eventsPerMessageCall)
          Set by Spring.
 void setExecutor(org.springframework.core.task.TaskExecutor executor)
          Spring sets the executor.
 void setFilters(List<org.talend.esb.sam.common.spi.EventFilter> filters)
           
 void setHandlers(List<org.talend.esb.sam.common.spi.EventHandler> newHandlers)
           
 void setMonitoringServiceClient(org.talend.esb.sam.common.service.MonitoringService monitoringServiceClient)
          Spring sets the monitoring service client.
 void setQueue(Queue<org.talend.esb.sam.common.event.Event> queue)
          Spring sets the queue.
 void setScheduler(org.springframework.scheduling.TaskScheduler scheduler)
          Scheduler will be set and configured by Spring.
 void stopSending()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventCollectorImpl

public EventCollectorImpl()
Method Detail

getEventsPerMessageCall

public int getEventsPerMessageCall()
Returns the number of events sent by one service call.

Returns:

setEventsPerMessageCall

public void setEventsPerMessageCall(int eventsPerMessageCall)
Set by Spring. Define how many events will be sent within one service call.

Parameters:
eventsPerMessageCall -

setDefaultInterval

public void setDefaultInterval(long defaultInterval)
Set default interval for sending events to monitoring service. DefaultInterval will be used by scheduler.

Parameters:
defaultInterval -

setScheduler

public void setScheduler(org.springframework.scheduling.TaskScheduler scheduler)
Scheduler will be set and configured by Spring. Spring executes every x milliseconds the sending process.

Parameters:
scheduler -

setExecutor

public void setExecutor(org.springframework.core.task.TaskExecutor executor)
Spring sets the executor. The executer is used for sending events to the web service.

Parameters:
executor -

setQueue

public void setQueue(Queue<org.talend.esb.sam.common.event.Event> queue)
Spring sets the queue. Within the spring configuration you can decide between memory queue and persistent queue.

Parameters:
queue -

setMonitoringServiceClient

public void setMonitoringServiceClient(org.talend.esb.sam.common.service.MonitoringService monitoringServiceClient)
Spring sets the monitoring service client.

Parameters:
monitoringServiceClient -

setBus

public void setBus(org.apache.cxf.Bus bus)

getFilters

public List<org.talend.esb.sam.common.spi.EventFilter> getFilters()

setFilters

public void setFilters(List<org.talend.esb.sam.common.spi.EventFilter> filters)

getHandlers

public List<org.talend.esb.sam.common.spi.EventHandler> getHandlers()

setHandlers

public void setHandlers(List<org.talend.esb.sam.common.spi.EventHandler> newHandlers)

sendEventsFromQueue

public void sendEventsFromQueue()
Method will be executed asynchronously from spring.


stopSending

public void stopSending()

initComplete

public void initComplete()
Specified by:
initComplete in interface org.apache.cxf.buslifecycle.BusLifeCycleListener

preShutdown

public void preShutdown()
Specified by:
preShutdown in interface org.apache.cxf.buslifecycle.BusLifeCycleListener

postShutdown

public void postShutdown()
Specified by:
postShutdown in interface org.apache.cxf.buslifecycle.BusLifeCycleListener

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception


Copyright © 2011 Talend Inc.. All Rights Reserved.