com.espertech.esper.core
Class ConfigurationOperationsImpl

java.lang.Object
  extended by com.espertech.esper.core.ConfigurationOperationsImpl
All Implemented Interfaces:
ConfigurationOperations

public class ConfigurationOperationsImpl
extends Object
implements ConfigurationOperations

Provides runtime engine configuration operations.


Constructor Summary
ConfigurationOperationsImpl(EventAdapterService eventAdapterService, EngineImportService engineImportService, VariableService variableService, EngineSettingsService engineSettingsService, ValueAddEventService valueAddEventService)
          Ctor.
 
Method Summary
 void addEventTypeAlias(String eventTypeAlias, Class javaEventClass)
          Add an alias for an event type represented by Java-bean plain-old Java object events.
 void addEventTypeAlias(String eventTypeAlias, ConfigurationEventTypeXMLDOM xmlDOMEventTypeDesc)
          Add an alias for an event type that represents org.w3c.dom.Node events.
 void addEventTypeAlias(String eventTypeAlias, Map<String,Class> typeMap)
          Add an alias for an event type that represents java.util.Map events, taking a Map of event property and class name as a parameter.
 void addEventTypeAlias(String eventTypeAlias, Properties typeMap)
          Add an alias for an event type that represents java.util.Map events.
 void addEventTypeAlias(String eventTypeAlias, String javaEventClassName)
          Add an alias for an event type represented by JavaBean object events.
 void addEventTypeAliasNestable(String eventTypeAlias, Map<String,Object> typeMap)
          Add an alias for an event type that represents java.util.Map events, and for which each property may itself be a Map of further properties, with unlimited nesting levels.
 void addEventTypeAliasSimpleName(Class javaEventClass)
          Add an alias for an event type represented by Java-bean plain-old Java object events, using the simple name of the Java class as the alias.
 void addEventTypeAutoAlias(String javaPackageName)
          Adds a Java package name of a package that Java event classes reside in.
 void addImport(String importName)
          Adds a package or class to the list of automatically-imported classes and packages.
 void addNestableEventTypeAlias(String eventTypeAlias, Map<String,Object> typeMap)
          Add an alias for an event type that represents nestable strong-typed java.util.Map events, taking a Map of event property and class name as a parameter.
 void addPlugInAggregationFunction(String functionName, String aggregationClassName)
          Adds a plug-in aggregation function given a function name and an aggregation class name.
 void addPlugInEventType(String eventTypeAlias, URI[] resolutionURIs, Serializable initializer)
          Adds an alias for an event type that one of the plug-in event representations resolves to an event type.
 void addRevisionEventType(String revisionEventTypeAlias, ConfigurationRevisionEventType revisionEventTypeConfig)
          Adds an revision event type.
 void addVariable(String variableName, Class type, Object initializationValue)
          Add a variable.
 void addVariantStream(String variantEventTypeAlias, ConfigurationVariantStream variantStreamConfig)
          Adds a new variant stream.
 boolean isEventTypeAliasExists(String eventTypeAlias)
          Checks if an eventTypeAlias has already been registered for that alias name.
 void setPlugInEventTypeAliasResolutionURIs(URI[] urisToResolveAlias)
          Sets the URIs that point to plug-in event representations that are given a chance to dynamically resolve an event type alias to an event type, when a new (unseen) event type alias occurs in a new EPL statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationOperationsImpl

public ConfigurationOperationsImpl(EventAdapterService eventAdapterService,
                                   EngineImportService engineImportService,
                                   VariableService variableService,
                                   EngineSettingsService engineSettingsService,
                                   ValueAddEventService valueAddEventService)
Ctor.

Parameters:
eventAdapterService - is the event wrapper and type service
engineImportService - for imported aggregation functions and static functions
variableService - - provides access to variable values
engineSettingsService - - some engine settings are writable
valueAddEventService - - update event handling
Method Detail

addEventTypeAutoAlias

public void addEventTypeAutoAlias(String javaPackageName)
Description copied from interface: ConfigurationOperations
Adds a Java package name of a package that Java event classes reside in.

This setting allows an application to place all it's events into one or more Java packages and then declare these packages via this method. The engine attempts to resolve an event type alias to a Java class residing in each declared package.

For example, in the statement "select * from MyEvent" the engine attempts to load class "javaPackageName.MyEvent" and if successful, uses that class as the event type.

Specified by:
addEventTypeAutoAlias in interface ConfigurationOperations
Parameters:
javaPackageName - is the fully-qualified Java package name of the Java package that event classes reside in

