Reference Guide

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Oracle CEP Application Assembly Tag Reference

This section contains information on the following subjects:

 


Overview of the Oracle CEP Application Assembly Tags

Oracle Complex Event Processing, or Oracle CEP for short, provides a number of application assembly tags that you use in the EPN assembly file of your application to register event types, declare the components of the event processing network and specify how they are linked together. The EPN assembly file is an extension of the standard Spring context file.

Graphical Representation

The following graphic describes the hierarchy of the Oracle CEP application assembly tags.

Figure 2-1 Hierarchy of Oracle CEP Application Assembly Tags

Hierarchy of Oracle CEP Application Assembly Tags

Figure 2-2 Hierarchy of Oracle CEP Application Assembly Tags (continued)

Hierarchy of Oracle CEP Application Assembly Tags (continued)

Example of an EPN Assembly File That Uses Oracle CEP Tags

The following sample EPN assembly file from the HelloWorld application shows how to use many of the Oracle CEP tags:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:wlevs="http://www.bea.com/ns/wlevs/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.bea.com/ns/wlevs/spring
http://www.bea.com/ns/wlevs/spring/spring-wlevs.xsd">
    <wlevs:event-type-repository>
<wlevs:event-type type-name="HelloWorldEvent">
<wlevs:class>com.bea.wlevs.event.example.helloworld.HelloWorldEvent</wlevs:class>
</wlevs:event-type>
</wlevs:event-type-repository>
    <wlevs:adapter id="helloworldAdapter" 
class="com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter" >
<wlevs:instance-property name="message"
value="HelloWorld - the currenttime is:"/>
</wlevs:adapter>
    <wlevs:processor id="helloworldProcessor" />
    <wlevs:stream id="helloworldInstream" >
<wlevs:listener ref="helloworldProcessor"/>
<wlevs:source ref="helloworldAdapter"/>
</wlevs:stream>
    <wlevs:stream id="helloworldOutstream" advertise="true">
<wlevs:listener>
<bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
</wlevs:listener>
<wlevs:source ref="helloworldProcessor"/>
</wlevs:stream>
</beans>

 


wlevs:adapter

Use this tag to declare an adapter component to the Spring application context.

Child Tags

The wlevs:adapter application assembly tag supports the following child tags:

Attributes

The following table lists the attributes of the wlevs:adapter application assembly tag.

Table 2-1 Attributes of the wlevs:adapter Application Assembly Tag
Attribute
Description
Data Type
Required?
id
Unique identifier for this component.
This identifier must correspond to the <name> element in the XML configuration file for this adapter, if one exists.
String
Yes.
advertise
Advertises this service in the OSGi registry.
Valid values are true and false. Default value is false.
Boolean
No.
listeners
Specifies the components that listen to this component.
Set this attribute to the value of the id attribute of the element that declared the component.
String
No.
provider
Specifies the adapter service provider. Typically the value of this attribute is a reference to the OSGi-registered adapter factory service.
If you are using the csvgen or loadgen utilities to simulate a data feed, use the hard-coded csvgen or loadgen values, respectively, such as:

provider="csvgen"

If you are using one of the built-in HTTP publish-subscribe adapters, then specify the following hard-coded values:
  • For the built-in pub-sub adapter used for publishing, specify the hard-coded httppub value, such as:
  • provider="httppub"

  • For the built-in pub-sub adapter used for subscribing, specify the hard-coded httpsub value, such as:
  • provider="httpsub"

If you are using a JMS adapter, then specify one of the following hard-coded values:
  • For the inbound JMS adapter, specify the jms-inbound value, such as:
  • provider="jms-inbound"

  • For the outbound JMS adapter, specify the jms-outbound value, such as:
  • provider="jms-outbound"

