com.espertech.esper.client
Class Configuration

java.lang.Object
  extended by com.espertech.esper.client.Configuration
All Implemented Interfaces:
ConfigurationInformation, ConfigurationOperations, Serializable

public class Configuration
extends Object
implements ConfigurationOperations, ConfigurationInformation, Serializable

An instance of Configuration allows the application to specify properties to be used when creating a EPServiceProvider. Usually an application will create a single Configuration, then get one or more instances of EPServiceProvider via EPServiceProviderManager. The Configuration is meant only as an initialization-time object. EPServiceProviders are immutable and do not retain any association back to the Configuration.
The format of an Esper XML configuration file is defined in esper-configuration-2.0.xsd.

See Also:
Serialized Form

Nested Class Summary
static class Configuration.PropertyResolutionStyle
          Enumeration of different resolution styles for resolving property names.
 
Field Summary
protected  Map<String,ConfigurationDBRef> databaseReferences
          The class and package name imports that will be used to resolve partial class names.
protected  ConfigurationEngineDefaults engineDefaults
          Saves engine default configs such as threading settings
protected  String epServicesContextFactoryClassName
          Optional classname to use for constructing services context.
protected static String ESPER_DEFAULT_CONFIG
          Default name of the configuration file.
protected  Map<String,String> eventClasses
          Map of event name and fully-qualified class name.
protected  Set<String> eventTypeAutoAliasPackages
          Saves the packages to search to resolve event type aliases.
protected  Map<String,ConfigurationEventTypeLegacy> eventTypesLegacy
          Map of event type alias and Legacy-type event configuration.
protected  Map<String,ConfigurationEventTypeXMLDOM> eventTypesXMLDOM
          Map of event type alias and XML DOM configuration.
protected  List<String> imports
          The class and package name imports that will be used to resolve partial class names.
protected  Map<String,Properties> mapAliases
          The type aliases for events that are backed by java.util.Map, not containing strongly-typed nested maps.
protected  Map<String,ConfigurationMethodRef> methodInvocationReferences
          Map of class name and configuration for method invocations on that class.
protected  Map<String,Map<String,Object>> nestableMapAliases
          The type aliases for events that are backed by java.util.Map, possibly containing strongly-typed nested maps.
protected  List<ConfigurationPlugInAggregationFunction> plugInAggregationFunctions
          List of configured plug-in aggregation functions.
protected  Map<URI,ConfigurationPlugInEventRepresentation> plugInEventRepresentation
          Map of plug-in event representation name and configuration
protected  URI[] plugInEventTypeAliasResolutionURIs
          URIs that point to plug-in event representations that are given a chance to dynamically resolve an event type alias to an event type, as it occurs in a new EPL statement.
protected  Map<String,ConfigurationPlugInEventType> plugInEventTypes
          Map of plug-in event types.
protected  List<ConfigurationPluginLoader> pluginLoaders
          List of adapter loaders.
protected  List<ConfigurationPlugInPatternObject> plugInPatternObjects
          List of configured plug-in pattern objects.
protected  List<ConfigurationPlugInView> plugInViews
          List of configured plug-in views.
protected  Map<String,ConfigurationRevisionEventType> revisionEventTypes
          All revision event types which allow updates to past events.
protected  Map<String,ConfigurationVariable> variables
          Map of variables.
protected  Map<String,ConfigurationVariantStream> variantStreams
          Variant streams allow events of disparate types to be treated the same.
 
Constructor Summary
Configuration()
          Constructs an empty configuration.
 