addPlugInAggregationFunction

public void addPlugInAggregationFunction(String functionName,
                                         String aggregationClassName)
Description copied from interface: ConfigurationOperations
Adds a plug-in aggregation function given a function name and an aggregation class name.

The aggregation class must extends the base class AggregationSupport.

The same function name cannot be added twice.

Specified by:
addPlugInAggregationFunction in interface ConfigurationOperations
Parameters:
functionName - is the new aggregation function name
aggregationClassName - is the fully-qualified class name of the class implementing the aggregation function

addImport

public void addImport(String importName)
Description copied from interface: ConfigurationOperations
Adds a package or class to the list of automatically-imported classes and packages.

To import a single class offering a static method, simply supply the fully-qualified name of the class and use the syntax classname.methodname(...)

To import a whole package and use the classname.methodname(...) syntax, specifiy a package with wildcard, such as com.mycompany.staticlib.*.

Specified by:
addImport in interface ConfigurationOperations
Parameters:
importName - is a fully-qualified class name or a package name with wildcard

isEventTypeAliasExists

public boolean isEventTypeAliasExists(String eventTypeAlias)
Description copied from interface: ConfigurationOperations
Checks if an eventTypeAlias has already been registered for that alias name.

Specified by:
isEventTypeAliasExists in interface ConfigurationOperations
Parameters:
eventTypeAlias - the alias name
Returns:
true if already registered

addEventTypeAlias

public void addEventTypeAlias(String eventTypeAlias,
                              String javaEventClassName)
Description copied from interface: ConfigurationOperations
Add an alias for an event type represented by JavaBean object events.

Allows a second alias to be added for the same type. Does not allow the same alias to be used for different types.

Specified by:
addEventTypeAlias in interface ConfigurationOperations
Parameters:
eventTypeAlias - is the alias for the event type
javaEventClassName - fully-qualified class name of the event type

addEventTypeAlias

public void addEventTypeAlias(String eventTypeAlias,
                              Class javaEventClass)
Description copied from interface: ConfigurationOperations
Add an alias for an event type represented by Java-bean plain-old Java object events.

Allows a second alias to be added for the same type. Does not allow the same alias to be used for different types.

Specified by:
addEventTypeAlias in interface ConfigurationOperations
Parameters:
eventTypeAlias - is the alias for the event type
javaEventClass - is the Java event class for which to create the alias

addEventTypeAliasSimpleName

public void addEventTypeAliasSimpleName(Class javaEventClass)
Description copied from interface: ConfigurationOperations
Add an alias for an event type represented by Java-bean plain-old Java object events, using the simple name of the Java class as the alias.

For example, if your class is "com.mycompany.MyEvent", then this method adds the alias "MyEvent" for the class.

Allows a second alias to be added for the same type. Does not allow the same alias to be used for different types.

Specified by:
addEventTypeAliasSimpleName in interface ConfigurationOperations
Parameters:
javaEventClass - is the Java event class for which to create the alias from the class simple name

addEventTypeAlias

public void addEventTypeAlias(String eventTypeAlias,
                              Properties typeMap)
Description copied from interface: ConfigurationOperations
Add an alias for an event type that represents java.util.Map events.

Allows a second alias to be added for the same type. Does not allow the same alias to be used for different types.

Specified by:
addEventTypeAlias in interface ConfigurationOperations
Parameters:
eventTypeAlias - is the alias for the event type
typeMap - maps the name of each property in the Map event to the type (fully qualified classname) of its value in Map event instances.

addEventTypeAlias

public void addEventTypeAlias(String eventTypeAlias,
                              Map<String,Class> typeMap)
Description copied from interface: ConfigurationOperations
Add an alias for an event type that represents java.util.Map events, taking a Map of event property and class name as a parameter.

This method is provided for convenience and is same in function to method taking a Properties object that contain fully qualified class name as values.

Allows a second alias to be added for the same type. Does not allow the same alias to be used for different types.

Specified by:
addEventTypeAlias in interface ConfigurationOperations
Parameters:
eventTypeAlias - is the alias for the event type
typeMap - maps the name of each property in the Map event to the type of its value in the Map object

addEventTypeAliasNestable

public void addEventTypeAliasNestable(String eventTypeAlias,
                                      Map<String,Object> typeMap)
                               throws ConfigurationException
Description copied from interface: ConfigurationOperations
Add an alias for an event type that represents java.util.Map events, and for which each property may itself be a Map of further properties, with unlimited nesting levels.

Each entry in the type mapping must contain the String property name and either a Class or further Map value.

