org.opencredo.esper
Interface EsperTemplateOperations

All Known Implementing Classes:
EsperTemplate, EsperTemplateBean

public interface EsperTemplateOperations

Specifies the operations exposed by an Esper Template operations.

Author:
Russ Miles (russ.miles@opencredo.com)

Method Summary
 void addStatement(EsperStatement statement)
          Adds an EsperStatement to the template.
 void cleanup()
          Deallocated all resources associated with this template when it is finished with.
 com.espertech.esper.client.EPRuntime getEsperNativeRuntime()
          Retrieve the configured esper native runtime.
 java.util.Set<EsperStatement> getStatements()
          Return the currently configured and registered set of EsperStatement objects.
 void initialize()
          Sets up and allocated all resources associated with this template prior to its use.
 void sendEvent(java.lang.Object event)
          Instructs the template to send an event to Esper.
 void setConfiguration(org.springframework.core.io.Resource configuration)
          Set the location of the XML Esper configuration resource.
 void setName(java.lang.String name)
          Sets the name used to identify this template and its resources within Esper.
 void setStatements(java.util.Set<EsperStatement> statements)
          Add a collection of EsperStatement to the template.
 void setUnmatchedListener(com.espertech.esper.client.UnmatchedListener unmatchedListener)
          Specify the listener that should be notified of any unmatched events.
 

Method Detail

initialize

void initialize()
                throws InvalidEsperConfigurationException
Sets up and allocated all resources associated with this template prior to its use. Initializes the Esper service provider with the provided statements and associated listeners. Works together with the cleanup() operation, which in turn frees up the resources used by this template.

Throws:
InvalidEsperConfigurationException - thrown if any configuration errors have been made

cleanup

void cleanup()
Deallocated all resources associated with this template when it is finished with. Works together with the initialize() operation.


setName

void setName(java.lang.String name)
Sets the name used to identify this template and its resources within Esper.

Parameters:
name - The name associated with this template

setStatements

void setStatements(java.util.Set<EsperStatement> statements)
Add a collection of EsperStatement to the template.

Parameters:
statementBeans -

setConfiguration

void setConfiguration(org.springframework.core.io.Resource configuration)
Set the location of the XML Esper configuration resource.

Parameters:
configurationResource -

setUnmatchedListener

void setUnmatchedListener(com.espertech.esper.client.UnmatchedListener unmatchedListener)
Specify the listener that should be notified of any unmatched events.

Parameters:
unmatchedListener - The listener that is notified of events that are not matched

getEsperNativeRuntime

com.espertech.esper.client.EPRuntime getEsperNativeRuntime()
Retrieve the configured esper native runtime.

Returns:
The current esper native runtime

getStatements

java.util.Set<EsperStatement> getStatements()
Return the currently configured and registered set of EsperStatement objects.

Returns:
a set of configured EsperStatement objects.

addStatement

void addStatement(EsperStatement statement)
Adds an EsperStatement to the template.

Parameters:
statement - The EsperStatement to add to the template.

sendEvent

void sendEvent(java.lang.Object event)
               throws InvalidEsperConfigurationException
Instructs the template to send an event to Esper. Events are then used to satisfy statements, which then alert listeners.

Parameters:
event - The event that Esper is to be informed of.
Throws:
InvalidEsperConfigurationException - thrown if any runtime configuration problems occur


Copyright © 2010. All Rights Reserved.