Method Summary
 void addDatabaseReference(String name, ConfigurationDBRef configurationDBRef)
          Add a database reference with a given database name.
 void addEventTypeAlias(String eventTypeAlias, Class eventClass)
          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 eventClassName)
          Add an alias for an event type represented by Java-bean plain-old Java object events.
 void addEventTypeAlias(String eventTypeAlias, String eventClass, ConfigurationEventTypeLegacy legacyEventTypeDesc)
          Add an alias for an event type that represents legacy Java type (non-JavaBean style) 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 eventClass)
          Add an alias for an event type represented by Java-bean plain-old Java object events, and the alias is the simple class name of the class.
 void addEventTypeAutoAlias(String packageName)
          Adds a Java package name of a package that Java event classes reside in.
 void addImport(String autoImport)
          Adds a package or class to the list of automatically-imported classes and packages.
 void addMethodRef(Class clazz, ConfigurationMethodRef methodInvocationConfig)
          Adds a cache configuration for a class providing methods for use in the from-clause.
 void addMethodRef(String className, ConfigurationMethodRef methodInvocationConfig)
          Adds a cache configuration for a class providing methods for use in the from-clause.
 void addNestableEventTypeAlias(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 addPlugInAggregationFunction(String functionName, String aggregationClassName)
          Adds a plug-in aggregation function given a function name and an aggregation class name.
 void addPlugInEventRepresentation(URI eventRepresentationRootURI, Class eventRepresentationClass, Serializable initializer)
          Adds an event representation responsible for creating event types (event metadata) and event bean instances (events) for a certain kind of object representation that holds the event property values.
 void addPlugInEventRepresentation(URI eventRepresentationRootURI, String eventRepresentationClassName, Serializable initializer)
          Adds an event representation responsible for creating event types (event metadata) and event bean instances (events) for a certain kind of object representation that holds the event property values.
 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 addPluginLoader(String loaderName, String className, Properties configuration)
          Add a plugin loader (f.e.
 void addPlugInPatternGuard(String namespace, String name, String guardFactoryClass)
          Add a pattern guard for plug-in.
 void addPlugInPatternObserver(String namespace, String name, String observerFactoryClass)
          Add a pattern event observer for plug-in.
 void addPlugInView(String namespace, String name, String viewFactoryClass)
          Add a view for plug-in.
 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.
 Configuration configure()
          Use the configuration specified in an application resource named esper.cfg.xml.
 Configuration configure(Document document)
          Use the mappings and properties specified in the given XML document.
 Configuration configure(File configFile)
          Use the configuration specified in the given application file.
 Configuration configure(String resource)
          Use the configuration specified in the given application resource.
 Configuration configure(URL url)
          Use the configuration specified by the given URL.
protected static InputStream getConfigurationInputStream(String resource)
          Get the configuration file as an InputStream.
 Map<String,ConfigurationDBRef> getDatabaseReferences()
          Returns a map of string database names to database configuration options.
 ConfigurationEngineDefaults getEngineDefaults()
          Returns engine default settings.
 String getEPServicesContextFactoryClassName()
          Returns the service context factory class name
 Map<String,String> getEventTypeAliases()
          Returns the mapping of event type alias to Java class name.
 Set<String> getEventTypeAutoAliasPackages()
          Returns a set of Java package names that Java event classes reside in.
 Map<String,ConfigurationEventTypeLegacy> getEventTypesLegacy()
          Returns the mapping of event type alias to legacy java event type information.
 Map<String,Properties> getEventTypesMapEvents()
          Returns a map keyed by event type alias name, and values being the definition for the event type of the property names and types that make up the event.
 Map<String,Map<String,Object>> getEventTypesNestableMapEvents()
          Returns a map keyed by event type alias name, and values being the definition for the event type of the property names and types that make up the event, for nestable, strongly-typed Map-based event representations.
 Map<String,ConfigurationEventTypeXMLDOM> getEventTypesXMLDOM()
          Returns the mapping of event type alias to XML DOM event type information.
 List<String> getImports()
          Returns the class and package imports.
 Map<String,ConfigurationMethodRef> getMethodInvocationReferences()
          Returns a map of class name and cache configurations, for use in method invocations in the from-clause of methods provided by the class.
 List<ConfigurationPlugInAggregationFunction> getPlugInAggregationFunctions()
          Returns a list of configured plug-in aggregation functions.
 Map<URI,ConfigurationPlugInEventRepresentation> getPlugInEventRepresentation()
          Returns a map of plug-in event representation URI and their event representation class and initializer.
 URI[] getPlugInEventTypeAliasResolutionURIs()
          Returns 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.
 Map<String,ConfigurationPlugInEventType> getPlugInEventTypes()
          Returns a map of event type alias of those event types that will be supplied by a plug-in event representation, and their configuration.
 List<ConfigurationPluginLoader> getPluginLoaders()
          Returns a list of configured plugin loaders.
 List<ConfigurationPlugInPatternObject> getPlugInPatternObjects()
          Returns a list of configured plug-ins for pattern observers and guards.
 List<ConfigurationPlugInView> getPlugInViews()
          Returns a list of configured plug-in views.
protected static InputStream getResourceAsStream(String resource)
          Returns an input stream from an application resource in the classpath.
 Map<String,ConfigurationRevisionEventType> getRevisionEventTypes()
          Returns a map of revision event type alias and revision event type configuration.
 Map<String,ConfigurationVariable> getVariables()
          Returns the variables by name as key and type plus initialization value as value
 Map<String,ConfigurationVariantStream> getVariantStreams()
          Returns a map of variant stream alias and variant configuration information.
 boolean isEventTypeAliasExists(String eventTypeAlias)
          Checks if an eventTypeAlias has already been registered for that alias name.
protected  void reset()
          Reset to an empty configuration.
 void setEPServicesContextFactoryClassName(String epServicesContextFactoryClassName)
          Sets the class name of the services context factory class to use.
 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
 

Field Detail

ESPER_DEFAULT_CONFIG

protected static final String ESPER_DEFAULT_CONFIG
Default name of the configuration file.

See Also:
Constant Field Values

eventClasses

protected Map<String,String> eventClasses
Map of event name and fully-qualified class name.


eventTypesXMLDOM

protected Map<String,ConfigurationEventTypeXMLDOM> eventTypesXMLDOM
Map of event type alias and XML DOM configuration.


eventTypesLegacy

protected Map<String,ConfigurationEventTypeLegacy> eventTypesLegacy
Map of event type alias and Legacy-type event configuration.


mapAliases

protected Map<String,Properties> mapAliases
The type aliases for events that are backed by java.util.Map, not containing strongly-typed nested maps.


nestableMapAliases

protected Map<String,Map<String,Object>> nestableMapAliases
The type aliases for events that are backed by java.util.Map, possibly containing strongly-typed nested maps.

Each entrie's value must be either a Class or a Map to define nested maps.


imports

protected List<String> imports
The class and package name imports that will be used to resolve partial class names.


databaseReferences

protected Map<String,ConfigurationDBRef> databaseReferences
The class and package name imports that will be used to resolve partial class names.


epServicesContextFactoryClassName

protected String epServicesContextFactoryClassName
Optional classname to use for constructing services context.


plugInViews

protected List<ConfigurationPlugInView> plugInViews
List of configured plug-in views.


plugInPatternObjects

protected List<ConfigurationPlugInPatternObject> plugInPatternObjects
List of configured plug-in pattern objects.


plugInAggregationFunctions

protected List<ConfigurationPlugInAggregationFunction> plugInAggregationFunctions
List of configured plug-in aggregation functions.


pluginLoaders

protected List<ConfigurationPluginLoader> pluginLoaders
List of adapter loaders.


engineDefaults

protected ConfigurationEngineDefaults engineDefaults
Saves engine default configs such as threading settings


eventTypeAutoAliasPackages

protected Set<String> eventTypeAutoAliasPackages
Saves the packages to search to resolve event type aliases.


variables

protected Map<String,ConfigurationVariable> variables
Map of variables.


methodInvocationReferences

protected Map<String,ConfigurationMethodRef> methodInvocationReferences
Map of class name and configuration for method invocations on that class.


plugInEventRepresentation

protected Map<URI,ConfigurationPlugInEventRepresentation> plugInEventRepresentation
Map of plug-in event representation name and configuration


plugInEventTypes

protected Map<String,ConfigurationPlugInEventType> plugInEventTypes
Map of plug-in event types.


plugInEventTypeAliasResolutionURIs

protected URI[] plugInEventTypeAliasResolutionURIs
URIs that point to plug-in event representations that are given a chance to dynamically resolve an event type alias to an event type, as it occurs in a new EPL statement.


revisionEventTypes

protected Map<String,ConfigurationRevisionEventType> revisionEventTypes
All revision event types which allow updates to past events.


variantStreams

protected Map<String,ConfigurationVariantStream> variantStreams
Variant streams allow events of disparate types to be treated the same.

Constructor Detail

Configuration

public Configuration()
Constructs an empty configuration. The auto import values are set by default to java.lang, java.math, java.text and java.util.

Method Detail

setEPServicesContextFactoryClassName

public void setEPServicesContextFactoryClassName(String epServicesContextFactoryClassName)
Sets the class name of the services context factory class to use.

Parameters:
epServicesContextFactoryClassName - service context factory class name

getEPServicesContextFactoryClassName

public String getEPServicesContextFactoryClassName()
Description copied from interface: ConfigurationInformation
Returns the service context factory class name

Specified by:
getEPServicesContextFactoryClassName in interface ConfigurationInformation
Returns:
class name

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

isEventTypeAliasExists

public boolean isEventTypeAliasExists(String eventTypeAlias)
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
Since:
2.1

addEventTypeAlias

public void addEventTypeAlias(String eventTypeAlias,
                              String eventClassName)
Add an alias for an event type represented by Java-bean plain-old Java object events.

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

addEventTypeAlias

public void addEventTypeAlias(String eventTypeAlias,
                              Class eventClass)
Add an alias for an event type represented by Java-bean plain-old Java object events.

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

addEventTypeAliasSimpleName

public void addEventTypeAliasSimpleName(Class eventClass)
Add an alias for an event type represented by Java-bean plain-old Java object events, and the alias is the simple class name of the class.

Specified by:
addEventTypeAliasSimpleName in interface ConfigurationOperations
Parameters:
eventClass - is the Java event class for which to create the alias

addEventTypeAlias

public void addEventTypeAlias(String eventTypeAlias,
                              Properties typeMap)
Add an alias for an event type that represents java.util.Map events.

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.

addNestableEventTypeAlias

public void addNestableEventTypeAlias(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.

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

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 (fully qualified classname) of its value in Map event instances.

addEventTypeAliasNestable

public void addEventTypeAliasNestable(String eventTypeAlias,
                                      Map<String,Object> typeMap)
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.

addEventTypeAlias

public 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.

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.

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

addEventTypeAlias

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

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

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

addDatabaseReference

public void addDatabaseReference(String name,
                                 ConfigurationDBRef configurationDBRef)
Add a database reference with a given database name.

Parameters:
name - is the database name
configurationDBRef - descriptor containing database connection and access policy information

addEventTypeAlias

public void addEventTypeAlias(String eventTypeAlias,
                              String eventClass,
                              ConfigurationEventTypeLegacy legacyEventTypeDesc)
Add an alias for an event type that represents legacy Java type (non-JavaBean style) events.

Parameters:
eventTypeAlias - is the alias for the event type
eventClass - fully-qualified class name of the event type
legacyEventTypeDesc - descriptor containing property and mapping information for Legacy Java type events

addImport

public void addImport(String autoImport)
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:
autoImport - is a fully-qualified class name or a package name with wildcard

addMethodRef

public void addMethodRef(String className,
                         ConfigurationMethodRef methodInvocationConfig)
Adds a cache configuration for a class providing methods for use in the from-clause.

Parameters:
className - is the class name (simple or fully-qualified) providing methods
methodInvocationConfig - is the cache configuration

addMethodRef

public void addMethodRef(Class clazz,
                         ConfigurationMethodRef methodInvocationConfig)
Adds a cache configuration for a class providing methods for use in the from-clause.

Parameters:
clazz - is the class providing methods
methodInvocationConfig - is the cache configuration

getEventTypeAliases

public Map<String,String> getEventTypeAliases()
Description copied from interface: ConfigurationInformation
Returns the mapping of event type alias to Java class name.

Specified by:
getEventTypeAliases in interface ConfigurationInformation
Returns:
event type aliases for Java class names

getEventTypesMapEvents

public Map<String,Properties> getEventTypesMapEvents()
Description copied from interface: ConfigurationInformation
Returns a map keyed by event type alias name, and values being the definition for the event type of the property names and types that make up the event.

Specified by:
getEventTypesMapEvents in interface ConfigurationInformation
Returns:
map of event type alias name and definition of event properties

getEventTypesNestableMapEvents

public Map<String,Map<String,Object>> getEventTypesNestableMapEvents()
Description copied from interface: ConfigurationInformation
Returns a map keyed by event type alias name, and values being the definition for the event type of the property names and types that make up the event, for nestable, strongly-typed Map-based event representations.

Specified by:
getEventTypesNestableMapEvents in interface ConfigurationInformation
Returns:
map of event type alias name and definition of event properties

getEventTypesXMLDOM

public Map<String,ConfigurationEventTypeXMLDOM> getEventTypesXMLDOM()
Description copied from interface: ConfigurationInformation
Returns the mapping of event type alias to XML DOM event type information.

Specified by:
getEventTypesXMLDOM in interface ConfigurationInformation
Returns:
event type aliases mapping to XML DOM configs

getEventTypesLegacy

public Map<String,ConfigurationEventTypeLegacy> getEventTypesLegacy()
Description copied from interface: ConfigurationInformation
Returns the mapping of event type alias to legacy java event type information.

Specified by:
getEventTypesLegacy in interface ConfigurationInformation
Returns:
event type aliases mapping to legacy java class configs

getImports

public List<String> getImports()
Description copied from interface: ConfigurationInformation
Returns the class and package imports.

Specified by:
getImports in interface ConfigurationInformation
Returns:
imported names

getDatabaseReferences

public Map<String,ConfigurationDBRef> getDatabaseReferences()
Description copied from interface: ConfigurationInformation
Returns a map of string database names to database configuration options.

Specified by:
getDatabaseReferences in interface ConfigurationInformation
Returns:
map of database configurations

getPlugInViews

public List<ConfigurationPlugInView> getPlugInViews()
Description copied from interface: ConfigurationInformation
Returns a list of configured plug-in views.

Specified by:
getPlugInViews in interface ConfigurationInformation
Returns:
list of plug-in view configs

getPluginLoaders

public List<ConfigurationPluginLoader> getPluginLoaders()
Description copied from interface: ConfigurationInformation
Returns a list of configured plugin loaders.

Specified by:
getPluginLoaders in interface ConfigurationInformation
Returns:
adapter loaders

getPlugInAggregationFunctions

public List<ConfigurationPlugInAggregationFunction> getPlugInAggregationFunctions()
Description copied from interface: ConfigurationInformation
Returns a list of configured plug-in aggregation functions.

Specified by:
getPlugInAggregationFunctions in interface ConfigurationInformation
Returns:
list of configured aggregations

getPlugInPatternObjects

public List<ConfigurationPlugInPatternObject> getPlugInPatternObjects()
Description copied from interface: ConfigurationInformation
Returns a list of configured plug-ins for pattern observers and guards.

Specified by:
getPlugInPatternObjects in interface ConfigurationInformation
Returns:
list of pattern plug-ins

getVariables

public Map<String,ConfigurationVariable> getVariables()
Description copied from interface: ConfigurationInformation
Returns the variables by name as key and type plus initialization value as value

Specified by:
getVariables in interface ConfigurationInformation
Returns:
map of variable name and variable configuration

getMethodInvocationReferences

public Map<String,ConfigurationMethodRef> getMethodInvocationReferences()
Description copied from interface: ConfigurationInformation
Returns a map of class name and cache configurations, for use in method invocations in the from-clause of methods provided by the class.

Specified by:
getMethodInvocationReferences in interface ConfigurationInformation
Returns:
map of fully-qualified or simple class name and cache configuration

getRevisionEventTypes

public Map<String,ConfigurationRevisionEventType> getRevisionEventTypes()
Description copied from interface: ConfigurationInformation
Returns a map of revision event type alias and revision event type configuration. Revision event types handle updates (new versions) for past events.

Specified by:
getRevisionEventTypes in interface ConfigurationInformation
Returns:
map of alias and revision event type config

addPluginLoader

public void addPluginLoader(String loaderName,
                            String className,
                            Properties configuration)
Add a plugin loader (f.e. an input/output adapter loader).

Parameters:
loaderName - is the name of the loader
className - is the fully-qualified classname of the loader class
configuration - is loader cofiguration entries

addPlugInView

public void addPlugInView(String namespace,
                          String name,
                          String viewFactoryClass)
Add a view for plug-in.

Parameters:
namespace - is the namespace the view should be available under
name - is the name of the view
viewFactoryClass - is the view factory class to use

addPlugInPatternObserver

public void addPlugInPatternObserver(String namespace,
                                     String name,
                                     String observerFactoryClass)
Add a pattern event observer for plug-in.

Parameters:
namespace - is the namespace the observer should be available under
name - is the name of the observer
observerFactoryClass - is the observer factory class to use

addPlugInPatternGuard

public void addPlugInPatternGuard(String namespace,
                                  String name,
                                  String guardFactoryClass)
Add a pattern guard for plug-in.

Parameters:
namespace - is the namespace the guard should be available under
name - is the name of the guard
guardFactoryClass - is the guard factory class to use

addEventTypeAutoAlias

public void addEventTypeAutoAlias(String packageName)
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:
packageName - is the fully-qualified Java package name of the Java package that event classes reside in

addVariable

public void addVariable(String variableName,
                        Class type,
                        Object initializationValue)
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

addPlugInEventRepresentation

public void addPlugInEventRepresentation(URI eventRepresentationRootURI,
                                         String eventRepresentationClassName,
                                         Serializable initializer)
Adds an event representation responsible for creating event types (event metadata) and event bean instances (events) for a certain kind of object representation that holds the event property values.

Parameters:
eventRepresentationRootURI - uniquely identifies the event representation and acts as a parent for child URIs used in resolving
eventRepresentationClassName - is the name of the class implementing PlugInEventRepresentation.
initializer - is optional configuration or initialization information, or null if none required

addPlugInEventRepresentation

public void addPlugInEventRepresentation(URI eventRepresentationRootURI,
                                         Class eventRepresentationClass,
                                         Serializable initializer)
Adds an event representation responsible for creating event types (event metadata) and event bean instances (events) for a certain kind of object representation that holds the event property values.

Parameters:
eventRepresentationRootURI - uniquely identifies the event representation and acts as a parent for child URIs used in resolving
eventRepresentationClass - is the class implementing PlugInEventRepresentation.
initializer - is optional configuration or initialization information, or null if none required

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

getPlugInEventTypeAliasResolutionURIs

public URI[] getPlugInEventTypeAliasResolutionURIs()
Description copied from interface: ConfigurationInformation
Returns 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:
getPlugInEventTypeAliasResolutionURIs in interface ConfigurationInformation
Returns:
URIs for resolving an event type alias

getPlugInEventRepresentation

public Map<URI,ConfigurationPlugInEventRepresentation> getPlugInEventRepresentation()
Description copied from interface: ConfigurationInformation
Returns a map of plug-in event representation URI and their event representation class and initializer.

Specified by:
getPlugInEventRepresentation in interface ConfigurationInformation
Returns:
map of URI keys and event representation configuration

getPlugInEventTypes

public Map<String,ConfigurationPlugInEventType> getPlugInEventTypes()
Description copied from interface: ConfigurationInformation
Returns a map of event type alias of those event types that will be supplied by a plug-in event representation, and their configuration.

Specified by:
getPlugInEventTypes in interface ConfigurationInformation
Returns:
map of alias to plug-in event type config

getEventTypeAutoAliasPackages

public Set<String> getEventTypeAutoAliasPackages()
Description copied from interface: ConfigurationInformation
Returns a set of Java package names 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:
getEventTypeAutoAliasPackages in interface ConfigurationInformation
Returns:
set of Java package names to look for events types when encountering a new event type alias

getEngineDefaults

public ConfigurationEngineDefaults getEngineDefaults()
Description copied from interface: ConfigurationInformation
Returns engine default settings.

Specified by:
getEngineDefaults in interface ConfigurationInformation
Returns:
engine defaults

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

getVariantStreams

public Map<String,ConfigurationVariantStream> getVariantStreams()
Description copied from interface: ConfigurationInformation
Returns a map of variant stream alias and variant configuration information. Variant streams allows handling events of all sorts of different event types the same way.

Specified by:
getVariantStreams in interface ConfigurationInformation
Returns:
map of alias and variant stream config

configure

public Configuration configure()
                        throws EPException
Use the configuration specified in an application resource named esper.cfg.xml.

Returns:
Configuration initialized from the resource
Throws:
EPException - thrown to indicate error reading configuration

configure

public Configuration configure(String resource)
                        throws EPException
Use the configuration specified in the given application resource. The format of the resource is defined in esper-configuration-2.0.xsd.

The resource is found via getConfigurationInputStream(resource). That method can be overridden to implement an arbitrary lookup strategy.

See getResourceAsStream for information on how the resource name is resolved.

Parameters:
resource - if the file name of the resource
Returns:
Configuration initialized from the resource
Throws:
EPException - thrown to indicate error reading configuration

getConfigurationInputStream

protected static InputStream getConfigurationInputStream(String resource)
                                                  throws EPException
Get the configuration file as an InputStream. Might be overridden by subclasses to allow the configuration to be located by some arbitrary mechanism.

See getResourceAsStream for information on how the resource name is resolved.

Parameters:
resource - is the resource name
Returns:
input stream for resource
Throws:
EPException - thrown to indicate error reading configuration

configure

public Configuration configure(URL url)
                        throws EPException
Use the configuration specified by the given URL. The format of the document obtained from the URL is defined in esper-configuration-2.0.xsd.

Parameters:
url - URL from which you wish to load the configuration
Returns:
A configuration configured via the file
Throws:
EPException - is thrown when the URL could not be access

configure

public Configuration configure(File configFile)
                        throws EPException
Use the configuration specified in the given application file. The format of the file is defined in esper-configuration-2.0.xsd.

Parameters:
configFile - File from which you wish to load the configuration
Returns:
A configuration configured via the file
Throws:
EPException - when the file could not be found

configure

public Configuration configure(Document document)
                        throws EPException
Use the mappings and properties specified in the given XML document. The format of the file is defined in esper-configuration-2.0.xsd.

Parameters:
document - an XML document from which you wish to load the configuration
Returns:
A configuration configured via the Document
Throws:
EPException - if there is problem in accessing the document.

getResourceAsStream

protected static InputStream getResourceAsStream(String resource)
Returns an input stream from an application resource in the classpath.

The method first removes the '/' character from the resource name if the first character is '/'.

The lookup order is as follows:

If a thread context class loader exists, use Thread.currentThread().getResourceAsStream to obtain an InputStream.

If no input stream was returned, use the Configuration.class.getResourceAsStream. to obtain an InputStream.

If no input stream was returned, use the Configuration.class.getClassLoader().getResourceAsStream. to obtain an InputStream.

If no input stream was returned, throw an Exception.

Parameters:
resource - to get input stream for
Returns:
input stream for resource

reset

protected void reset()
Reset to an empty configuration.


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