org.rhq.core.pluginapi.event.log
Class LogFileEventPoller

java.lang.Object
  extended by org.rhq.core.pluginapi.event.log.LogFileEventPoller
All Implemented Interfaces:
EventPoller

public class LogFileEventPoller
extends Object
implements EventPoller

An Event poller that polls a log file for new entries.


Constructor Summary
LogFileEventPoller(EventContext eventContext, String eventType, File logFile, LogEntryProcessor entryProcessor)
           
 
Method Summary
 String getEventType()
          Returns the type of event (i.e. the EventDefinition name) that this poller checks for.
 String getSourceLocation()
           
protected  void init()
          This performs any initialization that requires using the EventContext.
 Set<Event> poll()
          Poll for new Events (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFileEventPoller

public LogFileEventPoller(EventContext eventContext,
                          String eventType,
                          File logFile,
                          LogEntryProcessor entryProcessor)
Method Detail

getEventType

@NotNull
public String getEventType()
Description copied from interface: EventPoller
Returns the type of event (i.e. the EventDefinition name) that this poller checks for.

Specified by:
getEventType in interface EventPoller
Returns:
the type of event (i.e. the EventDefinition name) that this poller checks for

getSourceLocation

@NotNull
public String getSourceLocation()

poll

@Nullable
public Set<Event> poll()
Description copied from interface: EventPoller
Poll for new Events (i.e. Events that have occurred since the last time poll() was called).

Specified by:
poll in interface EventPoller
Returns:
any new Events (i.e. Events that have occurred since the last time poll() was called)

init

protected void init()
This performs any initialization that requires using the EventContext. It must *not* be called from our constructor, because pollers are constructed during PC initialization, and at that time the PC EventManager, which the EventContext relies on, is not yet available. Instead it is called from poll() on the first invocation of that method, at which point the PC will be initialized.



Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.