You must specify either the provider or class attribute, but not both, otherwise an exception is raised.
String
No.
class
Specifies the Java class that implements this adapter.
You must specify either the provider or class attribute, but not both, otherwise an exception is raised.
String
No
onevent-method
Specifies the method of the adapter implementation that corresponds to the lifecycle onEvent method.
Oracle CEP invokes this method when the adapter receives an event.
String
No
init-method
Specifies the method of the adapter implementation that corresponds to the lifecycle init method.
Oracle CEP invokes this method after it has set all the supplied instance properties. This method allows the adapter instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
String
No
activate-method
Specifies the method of the adapter implementation that corresponds to the lifecycle activate method.
Oracle CEP invokes this method after the dynamic configuration of the adapter has completed. This method allows the adapter instance to perform initialization only possible when all dynamic bean properties have been set and the EPN has been wired.
String
No
suspend-method
Specifies the method of the adapter implementation that corresponds to the lifecycle suspend method.
Oracle CEP invokes this method when the application is suspended.
String
No
destroy-method
Specifies the method of the adapter implementation that corresponds to the lifecycle destroy method.
Oracle CEP invokes this method when the application is stopped.
String
No

Example

The following example shows how to use the wlevs:adapter tag in the EPN assembly file:

<wlevs:adapter id="helloworldAdapter" provider="hellomsgs">
<wlevs:instance-property name="message"
value="HelloWorld - the current time is:"/>
</wlevs:adapter>

In the example, the adapter’s unique identifier is helloworldAdapter. The provider is an OSGi service, also registered in the EPN assembly file, whose reference is hellomsgs. The adapter has a static property called message, which implies that the adapter Java file has a setMessage() method.

 


wlevs:cache

Use this tag to declare a cache to the Spring application context.

Child Tags

The wlevs:cache application assembly tag supports the following child tags.

Attributes

The following table lists the attributes of the wlevs:cache application assembly tag.

Table 2-2 Attributes of the wlevs:cache Application Assembly Tag
Attribute
Description
Data Type
Required?
id
Unique identifier for this component.
This identifier must correspond to the <name> element in the XML configuration file for this cache.
String
Yes.
name
Specifies an alternate name for this cache. If not specified, then the name of the cache is the same as its id attribute.
String
No.
key-properties
Specifies a comma-separated list of names of the properties that together form the unique key value for the objects in the cache, or cache key. A cache key may be composed of a single property or multiple properties. When you configure a cache as a listener in an event processing network, Oracle CEP inserts events that reach the cache using the unique key value as a key.
If you specify a key class using the key-class attribute, then this attribute is optional. If you specify neither key-properties nor key-class, then Oracle CEP uses the event object itself as both the key and value when it inserts the event object into the cache.
String
No.
key-class
Specifies the name of the Java class used for the cache key when the key is a composite key.
If you do not specify the key-properties attribute, then all properties on the key-class are assumed to be key properties. If you specify neither key-properties nor key-class, then Oracle CEP uses the event object itself as both the key and value when it inserts the event object into the cache
String
No.
value-type
Specifies the type for the values contained in the cache. Must be a valid type name in the event type repository.
This attribute is required only if the cache is referenced in an EPL query. This is because the query processor needs to know the type of events in the cache.
String
No.
caching-system
Specifies the caching system in which this cache is contained.
The value of this attribute corresponds to the id attribute of the appropriate wlevs:caching-system element.
String
Yes.
advertise
Advertises this service in the OSGi registry.
Valid values are true and false. Default value is false.
Boolean
No.

Example

The following example shows how to use the wlevs:cache tag in the EPN assembly file:

    <wlevs:cache id="cache-id" name="alternative-cache-name">
<wlevs:caching-system ref="caching-system-id"/>
<wlevs:cache-listener ref="tradeListener" />
</wlevs:cache>

In the example, the cache’s unique identifier is cache-id and its alternate name is alternative-cache-name. The caching system to which the cache belongs has an id of caching-system-id. The cache has a listener to which the cache sends events; the component that listens to it has an id of tradeListener.

 


wlevs:cache-listener

Use this tag to specify a cache as a source of events to the listening component. The listening component must implement the com.bea.cache.jcache.CacheListener interface.

This tag is always a child of wlevs:cache.

Attributes

The following table lists the attributes of the wlevs:cache-listener application assembly tag.

Table 2-3 Attributes of the wlevs:cache-listener Application Assembly Tag
Attribute
Description
Data Type
Required?
ref
Specifies the component that listens to this cache.
Set this attribute to the value of the id attribute of the listening component. The listening component can be an adapter or a Spring bean.
String
No.

