org.lwes.emitter
Interface EventEmitter

All Known Implementing Classes:
MulticastEventEmitter, UnicastEventEmitter

public interface EventEmitter

EventEmitter is the interface that defines a component that takes an Event and performs an emit task on that event. This may emit the event to the network, to a disk, or to a database.

Author:
Michael P. Lum, Anthony Molinaro

Method Summary
 Event createEvent(java.lang.String eventName)
          Create an event with name eventName
 Event createEvent(java.lang.String eventName, boolean validate)
          Create an event with name eventName, optionally validating it against an EventTemplateDB
 void emit(Event event)
          Emits an Event object to the destination
 java.lang.String getESFFilePath()
          Gets the ESF file used for event validation
 java.io.InputStream getESFInputStream()
          Gets the InputStream being used for event validation.
 void initialize()
          Called before the system is started.
 void setESFFilePath(java.lang.String esfFilePath)
          Sets the ESF file used for event validation.
 void setESFInputStream(java.io.InputStream esfInputStream)
          Sets an InputStream to be used for event validation.
 void shutdown()
          Called before the system is shut down.
 

Method Detail

setESFFilePath

void setESFFilePath(java.lang.String esfFilePath)
Sets the ESF file used for event validation.

Parameters:
esfFilePath - the path of the ESF file

getESFFilePath

java.lang.String getESFFilePath()
Gets the ESF file used for event validation

Returns:
the ESF file path

setESFInputStream

void setESFInputStream(java.io.InputStream esfInputStream)
Sets an InputStream to be used for event validation.

Parameters:
esfInputStream - an InputStream used for event validation

getESFInputStream

java.io.InputStream getESFInputStream()
Gets the InputStream being used for event validation.

Returns:
the InputStream of the ESF validator

initialize

void initialize()
                throws java.io.IOException
Called before the system is started. Allows for initialization of data and creation of network sockets, where applicable.

Throws:
java.io.IOException - if an I/O error occurs during initialization

shutdown

void shutdown()
              throws java.io.IOException
Called before the system is shut down. Allows for cleanup of data and destruction of network sockets, where applicable.

Throws:
java.io.IOException - if an I/O error occurs during initialization

createEvent

Event createEvent(java.lang.String eventName)
                  throws EventSystemException
Create an event with name eventName

Parameters:
eventName - the name of the event to create
Returns:
the Event object
Throws:
EventSystemException - if an error occurs during event creation

createEvent

Event createEvent(java.lang.String eventName,
                  boolean validate)
                  throws EventSystemException
Create an event with name eventName, optionally validating it against an EventTemplateDB

Parameters:
eventName - the name of the event
validate - whether or not to validate the event against the EventTemplateDB
Returns:
the Event object
Throws:
EventSystemException - if an error occurs during event creation

emit

void emit(Event event)
          throws java.io.IOException
Emits an Event object to the destination

Parameters:
event - the event being emitted
Throws:
java.io.IOException - if an I/O error occurs