Specified by:
addEventTypeAliasNestable in interface ConfigurationOperations
Parameters:
eventTypeAlias - is the alias for the event type
typeMap - maps the name of each property in the Map event to the type (fully qualified classname) of its value in Map event instances.
Throws:
ConfigurationException - if the alias is already in used for a different type

addNestableEventTypeAlias

public void addNestableEventTypeAlias(String eventTypeAlias,
                                      Map<String,Object> typeMap)
Description copied from interface: ConfigurationOperations
Add an alias for an event type that represents nestable strong-typed java.util.Map events, taking a Map of event property and class name as a parameter.

This method takes a Map of String property names and Object property type. Each Object property type can either be a java.lang.Class to denote a built-in type or POJO application object, or can itself also be a Map to describe a property that itself is a map of further properties.

This method is provided for convenience and is same in function to method taking a Properties object that contain fully qualified class name as values.

Allows a second alias to be added for the same type. Does not allow the same alias to be used for different types.

Specified by:
addNestableEventTypeAlias in interface ConfigurationOperations
Parameters:
eventTypeAlias - is the alias for the event type
typeMap - maps the name of each property in the Map event to the type of its value in the Map object

addEventTypeAlias

public void addEventTypeAlias(String eventTypeAlias,
                              ConfigurationEventTypeXMLDOM xmlDOMEventTypeDesc)
Description copied from interface: ConfigurationOperations
Add an alias for an event type that represents org.w3c.dom.Node events.

Allows a second alias to be added for the same type. Does not allow the same alias to be used for different types.

Specified by:
addEventTypeAlias in interface ConfigurationOperations
Parameters:
eventTypeAlias - is the alias for the event type
xmlDOMEventTypeDesc - descriptor containing property and mapping information for XML-DOM events

addVariable

public void addVariable(String variableName,
                        Class type,
                        Object initializationValue)
                 throws ConfigurationException
Description copied from interface: ConfigurationOperations
Add a variable.

Specified by:
addVariable in interface ConfigurationOperations
Parameters:
variableName - name of the variable to add
type - the type of the variable must be a primitive or boxed Java-builtin scalar type.
initializationValue - is the first assigned value
Throws:
ConfigurationException - if the type and initialization value don't match or the variable name is already in use

addPlugInEventType

public void addPlugInEventType(String eventTypeAlias,
                               URI[] resolutionURIs,
                               Serializable initializer)
Description copied from interface: ConfigurationOperations
Adds an alias for an event type that one of the plug-in event representations resolves to an event type.

The order of the URIs matters as event representations are asked in turn, to accept the event type.

URIs can be child URIs of plug-in event representations and can add additional parameters or fragments for use by the event representation.

Specified by:
addPlugInEventType in interface ConfigurationOperations
Parameters:
eventTypeAlias - is the alias name of the event type
resolutionURIs - is URIs that are matched to registered event representations
initializer - is an optional value for parameterizing or configuring the event type

setPlugInEventTypeAliasResolutionURIs

public void setPlugInEventTypeAliasResolutionURIs(URI[] urisToResolveAlias)
Description copied from interface: ConfigurationOperations
Sets the URIs that point to plug-in event representations that are given a chance to dynamically resolve an event type alias to an event type, when a new (unseen) event type alias occurs in a new EPL statement.

The order of the URIs matters as event representations are asked in turn, to accept the alias.

URIs can be child URIs of plug-in event representations and can add additional parameters or fragments for use by the event representation.

Specified by:
setPlugInEventTypeAliasResolutionURIs in interface ConfigurationOperations
Parameters:
urisToResolveAlias - URIs for resolving the alias

addRevisionEventType

public void addRevisionEventType(String revisionEventTypeAlias,
                                 ConfigurationRevisionEventType revisionEventTypeConfig)
Description copied from interface: ConfigurationOperations
Adds an revision event type. The alias name of the event type may be used with named windows to indicate that updates or new versions of events are processed.

Specified by:
addRevisionEventType in interface ConfigurationOperations
Parameters:
revisionEventTypeAlias - the alias name of the revision event type
revisionEventTypeConfig - the configuration

addVariantStream

public void addVariantStream(String variantEventTypeAlias,
                             ConfigurationVariantStream variantStreamConfig)
Description copied from interface: ConfigurationOperations
Adds a new variant stream. Variant streams allow events of disparate types to be treated the same.

Specified by:
addVariantStream in interface ConfigurationOperations
Parameters:
variantEventTypeAlias - is the name of the variant stream
variantStreamConfig - the configuration such as variant type aliases and any-type setting

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com