Example

The following example shows how to use the wlevs:cache-listener tag in the EPN assembly file:

    <wlevs:caching-system id="caching-system-id"/>
...
<wlevs:cache id="cache-id" name="alternative-cache-name">
<wlevs:caching-system ref="caching-system-id"/>
<wlevs:cache-listener ref="cache-listener-id" />
</wlevs:cache>
...
<bean id="cache-listener-id" class="wlevs.example.MyCacheListener"/>

In the example, the cache-listener-id Spring bean listens to events coming from the cache; the class that implements this component, wlevs.example.MyCacheListener, must implement the com.bea.jcache.CacheListener interface. You must program the wlevs.example.MyCacheListener class yourself.

 


wlevs:cache-loader

Specifies the Spring bean that implements an object that loads data into a cache.

This tag is always a child of wlevs:cache.

Attributes

The following table lists the attributes of the wlevs:cache-loader application assembly tag.

Table 2-4 Attributes of the wlevs:cache-loader Application Assembly Tag
Attribute
Description
Data Type
Required?
ref
Specifies the Spring bean that implements the class that loads data into the cache.
Set this attribute to the value of the id attribute of the Spring bean.
The Spring bean must implement the com.bea.cache.jcache.CacheLoader interface.
String
Yes.

Example

The following example shows how to use the wlevs:cache-loader tag in the EPN assembly file:

    <wlevs:cache id="cache-id" name="alternative-cache-name">
<wlevs:caching-system ref="caching-system-id"/>
<wlevs:cache-loader ref="cache-loader-id" />
</wlevs:cache>
...
<bean id="cache-loader-id" class="wlevs.example.MyCacheLoader"/>

In the example, the cache-loader-id Spring bean, implemented with the wlevs.example.MyCacheLoader class that in turn implements the com.bea.cache.jcache.CacheLoader interface, is a bean that loads data into a cache. The cache specifies this loader by pointing to it with the ref attribute of the <wlevs:cache-loader> child element.

 


wlevs:cache-source

Specifies a cache that supplies data to this processor component. The processor component in turn is associated with an EPL query that directly references the cache.

Use the value-type attribute of the wlevs:cache tag to declare the event type of the data supplied by the cache.

This tag is a child of only wlevs:processor tag.

Attributes

The following table lists the attributes of the wlevs:cache-source application assembly tag.

Table 2-5 Attributes of the wlevs:cache-source Application Assembly Tag
Attribute
Description
Data Type
Required?
ref
Specifies the cache that is a source of data for the processor component.
Set this attribute to the value of the id attribute of the cache.
String
Yes.

Example

The following example shows how to use the wlevs:cache-source tag in the EPN assembly file:

   <wlevs:caching-system id="caching-system-id"/>
...
<wlevs:cache id="cache-id"
name="alternative-cache-name"
value-type="Company">
<wlevs:caching-system ref="caching-system-id"/>
</wlevs:cache>
  <wlevs:stream id="stream-id"/>
  <wlevs:processor id="processor-id">
<wlevs:cache-source ref="cache-id">
<wlevs:source ref="stream-id">
</wlevs:processor>

In the example, the processor will have data pushed to it from the stream-id stream as usual; however, the EPL queries that execute in the processor can also pull data from the cache-id cache. When the query processor matches an event type in the FROM clause to an event type supplied by a cache, such as Company, the processor pulls instances of that event type from the cache.

 


wlevs:cache-store

Specifies the Spring bean that implements a custom store that is responsible for writing data from the cache to a backing store, such as a table in a database.

This tag is always a child of wlevs:cache.

Attributes

The following table lists the attributes of the wlevs:cache-store application assembly tag.

Table 2-6 Attributes of the wlevs:cache-store Application Assembly Tag
Attribute
Description
Data Type
Required?
ref
Specifies the Spring bean that implements the custom store.
Set this attribute to the value of the id attribute of the Spring bean.
The Spring bean must implement the com.bea.cache.jcache.CacheStore interface.
String
Yes.

Example

The following example shows how to use the wlevs:cache-store tag in the EPN assembly file:

    <wlevs:cache id="cache-id" name="alternative-cache-name">
