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

java.lang.Object
  extended by org.talend.esb.sam.agent.collector.EventCollector
All Implemented Interfaces:
org.apache.cxf.buslifecycle.BusLifeCycleListener

public class EventCollector
extends Object
implements org.apache.cxf.buslifecycle.BusLifeCycleListener

EventCollector reads the events from Queue. After processing with filter/handler, the events will be sent to SAM Server periodically.


Constructor Summary
EventCollector()
          Instantiates a new event collector.
 
Method Summary
 int getEventsPerMessageCall()
          Returns the number of events sent by one service call.
 List<org.talend.esb.sam.common.spi.EventFilter> getFilters()
          Gets the filters.
 List<org.talend.esb.sam.common.spi.EventHandler> getHandlers()
          Gets the handlers.
 void initComplete()
           
 void postShutdown()
           
 void preShutdown()
           
 void sendEventsFromQueue()
          Method will be executed asynchronously from spring.
 void setBus(org.apache.cxf.Bus bus)
          Sets the 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)
          Sets the filters.
 void setHandlers(List<org.talend.esb.sam.common.spi.EventHandler> newHandlers)
          Sets the handlers.
 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 setSendLifecycleEvent(boolean sendLifecycleEvent)
          Set if collect/send lifecycle events to sam-server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventCollector

public EventCollector()
Instantiates a new event collector.

Method Detail

getEventsPerMessageCall

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

Returns:
the events per message call

setEventsPerMessageCall

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

Parameters:
eventsPerMessageCall - the new events per message call

setDefaultInterval

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

Parameters:
defaultInterval - the new default interval

setSendLifecycleEvent

public void setSendLifecycleEvent(boolean sendLifecycleEvent)
Set if collect/send lifecycle events to sam-server.

Parameters:
sendLifecycleEvent - the new send lifecycle event

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 - the new 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 - the new 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 - the new queue

setMonitoringServiceClient

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

Parameters:
monitoringServiceClient - the new monitoring service client

setBus

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

Parameters:
bus - the new bus

getFilters

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

Returns:
the filters

setFilters

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

Parameters:
filters - the new filters

getHandlers

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

Returns:
the handlers

setHandlers

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

Parameters:
newHandlers - the new handlers

sendEventsFromQueue

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


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


Copyright © 2011-2012 Talend Inc.. All Rights Reserved.