<wlevs:caching-system ref="caching-system-id"/>
<wlevs:cache-store ref="cache-store-id" />
</wlevs:cache>
...
<bean id="cache-store-id" class="wlevs.example.MyCacheStore"/>

In the example, the cache-store-id Spring bean, implemented with the wlevs.example.MyCacheStore class that in turn implements the com.bea.cache.jcache.CacheStore interface, is a bean for the custom store, such as a database. The cache specifies this store by pointing to it with the ref attribute of the <wlevs:cache-store> child element.

 


wlevs:caching-system

Specifies the caching system used by the application.

Child Tags

The wlevs:caching-system application assembly tag supports the following child tag:

Attributes

The following table lists the attributes of the wlevs:caching-system application assembly tag.

Table 2-7 Attributes of the wlevs:caching-system Application Assembly Tag
Attribute
Description
Data Type
Required?
id
Specifies the unique identifier for this caching system.
This identifier must correspond to the <name> element in the XML configuration file for this caching system
String
Yes.
advertise
Advertises this service in the OSGi registry.
Valid values are true and false. Default value is false.
Boolean
No.
provider
Specifies the provider of the caching system if you are using a third-party implementation, such as Oracle Coherence.
Typically this attribute corresponds to the provider-name attribute of a <factory> Spring tag that specifies the factory class that creates instances of the third-party caching system.
If you do not specify the provider or class attribute, then the default value is Oracle CEP’s own caching implementation for local single-JVM caches; this implementation uses an in-memory store.
String
No.
class
Specifies the Java class that implements this caching system; use this attribute to specify a third-party implementation rather than Oracle CEP’s own implementation.
If you specify this attribute, it is assumed that the third-party implementation code resides inside the Oracle CEP application bundle itself. The class file to which this attribute points must implement the com.bea.wlevs.cache.api.CachingSystem interface.
If you do not specify the provider or class attribute, then the default value is Oracle CEP’s own caching implementation for local single-JVM caches; this implementation uses an in-memory store.
String
No

Example

The following example shows the simplest use of the wlevs:caching-system tag in the EPN assembly file:

  <wlevs:caching-system id="caching-system-id"/>

The following example shows how to specify a third-party implementation that uses a factory as a provider:

  <wlevs:caching-system id ="caching-system-id" 
provider="caching-provider"/>
  <factory id="factory-id" provider-name="caching-provider">
<class>the.factory.class.name</class>
</factory>

In the example, the.factory.class.name is a factory for creating some third-party caching system; the provider attribute of wlevs:caching-system in turn references it as the caching system implementation for the application.

 


wlevs:event-bean

Use this tag to declare to the Spring application context that an event bean is part of your event processing network (EPN). Event beans are managed by the Oracle CEP container, analogous to Spring beans that are managed by the Spring framework. In many ways, event beans and Spring beans are similar so it is up to a developer which one to use in their EPN. Use a Spring bean for legacy integration to Spring. Use an event bean if you want to take full advantage of the additional capabilities of Oracle CEP.

For example, you can monitor an event bean using the Oracle CEP monitoring framework, make use of the Configuration framework metadata annotations, and record and playback events that pass through the event bean. An event-bean can also participate in the Oracle CEP bean lifecycle by specifying methods in its EPN assembly file declaration, rather than by implementing Oracle CEP API interfaces.

Child Tags

The wlevs:event-bean application assembly tag supports the following child tags:

Attributes

The following table lists the attributes of the wlevs:event-bean application assembly tag.

Table 2-8 Attributes of the wlevs:event-bean Application Assembly Tag
Attribute
Description
Data Type
Required?
id
Unique identifier for this component.
This identifier must correspond to the <name> element in the XML configuration file for this event-bean, if one exists.
String
Yes.
advertise
Advertises this service in the OSGi registry.
Valid values are true and false. Default value is false.
Boolean
No.
listeners
Specifies the components that listen to this component.
Set this attribute to the value of the id attribute of the element that declared the component.
String
No.
class
Specifies the Java class that implements this event bean. The bean is not required to implement any Oracle CEP interfaces.
You must specify either the provider or class attribute, but not both, otherwise an exception is raised.
   
provider
Specifies the service provider.
In this case, an EDE factory registered with this specific provider name must exist in the application.
You must specify either the provider or class attribute, but not both, otherwise an exception is raised.
String
No.
onevent-method
Specifies the method of the event bean implementation that corresponds to the lifecycle onEvent method.
Oracle CEP invokes this method when the event bean receives an event.
By using this lifecycle attribute, the event bean implementation does not have to explicitly implement an Oracle CEP interface.
String
No
init-method
Specifies the method of the event bean implementation that corresponds to the lifecycle init method.
Oracle CEP invokes this method after it has set all the supplied instance properties. This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
By using this lifecycle attribute, the event bean implementation does not have to explicitly implement an Oracle CEP interface.
String
No
activate-method
Specifies the method of the event bean implementation that corresponds to the lifecycle activate method.
Oracle CEP invokes this method after the dynamic configuration of the bean has completed. This method allows the bean instance to perform initialization only possible when all dynamic bean properties have been set and the EPN has been wired.
By using this lifecycle attribute, the event bean implementation does not have to explicitly implement an Oracle CEP interface.
String
No
suspend-method
Specifies the method of the event bean implementation that corresponds to the lifecycle suspend method.
Oracle CEP invokes this method when the application is suspended.
By using this lifecycle attribute, the event bean implementation does not have to explicitly implement an Oracle CEP interface.
String
No
destroy-method
Specifies the method of the event bean implementation that corresponds to the lifecycle destroy method.
Oracle CEP invokes this method when the application is stopped.
By using this lifecycle attribute, the event bean implementation does not have to explicitly implement an Oracle CEP interface.
String
No

Example

The following example shows how to use the wlevs:event-bean tag in the EPN assembly file:

    <wlevs:event-bean id="myBean" class="com.customer.SomeEventBean" >
<wlevs:listener ref="myProcessor" />
</wlevs:event-bean>

In the example, the event bean called myBean is implemented with the class com.customer.SomeEventBean. The component called myProcessor receives events from the myBean event bean.

 


wlevs:event-type-repository

Use this tag to group together one or more wlevs:event-type tags, each of which is used to register an event type used throughout the application.

This tag does not have any attributes.

Child Tags

The wlevs:event-type-repository application assembly tag supports the following child tag:

Example

The following example shows how to use the wlevs:event-type-repository tag in the EPN assembly file:

<wlevs:event-type-repository>
<wlevs:event-type type-name="HelloWorldEvent">
<wlevs:class>com.bea.wlevs.event.example.helloworld.HelloWorldEvent</wlevs:class>
</wlevs:event-type>
</wlevs:event-type-repository>

In the example, the <wlevs:event-type-repository> tag groups a single <wlevs:event-type> tag to declare a single event type: HelloWorldEvent. See wlevs:event-type for additional details.

 


wlevs:event-type

Specifies the definition of an event type used in the Oracle CEP application. Once you define the event types of the application, you can reference them in the adapter and business class POJO, as well as the EPL rules.

You can define an event type in the following ways:

You can specify one of either wlevs:class or wlevs:metadata as a child of wlevs:event-type, but not both.

You can also use the wlevs:property child tag to specify a custom property to apply to the event type.

Oracle recommends that you define your event type by using the wlevs:class child tag because you can them reuse the specified JavaBean class, and you control exactly what the event type looks like.

Child Tags

The wlevs:event-type application assembly tag supports the following child tags:

Attributes

The following table lists the attributes of the wlevs:event-type application assembly tag.

Table 2-9 Attributes of the wlevs:event-type Application Assembly Tag
Attribute
Description
Data Type
Required?
id
Specifies the unique identifier for this event type.
If you do not specify this attribute, Oracle CEP automatically generates an identifier for you.
q
No.
type-name
Specifies the name of of this event type.
This is the name you use whenever you reference the event type in the adapter, business POJO, or EPL rules.
String
Yes.

Example

The following example shows how to use the wlevs:event-type tag in the EPN assembly file:

<wlevs:event-type-repository>
<wlevs:event-type type-name="HelloWorldEvent">
<wlevs:class>com.bea.wlevs.event.example.helloworld.HelloWorldEvent</wlevs:class>
</wlevs:event-type>
</wlevs:event-type-repository>

In the example, the name of the event type is HelloWorldEvent and its definition is determined by the com.bea.wlevs.event.example.helloworld.HelloWorldEvent JavaBean class.

 


wlevs:factory

Use this tag to register a factory class as a service. Use of this tag decreases the dependency of your application on Spring-OSGi interfaces.

The Java source of this factory must implement the com.bea.wlevs.ede.api.Factory interface.

The factory tag does not allow you to specify service properties. If you need to specify service properties, then you must use the Spring- OSGi <osgi:service> tag instead.

This tag does not have any child tags.

Attributes

The following table lists the attributes of the wlevs:factory application assembly tag.

Table 2-10 Attributes of the wlevs:factory Application Assembly Tag
Attribute
Description
Data Type
Required?
class
Specifies the Java class that implements the factory. This class must implement the com.bea.wlevs.ede.api.Factory interface.
String
Yes.
provider-name
Specifies the name of this provider. Reference this name later in the component that uses this factory.
String
Yes.

Example

The following example shows how to use the wlevs:factory tag in the EPN assembly file:

<wlevs:factory provider-name="myEventSourceFactory"
class="com.customer.MyEventSourceFactory" />

In the example, the factory implemented by the com.customer.MyEventSourceFactory goes by the provider name of myEventSourceFactory.

 


wlevs:function

Use this tag to specify a bean that contains user-defined functions for a processor.

This tag always has a standard Spring <bean> tag as a child that specifies the Spring bean for the user-defined function.

Attributes

The following table lists the attributes of the wlevs:function application assembly tag.

Table 2-11 Attributes of the wlevs:function Application Assembly Tag
Attribute
Description
Data Type
Required?
epl-name
An alternate name to use when referencing this function bean in an EPL query.
The default value is the Spring bean name.
String
No.

Example

The following example shows how to use the wlevs:function tag in the EPN assembly file:

<wlevs:processor id="testProcessor">
<wlevs:listener ref="providerCache"/>
<wlevs:listener ref="outputCache"/>
<wlevs:cache-source ref="testCache"/>
<wlevs:function epl-name="testfunction">
<bean class="com.bea.wlevs.example.cache.function.TestFunction"/>
</wlevs:function>
</wlevs:processor>

 


wlevs:instance-property

Specifies the properties that apply to the create stage instance of the component to which this is a child tag. This allows declarative configuration of user-defined stage properties.

This tag is used only as a child of wlevs:adapter, wlevs:processor, wlevs:stream, or wlevs:caching-system.

The wlevs:instance-property tag is defined as the Spring propertyType type; for additional details of this Spring data type, the definition of the allowed child tags, and so on, see the Spring 2.0 XSD.

Child Tags

You can specify one of the following standard Spring tags as a child tag of the wlevs:instance-property tag:

Attributes

The following table lists the attributes of the wlevs:instance-property application assembly tag.

Table 2-12 Attributes of the wlevs:instance-property Application Assembly Tag
Attribute
Description
Data Type
Required?
name
Specifies the name of the property, following JavaBean naming conventions.
String
Yes.
ref
A short-cut alternative to a nested <ref bean='...'/> element.
String
No.
value
A short-cut alternative to a nested <value>...</value> element.
String
No.

Example

The following example shows how to use the wlevs:instance-property tag in the EPN assembly file:

<wlevs:adapter id="helloworldAdapter" provider="hellomsgs">
<wlevs:instance-property name="message" value="HelloWorld - the current time is:"/>
</wlevs:adapter>

In the example, the bean that implements the helloworldAdapter adapter component expects an instance property called message; the sample wlevs:instance-property tag above sets the value of this property to HelloWorld - the current time is:.

 


wlevs:listener

Specifies the component that listens to the component to which this tag is a child. A listener can be an instance of any other component. You can also nest the definition of a component within a particular wlevs:listener component to specify the component that listens to the parent.

WARNING: Nested definitions are not eligible for dynamic configuration or monitoring.

This tag is always a child of wlevs:adapter, wlevs:processor, wlevs:stream, wlevs:event-bean or wlevs:cache.

Attributes

The following table lists the attributes of the wlevs:listener application assembly tag.

Table 2-13 Attributes of the wlevs:listener Application Assembly Tag
Attribute
Description
Data Type
Required?
ref
Specifies the component that listens to the parent component .
Set this attribute to the value of the id attribute of the listener component.
You do not specify this attribute if you are nesting listeners.
String
No.

Example

The following example shows how to use the wlevs:listener tag in the EPN assembly file:

    <wlevs:processor id="helloworldProcessor">
<wlevs:listener ref="helloworldOutstream"/>
</wlevs:processor>

In the example, the hellworldOutstream component listens to the helloworldProcessor component. It is assumed that the EPN assembly file also contains a declaration for a <wlevs:adapter>, <wlevs:stream>, or <wlevs:processor> component whose unique identifier is helloworldOustream.

 


wlevs:metadata

Specifies the definition of an event type by listing its fields as a group of Spring entry tags. When you define an event type this way, Oracle CEP automatically generates the Java class for you.

Use the key attribute of the entry tag to specify the name of a field and the value attribute to specify the Java class that represents the field’s data type.

This tag is used only as a child of wlevs:event-type.

The wlevs:metadata tag is defined as the Spring mapType type; for additional details of this Spring data type, see the Spring 2.0 XSD.

Child Tags

The wlevs:metadata tag can have one or more standard Spring entry child tags.

Attributes

The following table lists the attributes of the wlevs:metadata application assembly tag.

Table 2-14 Attributes of the wlevs:metadata Application Assembly Tag
Attribute
Description
Data Type
Required?
key-type
The default fully qualified classname of a Java data type for nested entry tags.
You use this attribute only if you have nested entry tags.
String
No.

Example

The following example shows how to use the wlevs:metadata tag in the EPN assembly file:

<wlevs:event-type type-name="ForeignExchangeEvent">
<wlevs:metadata>
<entry key="symbol" value="java.lang.String"/>
<entry key="price" value="java.lang.Double"/>
<entry key="fromRate" value="java.lang.String"/>
<entry key="toRate" value="java.lang.String"/>
</wlevs:metadata>
...
</wlevs:event-type>

In the example, the wlevs:metadata tag groups together four standard Spring entry tags that represent the four fields of the ForeignExchangeEvent: symbol, price, fromRate, and toRate. The data types of the fields are java.lang.String, java.lang.Double, java.lang.String, and java.lang.String, respectively.

 


wlevs:processor

Use this tag to declare a processor to the Spring application context.

Child Tags

The wlevs:processor Spring tag supports the following child tags:

Attributes

The following table lists the attributes of the wlevs:processor application assembly tag.

Table 2-15 Attributes of the wlevs:processor Application Assembly Tag
Attribute
Description
Data Type
Required?
id
Unique identifier for this component.
This identifier must correspond to the <name> element in the XML configuration file for this processor; this is how Oracle CEP knows which EPL rules to execute for which processor component in your network.
String
Yes.
advertise
Advertises this service in the OSGi registry.
Valid values are true and false. Default value is false.
Boolean
No.
listeners
Specifies the components that listen to this component.
Set this attribute to the value of the id attribute of the element that declared the component.
String
No.
provider
Specifies the language provider of the processor, such as the Event Processor Language (EPL).
Valid values are:
  • epl
The default value is epl.
String
No.
queryURL
Specifies a URL that points to an EPL rules definition file for this processor.
String.
No.

Example

The following example shows how to use the wlevs:processor tag in the EPN assembly file:

   <wlevs:processor id="spreader" />

The example shows how to declare a processor with ID spreader. This means that in the processor configuration file that contains the EPL rules for this processor, the <name> element must contain the value spreader. This way Oracle CEP knows which EPL rules it must file for this particular processor.

 


wlevs:property

Specifies a custom property to apply to the event type.

This tag is used only as a child of wlevs:event-type, wlevs:adapter, wlevs:processor, wlevs:stream, or wlevs:caching-system.

The wlevs:property tag is defined as the Spring propertyType type; for additional details of this Spring data type, the definition of the allowed child tags, and so on, see the Spring 2.0 XSD.

Child Tags

You can specify one of the following standard Spring tags as a child element of the wlevs:property tag:

Attributes

The following table lists the attributes of the wlevs:property application assembly tag.

Table 2-16 Attributes of the wlevs:property Application Assembly Tag
Attribute
Description
Data Type
Required?
name
Specifies the name of the property, following JavaBean naming conventions.
String
Yes.
ref
A short-cut alternative to a nested <ref bean='...'/> element.
String
No.
value
A short-cut alternative to a nested <value>...</value> element.
String
No.

Example

The following example shows how to use the wlevs:property tag in the EPN assembly file:

<wlevs:event-type type-name="ForeignExchangeEvent">
<wlevs:metadata>
<entry key="symbol" value="java.lang.String"/>
<entry key="price" value="java.lang.Double"/>
</wlevs:metadata>
<wlevs:property name="builderFactory">
<bean id="builderFactory"
class="com.bea.wlevs.example.fx.ForeignExchangeBuilderFactory"/>
</wlevs:property>
</wlevs:event-type>

In the example, the wlevs:property tag defines a custom property of the ForeignExchangeEvent called builderFactory. The property uses the standard Spring bean tag to specify the Spring bean used as a factory to create ForeignExchangeEvents.

 


wlevs:source

Specifies an event source for this component, or in other words, the component which the events are coming from. Specifying an event source is equivalent to specifying this component as an event listener to another component.

You can also nest the definition of a component within a particular wlevs:source component to specify the component source.

WARNING: Nested definitions are not eligible for dynamic configuration or monitoring.

This tag is a child of wlevs:stream or wlevs:processor.

Attributes

The following table lists the attributes of the wlevs:source application assembly tag.

Table 2-17 Attributes of the wlevs:source Application Assembly Tag
Attribute
Description
Data Type
Required?
ref
Specifies the source of the stream to which this tag is a child.
Set this attribute to the value of the id attribute of the source component.
You do not specify this attribute if you are nesting sources.
String
No.

Example

The following example shows how to use the wlevs:source tag in the EPN assembly file:

    <wlevs:stream id="helloworldInstream">
<wlevs:listener ref="helloworldProcessor"/>
<wlevs:source ref="helloworldAdapter"/>
</wlevs:stream>

In the example, the component with id helloworldAdapter is the source of the helloworldInstream stream component.

 


wlevs:stream

Use this tag to declare a stream to the Spring application context.

Child Tags

The wlevs:stream application assembly tag supports the following child tags:

Attributes

The following table lists the attributes of the wlevs:stream application assembly tag.

Table 2-18 Attributes of the wlevs:stream Application Assembly Tag
Attribute
Description
Data Type
Required?
id
Unique identifier for this component.
This identifier must correspond to the <name> element in the XML configuration file for this stream, if one exists.
String
Yes.
advertise
Advertises this service in the OSGi registry.
Valid values are true and false. Default value is false.
Boolean
No.
listeners
Specifies the components that listen to this component. Separate multiple components using commas.
Set this attribute to the value of the id attribute of the tag (wlevs:adapter, wlevs:stream, or wlevs:processor) that defines the listening component.
String
No.
provider
Specifies the streaming provider.
Valid values are:
  • defaultstream
Default value is defaultstream, which is the out-of-the-box streaming provider.
String
No.
max-size
Specifies the maximum size of this stream.
Zero-size streams synchronously pass-through events. Streams with non-zero size process events asynchronously, buffering events by the requested size.
The default value for this attribute is 1024.
integer
No.
max-threads
Specifies the maximum number of threads that will be used to process events for this stream.
If the max-size attribute is 0, then setting a value for max-threads has no effect.
The default value for this attribute is 1.
integer
No.
source
Specifies the component from which the stream sources events.
Set this attribute to the value of the id attribute of the tag (wlevs:adapter, wlevs:stream, or wlevs:processor) that defines the source component.
String
No.

Example

The following example shows how to use the wlevs:stream tag in the EPN assembly file:

   <wlevs:stream id="fxMarketAmerOut" />

The example shows how to declare a stream service with unique identifier fxMarketAmerOut.


  Back to Top       Previous  Next