PK z\Eoa,mimetypeapplication/epub+zipPKz\EiTunesMetadata.plistz artistName Oracle Corporation book-info cover-image-hash 394602922 cover-image-path OEBPS/dcommon/oracle-logo.jpg package-file-hash 970824967 publisher-unique-id E14301-10 unique-id 720089491 genre Oracle Documentation itemName Oracle® Fusion Middleware Developer's Guide for Oracle Complex Event Processing for Eclipse, 11g Release 1 (11.1.1.6.3) releaseDate 2012-08-03T11:20:05Z year 2012 PKJPKz\EMETA-INF/container.xml PKYuPKz\EOEBPS/custeventbean.htmpc Configuring Custom Event Beans

15 Configuring Custom Event Beans

This chapter describes how to implement and configure Oracle Complex Event Processing (Oracle CEP) custom event beans, including how to implement the beans as event sinks and event sources.

15.1 Overview of Custom Event Beans

An event bean is a Plain Old Java Object (POJO) managed by the Oracle CEP management framework. You register event beans in the EPN assembly file using the Oracle CEP wlevs:event-bean stage rather than the standard bean element.

An event bean is a type of Stage, it can be monitored by the Oracle CEP monitoring framework, make use of the configuration metadata annotations, and it can be set to record, and play-back events that pass through it. An event bean can also participate in the Oracle CEP server bean lifecycle by specifying methods in its XML declaration, rather than by implementing Oracle CEP server API interfaces.

To add a Plain Old Java Object (POJO) to your Oracle CEP application:

15.1.1 Custom Event Bean Event Sources and Event Sinks

Event beans can be event sources, event sinks, or both. Event sources generate events, event sinks receive events.

15.1.1.1 Custom Event Beans as Event Sources

You specify that an event bean component in your EPN is an event source by implementing the com.bea.wlevs.ede.api.StreamSource or RelationSource API.

The implementation class of an event bean that is an event source may be specified as private to the application or as an advertised OSGI service re-usable by other applications.

For the framework to be able to fully manage the custom event bean as an EPN component, it must be specified as an event bean rather than a standard Spring bean. Management tasks include monitoring and record/playback.

You register event beans in the EPN assembly file using the wlevs:event-bean element. For example:

<wlevs:event-bean id="myEventBeanSource" class="com.acme.MySourceEventBean">
</wlevs:event-bean>

In this example, the Java class MySourceEventBean.java implements the com.bea.wlevs.ede.api.StreamSource or RelationSource API.

For more information, see Section 15.2.1, "Implementing a Custom Event Bean as an Event Source".

15.1.1.2 Custom Event Beans as Event Sinks

The functionality of custom event beans as event sinks is very similar to that of event sources except that custom event bean sinks must implement the com.bea.wlevs.ede.api.StreamSink or RelationSink API.

Event sinks are not active which means that if they implement the Runnable interface, Oracle CEP does not run them in a separate thread.

You reference event sinks in the EPN assembly file using the wlevs:listener element:

<wlevs:event-bean id="myEventBeanSink" class="com.acme.MySinkEventBean">
</wlevs:event-bean>
...
<wlevs:channel id="myStream" >
    <wlevs:listener ref="myEventBeanSink" />
</wlevs:channel>

In this example, the Java class MySinkEventBean.java implements the com.bea.wlevs.ede.api.StreamSink or RelationSink API.

For more information, see Section 15.2.2, "Implementing a Custom Event Bean as an Event Sink"

15.1.2 Custom Event Bean Factories

If your event bean is going to be used only by a single Oracle CEP application, then you do not need to create a factory. However, if multiple applications are going to use the same event bean, then you should also program a factory. In this case, every application gets its own instance of the adapter.

Event bean factories must implement the com.bea.wlevs.ede.api.Factory interface. This interface has a single method, create, that you implement to create an adapter or event bean instance.

You register factories in the EPN assembly file using the wlevs:factory element:

<wlevs:factory provider-name="myprovider" class="my.Implementation"/>

Note that if you need to specify service properties, then you must use the <osgi:service> to register the factory.

15.2 Implementing a Custom Event Bean

The following procedure describes the typical steps for creating a custom event bean.

To implement a custom event bean:


Note:

The following procedure assumes that the custom event bean is bundled in the same application JAR file that contains the other components of the EPN, such as the processor, streams, and business logic POJO. If you want to bundle the custom event bean in its own JAR file so that it can be shared among multiple applications, see Section 24.2.4.2, "How to Assemble a Custom Event Bean in its Own Bundle."


  1. Program the custom event bean Java class.

    If your custom event bean is an event source, see Section 15.2.1, "Implementing a Custom Event Bean as an Event Source."

    If your custom event bean is an event sink, see Section 15.2.2, "Implementing a Custom Event Bean as an Event Sink."

    If your custom event bean is both an event source and event sink, then see both sections.

  2. Optionally program the factory class.

    You only need to do this if many applications are going to use the custom event bean.

    See Section 15.2.3, "Implementing a Custom Event Bean Factory."

  3. Optionally extend the configuration of the custom event bean if its basic one is not adequate.

    See Chapter 19, "Extending Component Configuration."

  4. Configure the custom event bean.

    For more information, see:

15.2.1 Implementing a Custom Event Bean as an Event Source

The following example shows a custom event bean class as an event source ; see the explanation after the example for coding guidelines that correspond to the Java code in bold.

package com.acme;

import com.bea.wlevs.ede.api.StreamSender;
import com.bea.wlevs.ede.api.StreamSource;
import com.bea.wlevs.ede.api.RunnableBean;
 
public class EventBeanSource implements RunnableBean, StreamSource {

    public void setEventSender (StreamSender streamSender) {
    ...
    }

    public void run() {
    ...
    }

    public synchronized void suspend() throws Exception {
    ...
    }
}

Follow these guidelines when programming the custom event bean Java class; code snippets of the guidelines are shown in bold in the preceding example:

  • Import the interfaces and classes of the Oracle CEP API:

    import com.bea.wlevs.ede.api.StreamSender;
    import com.bea.wlevs.ede.api.StreamSource;
    import com.bea.wlevs.ede.api.RunnableBean;
    

    Because the custom event bean is an event source it must implement the StreamSource interface. If you want the custom event bean to run in a thread, also implement RunnableBean. The StreamSender interface sends event types to the next component in your application network. For full details of these APIs, see Oracle Fusion Middleware Java API Reference for Oracle Complex Event Processing.

  • The custom event bean class must implement the StreamSource and RunnableBean interfaces because it is an event source and will run in its own thread:

    public class HelloWorldAdapter implements RunnableBean, StreamSource {
    

    The StreamSource interface provides the StreamSender that you use to send events.

  • Because the custom event bean implements the RunnableBean interface, your adapter must then implement the run method:

    public void run() {...
    

    This is where you should put the code that reads the incoming data, such as from a market feed, and convert it into an Oracle CEP event type, and then send the event to the next component in the network. Refer to the documentation of your data feed provider for details on how to read the incoming data. See Section 24.2.2.2, "Accessing Third-Party JAR Files" for information about ensuring you can access the vendor APIs if they are packaged in a third-party JAR file.

  • Because the custom event bean implements StreamSource, you must implement the setEventSender method, which passes in the StreamSender that you use to send events:

    public void setEventSender(StreamSender sender) { ...
    
  • If, as is typically the case, your custom event bean implements SuspendableBean, you must implement the suspend method that stops the custom event bean when, for example, the application is undeployed:

    public synchronized void suspend() throws Exception { ... 
    

15.2.2 Implementing a Custom Event Bean as an Event Sink

The following sample code shows a Spring bean from HelloWorld application that acts as an event sink; see the explanation after the example for the code shown in bold:

package com.bea.wlevs.example.helloworld;
 
import com.bea.wlevs.ede.api.StreamSink;
import com.bea.wlevs.event.example.helloworld.HelloWorldEvent;
 
public class HelloWorldBean implements StreamSink {
 
    public void onInsertEvent(Object event) {
        if (event instanceof HelloWorldEvent) {
            HelloWorldEvent helloWorldEvent = (HelloWorldEvent) event;
            System.out.println("Message: " + helloWorldEvent.getMessage());
        }   
        // Throw com.bea.wlevs.ede.api.EventRejectedException to have exceptions propagated
        // up to senders. Other errors will be logged and dropped.
    }
 
}

The programming guidelines shown in the preceding example are as follows:

  • Your bean must import the event type of the application, which in the HelloWorld case is HelloWorldEvent:

    import com.bea.wlevs.event.example.helloworld.HelloWorldEvent;
    
  • Your bean must implement the com.bea.wlevs.ede.api.StreamSink interface:

    public class HelloWorldBean implements StreamSink {...
    
  • The StreamSink interface has a single method that you must implement, onInsertEvent(java.lang.Object), which is a callback method for receiving events. The parameter of the method is an Object that represents the actual event that the bean received from the component that sent it the event:

    public void onInsertEvent(Object event)
    

    Your implementation should throw com.bea.wlevs.ede.api.EventRejectedException to have exceptions propagated up to senders. Other errors will be logged and dropped.

  • The data type of the events is determined by the event type you registered in the EPN assembly file of the application. In the example, the event type is HelloWorldEvent; the code first ensures that the received event is truly a HelloWorldEvent:

    if (event instanceof HelloWorldEvent) {
        HelloWorldEvent helloWorldEvent = (HelloWorldEvent) event;
    

    This event type is a JavaBean that was configured in the EPN assembly file as shown:

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

    See Section 4.3, "Creating EPN Assembly Files" for procedural information about creating the EPN assembly file, and Appendix C, "Schema Reference: EPN Assembly spring-wlevs-v11_1_1_6.xsd" for reference information.

  • Events are instances of the appropriate JavaBean, so you access the individual properties using the standard getXXX methods. In the example, the HelloWorldEvent has a property called message. You access this property using method getMessage:

    System.out.println("Message: " + helloWorldEvent.getMessage());
    

For complete API reference information about the Oracle CEP APIs described in this section, see the Oracle Fusion Middleware Java API Reference for Oracle Complex Event Processing.

15.2.3 Implementing a Custom Event Bean Factory

Your adapter factory class must implement the com.bea.wlevs.ede.api.EventBeanFactory interface, which has a single method, create, in which you code the creation of your specific adapter class. Event beans implement Factory.

The following is a possible adapter factory class for the HelloWorld example:

package com.acem;

import com.bea.wlevs.ede.api.EventBean;
import com.bea.wlevs.ede.api.EventBeanFactory;

public class MyEventBeanFactory implements Factory {
    public MyEventBeanFactory() {
    }
    public synchronized EventBean create() throws IllegalArgumentException {
        return new MyEventBeanFactory();
    }
}

For full details of these APIs, see the Oracle Fusion Middleware Java API Reference for Oracle Complex Event Processing.

15.3 Configuring the Custom Event Bean EPN Assembly File

The custom event bean and custom event bean factory (if used) must be registered in the EPN assembly file, as discussed in the following sections:

For a complete description of the configuration file, including registration of other components of your application, see Section 4.3, "Creating EPN Assembly Files."

15.3.1 Registering the Custom Event Bean Factory

You register factories in the EPN assembly file using the wlevs:factory element:

<wlevs:factory provider-name="myprovider" class="my.Implementation"/>

If you need to specify service properties, then you must use the osgi:service element to register the factory as an OSGI service in the EPN assembly file. The scope of the OSGI service registry is the entire Oracle CEP. This means that if more than one application deployed to a given server is going to use the same adapter factory, be sure to register the adapter factory only once as an OSGI service.

Add an entry to register the service as an implementation of the com.bea.wlevs.ede.api.EventBeanFactory interface. Provide a property, with the key attribute equal to type, and the name by which this adapter provider will be referenced. Finally, add a nested standard Spring bean element to register your specific adapter class in the Spring application context

For example, the following segment of the EPN assembly file registers the MyEventBeanFactory as the provider for type hellomsgs:

<osgi:service interface="com.bea.wlevs.ede.api.EventBeanFactory">
    <osgi:service-properties>
        <entry key="type" value="myprovider"</entry>
    </osgi:service-properties>
    <bean  class="com.acme.MyEventBeanFactory" />
</osgi:service>

For more information on how to reference a factory by its type, see Section 15.3.2, "Declaring the Custom Event Bean Components in your Application".

15.3.2 Declaring the Custom Event Bean Components in your Application

In the EPN assembly file, you use the wlevs:event-bean element to declare a custom event bean as a component in the event processor network. For example:

<wlevs:event-bean id="recplayEventSink"
                  class="com.bea.wlevs.example.recplayRecplayEventSink">
    <wlevs:listener ref="playbackHttpPublisher"/>
</wlevs:event-bean>

If you registered an optional factory as an OSGI service, then use the provider attribute to point to the name you specified as the type in your osgi:service entry; for example:

<wlevs:event-bean id="myEventBean" provider="myprovider"/>

This means that an adapter will be instantiated by the factory registered for the type myprovider.

You can also use a wlevs:instance-property child element of wlevs:adapter to set any static properties in the adapter bean. Static properties are those that you will not dynamically change after the adapter is deployed.

For example, if your adapter class has a setPort method, you can pass it the port number as shown:

<wlevs:event-bean id="myEventBean" provider="myProvider">
    <wlevs:instance-property name="port" value="9001" />
</wlevs:event-bean>

15.4 Configuring the Custom Event Bean Component Configuration File

Each custom event bean in your application has a default configuration, and, optionally, an extended component configuration.

If your application has more than one custom event bean, you can create separate XML files for each, or create a single XML file that contains the configuration for all custom event beans, or even all components of your application (adapters, processors, and streams). Choose the method that best suits your development environment.

The following procedure describes the main steps to create the custom event bean configuration file. For simplicity, it is assumed in the procedure that you are going to configure all components of an application in a single XML file

For more information, see:

15.4.1 How to Configure a Custom Event Bean Manually

The following procedure describes how to configure a custom event bean manually.

To configure the custom event bean component configuration file:

  1. Create an XML file using your favorite XML editor.

    You can name this XML file anything you want, provided it ends with the .xml extension.

    The root element of the configuration file is config, with namespace definitions shown in the next step.

  2. For each event bean in your application, add an event-bean child element of config.

    Uniquely identify each custom event bean with the name child element. This name must be the same as the value of the id attribute in the wlevs:event-bean element of the EPN assembly file that defines the event processing network of your application. This is how Oracle CEP knows to which particular custom event bean component in the EPN assembly file this adapter configuration applies. See Section 4.3, "Creating EPN Assembly Files" for details.

    For example, if your application has two custom event beans, the configuration file might initially look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <helloworld:config
      xmlns:helloworld="http://www.bea.com/xml/ns/wlevs/example/helloworld">
      <processor>
       ...
      </processor>
      <event-bean>
        <name>firstEventBean</name>
        ...
      </event-bean>
      <event-bean>
        <name>firstEventBean</name>
        ...
      </event-bean>
    </helloworld:config>
    

    In the example, the configuration file includes two custom event beans called firstEventBean and secondEventBean. This means that the EPN assembly file must include at least two custom event bean registrations with the same identifiers:

    <wlevs:event-bean id="firstEventBean" ...>
      ...
    </wlevs:event-bean>
    <wlevs:event-bean id="secondEventBean" ...>
      ...
    </wlevs:event-bean>
    

    Caution:

    Identifiers and names in XML files are case sensitive, so be sure you specify the same case when referencing the component's identifier in the EPN assembly file.


15.4.1.1 Example of a Custom Event Bean Configuration File

The following sample XML file shows how to configure two custom event beans, firstEventBean and secondEventBean.

<?xml version="1.0" encoding="UTF-8"?>
<sample:config
  xmlns:sample="http://www.bea.com/xml/ns/wlevs/example/sample">
  <event-bean>
    <name>firstEventBean</name>
    ...
  </event-bean>
  <event-bean>
    <name>firstEventBean</name>
    ...
  </event-bean>
</sample:config>
PKppPKz\EOEBPS/datastream.htm Configuring Channels

9 Configuring Channels

This chapter describes how to configure Oracle Complex Event Processing (Oracle CEP) channels, event conduits through an event processing network.

9.1 Overview of Channel Configuration

An Oracle CEP application contains one or more channel components. A channel represents the physical conduit through which events flow between other types of components, such as between adapters and processors, and between processors and event beans (business logic POJOs).

You may use a channel with both streams and relations. For more information, see Section 9.1.2, "Channels Representing Streams and Relations".

When you create a channel in your Event Processing Network (EPN), it has a default configuration. For complete details, see Section C.10, "wlevs:channel".

The default channel configuration is typically adequate for most applications.

However, if you want to change this configuration, you must create a channel element in a component configuration file. In this channel element, you can specify channel configuration that overrides the defaults.

The component configuration file channel element's name element must match the EPN assembly file channel element's id attribute. For example, given the EPN assembly file channel element shown in Example 9-1, the corresponding component configuration file channel element is shown in Example 9-2.

Example 9-1 EPN Assembly File Channel Id: priceStream

<wlevs:channel id="priceStream" event-type="PriceEvent">
    <wlevs:listener ref="filterFanoutProcessor" />
    <wlevs:source ref="PriceAdapter" />
</wlevs:channel>

Example 9-2 Component Configuration File Channel Name: priceStream

<channel>
    <name>priceStream</name>
    <max-size>10000</max-size>
    <max-threads>4</max-threads>
</channel>

You can create a channel element in any of the following component configuration files:

If your application has more than one channel, you can create a channel element for each of them in the default config.xml file, you can create separate XML files in META-INF/wlevs for each, or create a single XML file in META-INF/wlevs that contains the configuration for all channels, or even all components of your application (adapters, processors, and channels). Choose the method that best suits your development environment.

By default, Oracle CEP IDE for Eclipse creates one component configuration file and one EPN assembly file.

Component configuration files are deployed as part of the Oracle CEP application bundle. You can later update this configuration at runtime using Oracle CEP Visualizer, the wlevs.Admin utility, or manipulating the appropriate JMX Mbeans directly.

This section describes:

For more information, see:

9.1.1 When to Use a Channel

When constructing your EPN, consider the following rules:

  • A channel is mandator when connecting an Oracle CQL processor to a down-stream stage.

  • A channel is mandatory when connecting a push source stream or relation to a processor.

    A channel is mandatory for a push source because in that case, the Oracle CQL processor does need to be aware of its shape (that is, DDL is required) and so does need the channel to act as intermediary.

  • A channel is optional when connecting an external relation, or pull source, such as a cache or table source, to a processor.

    A channel is not needed between a pull source, such as a cache or table, and a processor because the pull source represent an external relation. For an external relation, the only valid operation is a join between a stream and a NOW window operator and hence it is considered a pull source. In other words, the join actually happens outside of the Oracle CQL processor. Because it is a pull, the Oracle CQL processor does not need to be aware of its shape (that is, no DDL is required) and so does not need the channel to act as intermediary.

In general, use a channel between components when:

  • Buffering is needed between the emitting component and the receiver.

  • Queuing or concurrency is needed for the receiving component.

  • If a custom adapter is used and thread control is necessary.

It is a good design practice to include channels in your EPN to provide the flexibility of performance tuning (using buffering, queuing, and concurrency options) later in the design lifecycle. Setting the channel attribute max-threads to 0 puts a channel in pass-through mode and incurs no performance penalty.

For more information, see:

9.1.2 Channels Representing Streams and Relations

A channel can represent either a stream or a relation.

For more information, see:

9.1.2.1 Channels as Streams

A stream supports appends only. You specify a channel as a stream by setting EPN assembly element wlevs:channel attribute is-relation to false (the default).

9.1.2.2 Channels as Relations

A relation supports inserts, deletes, and updates. You specify a channel as a relation by setting EPN assembly element wlevs:channel attribute is-relation to true.

When a channel is a relation, you must specify one or more event properties that define event identity using the wlevs:channel attribute primary-key as Example 9-3 shows.

Example 9-3 Channel as Relation: primary-key Attribute

...
<wlevs:channel id="priceStream" event-type="PriceEvent" primary-key="stock,broker">
    <wlevs:listener ref="filterFanoutProcessor" />
    <wlevs:source ref="PriceAdapter" />
</wlevs:channel>
...

Example 9-4 PriceEvent

<wlevs:event-type-repository>
    <wlevs:event-type type-name="PriceEvent">
          <wlevs:property>
             <entry key="stock" value="java.lang.String"/>
             <entry key="broker" value="java.lang.String"/>
             <entry key="high" value="float"/>
             <entry key="low" value="float"/>
          </wlevs:property>
    </wlevs:event-type>
</wlevs:event-type-repository>

For more information, see primary-key in Table C-9, "Attributes of the wlevs:channel Application Assembly Element".

9.1.3 System-Timestamped Channels

By default, channels are system-timestamped. In this case, Oracle CEP will assign a new time from the CPU clock under two conditions: when a new event arrives, and when the configurable heartbeat timeout expires.

For more information, see:

9.1.4 Application-Timestamped Channels

Optionally, you can configure a channel to be application-timestamped. In this case, the time-stamp of an event is determined by the configurable wlevs:expression element. A common example of an expression is a reference to a property on the event. If no expression is specified, then the time-stamp may be propagated from a prior event. For example, this is the case when you have a system-timestamped channel from one Oracle CQL processor feeding events into an application-timestamped channel of another downstream Oracle CQL processor.

In addition, an application can use the StreamSender.sendHeartbeat method to send an event of type heart-beat downstream to StreamSink listeners in the EPN.

For more information, see:

9.1.5 Controlling Which Queries Output to a Downstream Channel: selector

If you configure an Oracle CQL processor with more than one query, by default, all queries output their results to the downstream channel.

You can control which queries may output their results to a downstream channel using the channel selector child element.

Figure 9-1 shows an EPN with channel filteredStream connected to up-stream Oracle CQL processor filteredFanoutProcessor.

Figure 9-1 EPN With Oracle CQL Processor and Down-Stream Channel

Description of Figure 9-1 follows

Example 9-5 shows the queries configured for the Oracle CQL processor.

Example 9-5 filterFanoutProcessor Oracle CQL Queries

<processor>
    <name>filterFanoutProcessor</name>
    <rules>
        <query id="Yr3Sector"><![CDATA[ 
            select cusip, bid, srcId, bidQty, ask, askQty, seq 
            from priceStream where sector="3_YEAR"
        ]]></query>
        <query id="Yr2Sector"><![CDATA[ 
            select cusip, bid, srcId, bidQty, ask, askQty, seq 
            from priceStream where sector="2_YEAR"
        ]]></query>
        <query id="Yr1Sector"><![CDATA[ 
            select cusip, bid, srcId, bidQty, ask, askQty, seq 
            from priceStream where sector="1_YEAR"
        ]]></query>
    </rules>
</processor>

If you specify more than one query for an Oracle CQL processor as Example 9-5 shows, then, by default, all query results are output to the processor's out-bound channel (filteredStream in Figure 9-1). Optionally, in the component configuration source, you can use the channel element selector child element to specify a space-delimited list of one or more Oracle CQL query names that may output their results to the channel as Example 9-6 shows. In this example, query results for query Yr3Sector and Yr2Sector are output to filteredStream but not query results for query Yr1Sector.

Example 9-6 Using selector to Control Which Query Results are Output

<channel>
    <name>filteredStream</name>
    <selector>Yr3Sector Yr2Sector</selector>
</channel>

You may configure a channel element with a selector before creating the queries in the upstream processor. In this case, you must specify query names that match the names in the selector.


Note:

The selector child element is only applicable if the up-stream node is an Oracle CQL processor. For more information, see Chapter 10, "Configuring Oracle CQL Processors".


For more information, see Appendix D, "selector".

9.1.6 Batch Processing Channels

By default, a channel processes events as they arrive. Alternatively, you can configure a channel to batch events together that have the same timestamp and were output from the same query by setting the wlevs:channel attribute batching to true as Example 9-7 shows.

Example 9-7 Batch Processing Channel

...
<wlevs:channel id="priceStream" event-type="PriceEvent" batching="true">
    <wlevs:listener ref="filterFanoutProcessor" />
    <wlevs:source ref="PriceAdapter" />
</wlevs:channel>
...

For more information, see:

9.1.7 EventPartitioner Channels

By default, a channel broadcasts each event to every listener.

When you configure a channel to use an EventPartitioner, each time an incoming event arrives, the channel selects a listener and dispatches the event to that listener instead of broadcasting each event to every listener.

You can use an EventPartitioner on a channel to improve scalability.

For more information, see Section 22.2.1, "EventPartitioner".

9.2 Configuring a Channel

You can configure a channel manually or by using the Oracle CEP IDE for Eclipse.

See Section B.2, "Component Configuration Schema wlevs_application_config.xsd" for the complete XSD Schema that describes the channel component configuration file.

See Section 9.3, "Example Channel Configuration Files" for a complete example of a channel configuration file.

This section describes the following topics:

9.2.1 How to Configure a System-Timestamped Channel Using Oracle CEP IDE for Eclipse

This section describes how to create a system-timestamped channel.

The most efficient and least error-prone way to create and edit a channel configuration in the default component configuration file is to use the Oracle CEP IDE for Eclipse. Optionally, you can create a channel configuration file manually (see Section 9.2.3, "How to Create a Channel Component Configuration File Manually").

For more information, see:

To configure a channel using Oracle CEP IDE for Eclipse:

  1. Use Oracle CEP IDE for Eclipse to create a channel.

    See Section 6.4.1.1, "How to Create a Basic Node".

  2. Optionally, override the default channel assembly file configuration by adding additional wlevs:channel attributes and child elements:

    1. Right-click the channel node and select Go To Assembly Source.

    2. Add the appropriate wlevs:channel attributes.

      Required attributes include:

      • id

      • event-type

      In particular, specify whether this channel is a stream or relation by configuring attribute is-relation:

      • To specify this channel as stream, set is-relation to false (default).

      • To specify this channel as a relation, set is-relation to true.

        If you specify this channel as a relation, you must also configure the channel attribute primary-key.

      See Table C-9, "Attributes of the wlevs:channel Application Assembly Element".

    3. Add the appropriate wlevs:channel child elements.

  3. In the Project Explorer, expand your META-INF/wlevs directory.

  4. Choose the component configuration file you want to use:

    1. To use the default component configuration file, right-click the META-INF/wlevs/config.xml file and select Open With > XML Editor.

      The file opens in an XML Editor.

    2. To create a new component configuration file:

      • Right-click the wlevs directory and select New > File.

        The New File dialog appears.

      • Enter a file name.

        You can name the file anything you want but the name of the file must end in .xml.

      • Click Finish.

        Oracle CEP IDE for Eclipse adds the component configuration file to the wlevs directory.

  5. Right-click the component configuration file you chose to use and select Open With > XML Editor.

    The file opens in an XML Editor.

  6. If you created a new component configuration file, add the header and config element shown in Example 9-8. Otherwise, proceed to step 7.

    Example 9-8 Component Configuration File Header and config Element

    <?xml version="1.0" encoding="UTF-8"?>
    <n1:config xsi:schemaLocation="http://www.bea.com/ns/wlevs/config/application wlevs_application_config.xsd" 
    xmlns:n1="http://www.bea.com/ns/wlevs/config/application" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    
    </config>
    
  7. Add a channel element for the channel as Example 9-9 shows.

    Example 9-9 Component Configuration File Channel Element

    <?xml version="1.0" encoding="UTF-8"?>
    <n1:config xsi:schemaLocation="http://www.bea.com/ns/wlevs/config/application wlevs_application_config.xsd" 
    xmlns:n1="http://www.bea.com/ns/wlevs/config/application" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <processor>
            ...
        </processor>
        ...
        <channel>
        </channel>
    </config>
    
  8. Add a name child element to the channel element.

    The name element value must match the corresponding EPN assembly file channel element's id attribute.

    For example, given the EPN assembly file channel element shown in Example 9-10, the corresponding configuration file channel element is shown in Example 9-11.

    Example 9-10 EPN Assembly File Channel Id: priceStream

    <wlevs:channel id="priceStream" event-type="PriceEvent">
        <wlevs:listener ref="filterFanoutProcessor" />
        <wlevs:source ref="PriceAdapter" />
    </wlevs:channel>
    

    Example 9-11 Component Configuration File Channel Name: priceStream

    <channel>
        <name>priceStream</name>
    </channel>
    

    Caution:

    Identifiers and names in XML files are case sensitive. Be sure to specify the same case when referencing the component's identifier in the EPN assembly file.


  9. Optionally, override the default channel configuration by adding additional channel child elements:

    • Add a max-threads child element to specify the maximum number of threads that Oracle CEP server uses to process events for this channel.

      Setting this value has no effect when max-size is 0. The default value is 0.

      <channel>
          <name>priceStream</name>
          <max-threads>2</size>
      </channel>
      

      When set to 0, the channel acts as a pass-through. When max-threads > 0, the channel acts as classic blocking queue, where upstream components are producers of events and the downstream components are the consumers of events. The queue size is defined by the configuration max-size. There will be up to max-threads number of threads consuming events from the queue.

      Note that with multiple threads enabled, com.bea.wlevs.ede.api.EventRejectedException instances thrown from downstream components in the EPN won't be propagated up to an adapter from which the channel is receiving events.

    • Add a max-size child element to specify the maximum size of the channel.

      Zero-size channels synchronously pass-through events.

      Non-zero size channels process events asynchronously, buffering events by the requested size. The default value is 0.

      <channel>
          <name>priceStream</name>
          <max-size>10000</size>
      </channel>
      
    • Add a heartbeat child element to specify the number of nanoseconds a channel can be idle before Oracle CEP generates a heartbeat event to advance time.

      The heartbeat child element applies to system-timestamped relations or streams only when no events arrive in the event channels that are feeding the processors and the processor has been configured with a statement that includes some temporal operator, such as a time-based window or a pattern matching with duration.

      <channel>
          <name>MatchOutputChannel</name>
          <heartbeat>10000</heartbeat>
      </channel>
      
    • Add a selector child element to specify which up-stream Oracle CQL processor queries are permitted to output their results to the channel.

      You may configure a channel element with a selector before creating the queries in the upstream processor. In this case, you must specify query names that match the names in the selector.

      For more information, Section 9.1.5, "Controlling Which Queries Output to a Downstream Channel: selector".


      Note:

      The selector attribute is only applicable if the up-stream node is an Oracle CQL processor. For more information, see Chapter 10, "Configuring Orax,cle CQL Processors".


  10. Select File > Save.

    The EPN Editor adds a configuration badge to the channel as Figure 9-2 shows. For more information, see Section 6.2.7, "Configuration Badging".

    Figure 9-2 Channel With Configuration Badge

    Description of Figure 9-2 follows

9.2.2 How to Configure an Application-Timestamped Channel Using Oracle CEP IDE for Eclipse

This section describes how to create an application-timestamped channel.

The most efficient and least error-prone way to create and edit a channel configuration in the default component configuration file is to use the Oracle CEP IDE for Eclipse. Optionally, you can create a channel configuration file manually (see Section 9.2.3, "How to Create a Channel Component Configuration File Manually").

For more information, see:

To configure a channel using Oracle CEP IDE for Eclipse:

  1. Use Oracle CEP IDE for Eclipse to create a channel.

    See Section 6.4.1.1, "How to Create a Basic Node".

  2. Optionally, override the default channel assembly file configuration by adding additional wlevs:channel attributes and child elements:

    1. Right-click the channel node and select Go To Assembly Source.

    2. Add the appropriate wlevs:channel attributes.

      In particular, specify whether this channel is a stream or relation by configuring attribute is-relation:

      • To specify this channel as stream, set is-relation to false (default).

      • To specify this channel as a relation, set is-relation to true.

      See Table C-9, "Attributes of the wlevs:channel Application Assembly Element".

    3. Add a wlevs:application-timestamped child element.

      Use this element to specify a wlevs:expression child element that Oracle CEP uses to generate timestamp values.

      Optionally, configure the wlevs:application-timestamped attributes:

      • is-total-order: specifies if the application time published is always strictly greater than the last value used.

        Valid values are true or false. Default: false.

      For more information, see Appendix C, "wlevs:application-timestamped".

    4. Add other appropriate wlevs:channel child elements.

  3. In the Project Explorer, expand your META-INF/wlevs directory.

  4. Choose the component configuration file you want to use:

    1. To use the default component configuration file, right-click the META-INF/wlevs/config.xml file and select Open With > XML Editor.

      The file opens in an XML Editor.

    2. To create a new component configuration file:

      • Right-click the wlevs directory and select New > File.

        The New File dialog appears.

      • Enter a file name.

        You can name the file anything you want but the name of the file must end in .xml.

      • Click Finish.

        Oracle CEP IDE for Eclipse adds the component configuration file to the wlevs directory.

  5. Right-click the component configuration file you chose to use and select Open With > XML Editor.

    The file opens in an XML Editor.

  6. If you created a new component configuration file, add the header and config element shown in Example 9-8. Otherwise, proceed to step 7.

    Example 9-12 Component Configuration File Header and config Element

    <?xml version="1.0" encoding="UTF-8"?>
    <n1:config xsi:schemaLocation="http://www.bea.com/ns/wlevs/config/application wlevs_application_config.xsd" 
    xmlns:n1="http://www.bea.com/ns/wlevs/config/application" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    
    </config>
    
  7. Add a channel element for the channel as Example 9-9 shows.

    Example 9-13 Component Configuration File Channel Element

    <?xml version="1.0" encoding="UTF-8"?>
    <n1:config xsi:schemaLocation="http://www.bea.com/ns/wlevs/config/application wlevs_application_config.xsd" 
    xmlns:n1="http://www.bea.com/ns/wlevs/config/application" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <processor>
            ...
        </processor>
        ...
        <channel>
        </channel>
    </config>
    
  8. Add a name child element to the channel element.

    The name element value must match the corresponding EPN assembly file channel element's id attribute.

    For example, given the EPN assembly file channel element shown in Example 9-10, the corresponding configuration file channel element is shown in Example 9-11.

    Example 9-14 EPN Assembly File Channel Id: priceStream

    <wlevs:channel id="priceStream" event-type="PriceEvent">
        <wlevs:listener ref="filterFanoutProcessor" />
        <wlevs:source ref="PriceAdapter" />
    </wlevs:channel>
    

    Example 9-15 Component Configuration File Channel Name: priceStream

    <channel>
        <name>priceStream</name>
    </channel>
    

    Caution:

    Identifiers and names in XML files are case sensitive. Be sure to specify the same case when referencing the component's identifier in the EPN assembly file.


  9. Optionally, override the default channel configuration by adding additional channel child elements:

    • Add a max-threads child element to specify the maximum number of threads that Oracle CEP server uses to process events for this channel.

      Setting this value has no effect when max-size is 0. The default value is 0.

      <channel>
          <name>priceStream</name>
          <max-threads>2</size>
      </channel>
      

      When set to 0, the channel acts as a pass-through. When max-threads > 0, the channel acts as classic blocking queue, where upstream components are producers of events and the downstream components are the consumers of events. The queue size is defined by the configuration max-size. There will be up to max-threads number of threads consuming events from the queue.

      Note that with multiple threads enabled, com.bea.wlevs.ede.api.EventRejectedException instances thrown from downstream components in the EPN won't be propagated up to an adapter from which the channel is receiving events.

    • Add a max-size child element to specify the maximum size of the channel.

      Zero-size channels synchronously pass-through events.

      Non-zero size channels process events asynchronously, buffering events by the requested size. The default value is 0.

      <channel>
          <name>priceStream</name>
          <max-size>10000</size>
      </channel>
      
    • Add a selector child element to specify which up-stream Oracle CQL processor queries are permitted to output their results to the channel.

      You may configure a channel element with a selector before creating the queries in the upstream processor. In this case, you must specify query names that match the names in the selector.

      For more information, Section 9.1.5, "Controlling Which Queries Output to a Downstream Channel: selector".


      Note:

      The selector attribute is only applicable if the up-stream node is an Oracle CQL processor. For more information, see Chapter 10, "Configuring Oracle CQL Processors".


    For more information, Section D.82, "selector".

  10. Select File > Save.

    The EPN Editor adds a configuration badge to the channel as Figure 9-2 shows. For more information, see Section 6.2.7, "Configuration Badging".

    Figure 9-3 Channel With Configuration Badge

    Description of Figure 9-3 follows

9.2.3 How to Create a Channel Component Configuration File Manually

Although the Oracle CEP IDE for Eclipse is the most efficient and least error-prone way to create and a channel configuration file (see Section 9.2.1, "How to Configure a System-Timestamped Channel Using Oracle CEP IDE for Eclipse"), alternatively, you can also create and maintain a channel configuration file manually.

For simplicity, the following procedure assumes that you are going to configure all components of an application in a single XML file.

To create a channel component configuration file manually:

  1. Create an EPN assembly file and add a wlevs:channel element for each channel in your application.

    Uniquely identify each wlevs:channel with the id attribute.

    See Section 4.3, "Creating EPN Assembly Files" for details.

  2. Optionally, override the default channel assembly file configuration by adding additional wlevs:channel attributes and child elements:

    1. Add the appropriate wlevs:channel attributes.

      See Table C-9, "Attributes of the wlevs:channel Application Assembly Element".

    2. Add the appropriate wlevs:channel child elements.

  3. Create an XML file using your favorite XML editor.

    You can name this XML file anything you want, provided it ends with the .xml extension.

    The root element of the configuration file is config, with namespace definitions shown in the next step.

  4. For each channel in your application, add a channel child element of config.

    Uniquely identify each channel with the name child element. This name must be the same as the value of the id attribute in the channel element of the EPN assembly file that defines the event processing network of your application. This is how Oracle CEP knows to which particular channel component in the EPN assembly file this channel configuration applies. See Section 4.3, "Creating EPN Assembly Files" for details.

    For example, if your application has two streams, the configuration file might initially look like:

    <?xml version="1.0" encoding="UTF-8"?>
    <n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <helloworld:config
      xmlns:helloworld="http://www.bea.com/xml/ns/wlevs/example/helloworld">
      <processor>
       ...
      </processor>
      <channel>
        <name>firstStream</name>
        ...
      </channel>
      <channel>
        <name>secondStream</name>
        ...
      </channel>
    </helloworld:config>
    

    In the example, the configuration file includes two channels called firstStream and secondStream. This means that the EPN assembly file must include at least two channel registrations with the same identifiers:

    <wlevs:channel id="firstStream" ...>
      ...
    </wlevs:channel>
    <wlevs:channel id="secondStream" ...>
      ...
    </wlevs:channel>
    

    Caution:

    Identifiers and names in XML files are case sensitive, so be sure you specify the same case when referencing the component's identifier in the EPN assembly file.


  5. Optionally, override the default channel configuration by adding additional channel child elements:

    • Add a max-threads child element to specify the maximum number of threads that Oracle CEP server uses to process events for this channel.

      Setting this value has no effect when max-size is 0. The default value is 0.

      <channel>
          <name>priceStream</name>
          <max-threads>2</size>
      </channel>
      

      When set to 0, the channel acts as a pass-through. When max-threads > 0, the channel acts as classic blocking queue, where upstream components are producers of events and the downstream components are the consumers of events. The queue size is defined by the configuration max-size. There will be up to max-threads number of threads consuming events from the queue.

      Note that with multiple threads enabled, com.bea.wlevs.ede.api.EventRejectedException instances thrown from downstream components in the EPN won't be propagated up to an adapter from which the channel is receiving events.

    • Add a max-size child element to specify the maximum size of the channel.

      Zero-size channels synchronously pass-through events.

      Non-zero size channels process events asynchronously, buffering events by the requested size. The default value is 0.

      <channel>
          <name>priceStream</name>
          <max-size>10000</size>
      </channel>
      
    • Add a heartbeat child element to specify the number of nanoseconds a channel can be idle before Oracle CEP generates a heartbeat event to advance time.

      The heartbeat child element applies to system-timestamped relations or streams only when no events arrive in the event channels that are feeding the processors and the processor has been configured with a statement that includes some temporal operator, such as a time-based window or a pattern matching with duration.

      <channel>
          <name>MatchOutputChannel</name>
          <heartbeat>10000</heartbeat>
      </channel>
      
    • Add a selector child element to specify which up-stream Oracle CQL processor queries are permitted to output their results to the channel.

      You may configure a channel element with a selector before creating the queries in the upstream processor. In this case, you must specify query names that match the names in the selector.

      For more information, Section 9.1.5, "Controlling Which Queries Output to a Downstream Channel: selector".


      Note:

      The selector attribute is only applicable if the up-stream node is an Oracle CQL processor. For more information, see Chapter 10, "Configuring Oracle CQL Processors".


    For more information, Section D.82, "selector".

  6. Save and close the configuration file.

9.3 Example Channel Configuration Files

Figure 9-4 shows part of an EPN that contains two channels: priceStream and filteredStream. The priceStream channel is an in-bound channel that connects the PriceAdapter event source and its PriceEvent events to an Oracle CQL processor filterFanoutProcessor. The filteredStream channel is an out-bound channel that connects the Oracle CQL processor's query results (FilteredPriceEvent events) to down-stream components (not shown in Figure 9-4).

Figure 9-4 EPN with Two Channels

Description of Figure 9-4 follows

This section provides example channel configuration files, including:

9.3.1 Channel Component Configuration File

Example 9-16 shows a sample component configuration file that configures the two channels shown in Figure 9-4.

Example 9-16 Sample Channel Component Configuration File

<?xml version="1.0" encoding="UTF-8"?>
<n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <processor>
        <name>filterFanoutProcessor</name>
        <rules>
            <query id="Yr3Sector"><![CDATA[ 
                select cusip, bid, srcId, bidQty, ask, askQty, seq 
                from priceStream where sector="3_YEAR"
            ]]></query>
        </rules>
    </processor>
    <channel>
        <name>priceStream</name>
        <max-size>10000</max-size>
        <max-threads>4</max-threads>
    </channel>
    <channel>
        <name>filteredStream</name>
        <max-size>5000</max-size>
        <max-threads>2</max-threads>
    </channel>
</n1:config>

9.3.2 Channel EPN Assembly File

Example 9-17 shows a EPN assembly file that configures the two channels shown in Figure 9-4.

Example 9-17 Channel EPN Assembly File

<?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"
    xmlns:cqlx="http://www.oracle.com/schema/cqlx"
    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-v11_1_1_6.xsd">
 
    <wlevs:event-type-repository>
        <wlevs:event-type type-name="PriceEvent">
            <wlevs:properties>
                <wlevs:property name="cusip" type="java.lang.String" />
                <wlevs:property name="bid" type="java.lang.Double" />
                <wlevs:property name="srcId" type="java.lang.String" />
                <wlevs:property name="bidQty" type="java.lang.Integer" />
                <wlevs:property name="ask" type="java.lang.Double" />
                <wlevs:property name="askQty" type="java.lang.Integer" />
                <wlevs:property name="seq" type="java.lang.Long" />
                <wlevs:property name="sector" type="java.lang.String" />
            </wlevs:properties>
        </wlevs:event-type>
        <wlevs:event-type type-name="FilteredPriceEvent">
            <wlevs:properties>
                <wlevs:property name="cusip" type="java.lang.String" />
                <wlevs:property name="bid" type="java.lang.Double" />
                <wlevs:property name="srcId" type="java.lang.String" />
                <wlevs:property name="bidQty" type="java.lang.Integer" />
                <wlevs:property name="ask" type="java.lang.Double" />
                <wlevs:property name="askQty" type="java.lang.Integer" />
                <wlevs:property name="seq" type="java.lang.Long" />
            </wlevs:properties>
        </wlevs:event-type>
        <wlevs:event-type type-name="BidAskEvent">
            <wlevs:properties>
                <wlevs:property name="cusip" type="java.lang.String" />
                <wlevs:property name="bidseq" type="java.lang.Long" />
                <wlevs:property name="bidSrcId" type="java.lang.String" />
                <wlevs:property name="bid" type="java.lang.Double" />
                <wlevs:property name="askseq" type="java.lang.Long" />
                <wlevs:property name="askSrcId" type="java.lang.String" />
                <wlevs:property name="ask" type="java.lang.Double" />
                <wlevs:property name="bidQty" type="java.lang.Integer" />
                <wlevs:property name="askQty" type="java.lang.Integer" />
                <wlevs:property name="intermediateStrategy" type="java.lang.String" />
                <wlevs:property name="correlationId" type="java.lang.Long" />
                <wlevs:property name="priority" type="java.lang.Integer" />
            </wlevs:properties>
        </wlevs:event-type>
        <wlevs:event-type type-name="FinalOrderEvent">
            <wlevs:properties>
                <wlevs:property name="cusip" type="java.lang.String" />
                <wlevs:property name="bidseq" type="java.lang.Long" />
                <wlevs:property name="bidSrcId" type="java.lang.String" />
                <wlevs:property name="bid" type="java.lang.Double" />
                <wlevs:property name="bidQty" type="java.lang.Integer" />
                <wlevs:property name="bidSourceStrategy" type="java.lang.String" />
                <wlevs:property name="askseq" type="java.lang.Long" />
                <wlevs:property name="askSrcId" type="java.lang.String" />
                <wlevs:property name="ask" type="java.lang.Double" />
                <wlevs:property name="askQty" type="java.lang.Integer" />
                <wlevs:property name="askSourceStrategy" type="java.lang.String" />
                <wlevs:property name="correlationId" type="java.lang.Long" />
            </wlevs:properties>
        </wlevs:event-type>
    </wlevs:event-type-repository>
 
    <!-- Assemble EPN (event processing network) -->
    <wlevs:adapter advertise="true" id="PriceAdapter"
        provider="csvgen">
        <wlevs:instance-property name="port" value="9008" />
        <wlevs:instance-property name="eventTypeName"
            value="PriceEvent" />
        <wlevs:instance-property name="eventPropertyNames"
            value="srcId,sector,cusip,bid,ask,bidQty,askQty,seq" />
    </wlevs:adapter>
 
    <wlevs:channel id="priceStream" event-type="PriceEvent">
        <wlevs:listener ref="filterFanoutProcessor" />
        <wlevs:source ref="PriceAdapter" />
    </wlevs:channel>
 
    <!-- By default, CQL is used for OCEP 11.0 -->
    <wlevs:processor id="filterFanoutProcessor" >
    </wlevs:processor>
 
    <wlevs:channel id="filteredStream"
        event-type="FilteredPriceEvent">
        <wlevs:listener ref="bbaProcessor" />
        <wlevs:listener ref="analyticsProcessor" />
        <wlevs:source ref="filterFanoutProcessor" />
    </wlevs:channel>
 
    <!-- Explicitly specify provider CQL -->
    <wlevs:processor id="bbaProcessor" provider="cql">
        <wlevs:listener ref="bidAskBBAStream" />
    </wlevs:processor>
 
    <wlevs:processor id="analyticsProcessor">
        <wlevs:listener ref="bidAskAnalyticsStream" />
    </wlevs:processor>
 
    <wlevs:channel id="bidAskBBAStream" event-type="BidAskEvent">
        <wlevs:listener ref="selectorProcessor" />
    </wlevs:channel>
    
    <wlevs:channel id="bidAskAnalyticsStream" event-type="BidAskEvent">
        <wlevs:listener ref="selectorProcessor" />
    </wlevs:channel>
 
    <wlevs:processor id="selectorProcessor">
        <wlevs:listener ref="citipocOut" />
    </wlevs:processor>
 
    <wlevs:channel id="citipocOut" event-type="FinalOrderEvent" advertise="true">
        <wlevs:listener>
            <!-- Create business object -->
            <bean id="outputBean"
                class="com.bea.wlevs.POC.citi.OutputBean"
                autowire="byName" />
        </wlevs:listener>
    </wlevs:channel>
</beans>
PKb\?PKz\EOEBPS/dcommon/oracle.gifJGIF87aiyDT2F'G;Q_oKTC[ 3-Bq{ttsoGc4I)GvmLZ).1)!ꑈ53=Z]'yuLG*)g^!8C?-6(29K"Ĩ0Яl;U+K9^u2,@@ (\Ȱ Ë $P`lj 8x I$4H *(@͉0dа8tA  DсSP v"TUH PhP"Y1bxDǕ̧_=$I /& .)+ 60D)bB~=0#'& *D+l1MG CL1&+D`.1qVG ( "D2QL,p.;u. |r$p+5qBNl<TzB"\9e0u )@D,¹ 2@C~KU 'L6a9 /;<`P!D#Tal6XTYhn[p]݅ 7}B a&AƮe{EɲƮiEp#G}D#xTIzGFǂEc^q}) Y# (tۮNeGL*@/%UB:&k0{ &SdDnBQ^("@q #` @1B4i@ aNȅ@[\B >e007V[N(vpyFe Gb/&|aHZj@""~ӎ)t ? $ EQ.սJ$C,l]A `8A o B C?8cyA @Nz|`:`~7-G|yQ AqA6OzPbZ`>~#8=./edGA2nrBYR@ W h'j4p'!k 00 MT RNF6̙ m` (7%ꑀ;PKl-OJPKz\EOEBPS/dcommon/oracle-logo.jpgjJFIFC    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222'7" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQE!KEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEzE7V%ȣOΏ9??:a"\fSrğjAsKJ:nOzO=}E1-I)3(QEQEQEQEQEQEQE֝Hza<["2"pO#f8M[RL(,?g93QSZ uy"lx4h`O!LŏʨXZvq& c՚]+: ǵ@+J]tQ]~[[eϸ (]6A&>ܫ~+כzmZ^(<57KsHf妬Ϧmnẁ&F!:-`b\/(tF*Bֳ ~V{WxxfCnMvF=;5_,6%S>}cQQjsOO5=)Ot [W9 /{^tyNg#ЄGsֿ1-4ooTZ?K Gc+oyڙoNuh^iSo5{\ܹ3Yos}$.nQ-~n,-zr~-|K4R"8a{]^;I<ȤL5"EԤP7_j>OoK;*U.at*K[fym3ii^#wcC'IIkIp$󿉵|CtĈpW¹l{9>⪦׺*ͯj.LfGߍԁw] |WW18>w.ӯ! VӃ :#1~ +މ=;5c__b@W@ +^]ևՃ7 n&g2I8Lw7uҭ$"&"b eZ":8)D'%{}5{; w]iu;_dLʳ4R-,2H6>½HLKܹR ~foZKZ࿷1[oZ7׫Z7R¢?«'y?A}C_iG5s_~^ J5?œ tp]X/c'r%eܺA|4ծ-Ե+ْe1M38Ǯ `|Kյ OVڅu;"d56, X5kYR<̭CiطXԮ];Oy)OcWj֩}=܅s۸QZ*<~%뺃ȶp f~Bðzb\ݳzW*y{=[ C/Ak oXCkt_s}{'y?AmCjޓ{ WRV7r. g~Q"7&͹+c<=,dJ1V߁=T)TR՜*N4 ^Bڥ%B+=@fE5ka}ędܤFH^i1k\Sgdk> ֤aOM\_\T)8靠㡮3ģR: jj,pk/K!t,=ϯZ6(((((((49 xn_kLk&f9sK`zx{{y8H 8b4>ÇНE|7v(z/]k7IxM}8!ycZRQ pKVr(RPEr?^}'ðh{x+ՀLW154cK@Ng C)rr9+c:׹b Жf*s^ fKS7^} *{zq_@8# pF~ [VPe(nw0MW=3#kȵz晨cy PpG#W:%drMh]3HH<\]ԁ|_W HHҡb}P>k {ZErxMX@8C&qskLۙOnO^sCk7ql2XCw5VG.S~H8=(s1~cV5z %v|U2QF=NoW]ո?<`~׮}=ӬfԵ,=;"~Iy7K#g{ñJ?5$y` zz@-~m7mG宝Gٱ>G&K#]؃y1$$t>wqjstX.b̐{Wej)Dxfc:8)=$y|L`xV8ߙ~E)HkwW$J0uʟk>6Sgp~;4֌W+חc"=|ř9bc5> *rg {~cj1rnI#G|8v4wĿhFb><^ pJLm[Dl1;Vx5IZ:1*p)إ1ZbAK(1ׅ|S&5{^ KG^5r>;X׻K^? s fk^8O/"J)3K]N)iL?5!ƾq:G_=X- i,vi2N3 |03Qas ! 7}kZU781M,->e;@Qz T(GK(ah(((((((Y[×j2F}o־oYYq $+]%$ v^rϭ`nax,ZEuWSܽ,g%~"MrsrY~Ҿ"Fت;8{ѰxYEfP^;WPwqbB:c?zp<7;SBfZ)dϛ; 7s^>}⍱x?Bix^#hf,*P9S{w[]GF?1Z_nG~]kk)9Sc5Ո<<6J-ϛ}xUi>ux#ţc'{ᛲq?Oo?x&mѱ'#^t)ϲbb0 F«kIVmVsv@}kҡ!ˍUTtxO̧]ORb|2yԵk܊{sPIc_?ħ:Ig)=Z~' "\M2VSSMyLsl⺿U~"C7\hz_ Rs$~? TAi<lO*>U}+'f>7_K N s8g1^CeКÿE ;{+Y\ O5|Y{/o+ LVcO;7Zx-Ek&dpzbӱ+TaB0gNy׭ 3^c T\$⫫?F33?t._Q~Nln:U/Ceb1-im WʸQM+VpafR3d׫é|Aү-q*I P7:y&]hX^Fbtpܩ?|Wu󭏤ʫxJ3ߴm"(uqA}j.+?S wV ~ [B&<^U?rϜ_OH\'.;|.%pw/ZZG'1j(#0UT` Wzw}>_*9m>󑓀F?EL3"zpubzΕ$+0܉&3zڶ+jyr1QE ( ( ( ( ( ( ( (UIdC0EZm+]Y6^![ ԯsmܶ捆?+me+ZE29)B[;я*wGxsK7;5w)}gH~.Ɣx?X\ߚ}A@tQ(:ͧ|Iq(CT?v[sKG+*רqҍck <#Ljα5݈`8cXP6T5i.K!xX*p&ќZǓϘ7 *oƽ:wlຈ:Q5yIEA/2*2jAҐe}k%K$N9R2?7ýKMV!{W9\PA+c4w` Wx=Ze\X{}yXI Ү!aOÎ{]Qx)#D@9E:*NJ}b|Z>_k7:d$z >&Vv󃏽WlR:RqJfGإd9Tm(ҝEtO}1O[xxEYt8,3v bFF )ǙrPNE8=O#V*Cc𹾾&l&cmCh<.P{ʦ&ۣY+Gxs~k5$> ӥPquŽўZt~Tl>Q.g> %k#ú:Kn'&{[yWQGqF}AЅ׮/}<;VYZa$wQg!$;_ $NKS}“_{MY|w7G!"\JtRy+贾d|o/;5jz_6fHwk<ѰJ#]kAȎ J =YNu%dxRwwbEQEQEQEQEQEQEQEQEQE'fLQZ(1F)hQ@X1KEQE-Q@ 1KE3h=iPb(((1GjZ(-ʹRPbR@ 1KE7`bڒyS0(-&)P+ ڎԴP11F)h&:LRmQ@Q@Š(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((_ğ<+F; sU%ԑ >,BH(uSU xþ1Wϲs${wgoQn_swB/'L\ܓFgԏZ ^dj^L^NmH Ҁ6(?nƓjh%ةlΣ /F6}pj2E3HgHЌ(UQR8oX,G8OB]>o9@$xWy'ڹOM=ҼWb"٠9-*r⬻zWokeh͝(F@n~X=q+⟇1b>ƑeIX.~C,o5የ-m;D Nʬ` `+CcE??Ki!R!cxw[ jvc}&Eٱ7T)8&þ/?os$wSn^bo:-4^js4JKm!#rv89>' O59t , \8r,Vk|IgxEv((RmĜ+bkz6,u/}-|.'<VÚ~tk,^cH61¢ !;M;Ėz[#CuAƶ+j_&*/;Q8d ǹHyAsM↷7l-6rò,%Fs;A*',}'f[]tݷs~UWhk?:4JE]WpcY=" ƚw/|_xSw(kycH#r28,X7D5Kh76 mɍ~0H;6194WpGӧգ%8Z&GdPƧo6kcO5Kv`{}fyq \`@?Kv=26OޝyAe Qɼ芍H8͟2敮j#;iѻm؏6+wTx;KYY\-%'Aӣ?|=\-ٴk+٬$ɷ_X<+{#:8IlGLm\n5}=WE%n9SwD:ޣU6F_*"RƌXd1 Oݠ±SK?r\y-mvoH;P`VwTx;KYY\-%'Aӣ9߀>%6yezWYds$YN2s1@Ep~/X/=UuCܰ#ԲWuxoMzI.E @MG$krQWw<_Vk^l`R@,~%j:H*oLw&˼!u?ûp@=Bsxo~8x,s,c01q1qjM|v+2)G"kz6,u/}-|.'<V>K=Ozև s֑}@FP r\_i~*xk9FHᐃ$U#$uQ^':k̶ UXiwROʾ]/\1r]E $RQr2sg((((((((((5\gg#bo۷;9=밪zqj03Y.X ,@85b ặXTeu# 8 s@_;3K>}il -jk&- !;; o7<# 4k+m ZY~էvFJF(F獡\WQ@W "rS?'G?~gݷsۭnxzl|SY麥ŭuHp#fS]ĀǎFHz%/H%na_˂#(!aN6HKz5|5s,'z'so [ `Pm7Ϭ>ig;ۛco޹l#f H|Oxzk6$nR{FUp 0$ hP<w* O2Frjx5/ew IDĜ9* Ѧ7~|:egO(jddYRr?h tP7Iu=;ACnnrFI^N}CG6IФhц,X"Qr@y+( m?f{$x]`*ymoo_K- (RI#|af8=Dt\ϬW5 BudIBUN 'aQ@/k K~}?i+=Rf1''=p k5ޕi=7FbU,mBc:^Ep~/5oX&eE/s1IЫt_x)Mz4JI2NŤMI$pA/P:ƚ^KHc[ɨMkwx# ǀ2 WQy^O|=6otc! QDj68gQ@p~-ē_`~(CK{ {*62(?᷇Ox]6"BA86L:MVa6"&2} s ?J5mJF.FK0 E,@8:4#jz-ݵwoc* u zFì]H^o#F@`Igכ{xFÞM?R?7W"B +˜o_i?;v3w͝nc$/;/ K@Y>_hT(\ ) >}?>7|Nݻ|.7c=ͼ%oh!M$qZC a|"Np{+<5A?r<8"_HͷVqva iFSY pw 4τۖRhM*lk+Oi6]>' gEPIw #e l`, \~?ۖQ艥C*lhPwcZQg?O3/.ֲȊ~R͹:8 &>[xV=6څ˴G-B{ P9'Nꗰx/’x3j;h^IX˂AKI&z׌$pk1B _sOO0/Y_wҺ[ܟaBwolG7݁8$z*D}ˈfA0@7la68#j/SўP<iVԦ6IncZ} rzU#j@﹐RUK.FH~|mCۿG@2 ? |8\}R>&+WEv:WmrK*Į7wl|H4G[2-웶Œ9R~ׄ|áZI&CMB2ܖ83@[Wu7@l5B(c1꯹w W5_m[^wv)A-l&3=H`,ƻ|0/V>(,SA xz :F^Z-ߓSȒ@q2rA mu Y%؏mO]cXlqw]oх8Jv,02GQ jxͦxxG_ם ZEp@gtB> &ğR:\}ie0|̉^ןG}fzjBW Ƌ˕Tc9m[Tuxy[|Fm8Cl/%UF҈ٶ79RH$dy= O_YIJߟv(A=:g [ޟqiVkK^fɽ&QIߐͻ2:>ek*"5&Y]3FŎ(sݼoOjvykurbmSTꡆakS^5o Rhz2(eS¶7$Ҽ\Ե}WpuE0ƛ5{?>/)r23;i+'@4Oj3x7ב4+uK+3NUv%|%wbcTewSQEQEQEQEQEQEQEQEQEQEW&?wKEl-ϸXk唡#A< x@ůk2F)nwM<eh%B͌eL(zGtԴ[ ޠVC+T8 pAEa|SMlVͩKD\2y$cx\s@W&~1 j?qo&ݲ2}3ހ=Ѽ>^cu !Ke+* sWşZaFw/$x%3v@y8( _\|Rskkx^BR-1mx\N:mI~k'Va߿W w˙FP~=(8>&.hv W ǹv# @Ixhx^ԣIܤ@;9' 2q(r. uhg m$"r8:(\C%`oUFT(?>oТZ/n_cg$vcgozvzW;xoZum5$"HavY 29{O}ú ]y yH~C6r(ޣ?N\};̗b:8p+xBmM,t24 fȍ洀mbJ @E^?Gۼ?3;w㝹q(<]iNM:͢KȷHb67c#5Q\Muqb3n0O Bo ^Ꚅ5GYu+cA  ey< hgW[SNIb۴Pémc$sZG.-ߟ\%ְm$,6ʱMrhxn⸷9$l]H #ԔQEQEQEQEQEQEQEQEQEp*g#->ӻO|'?/qz& gOyNvo8ϽS/[x9xvFBFH8g?{fwێ#F6V1i J%I <JM}TԬ4<nkArS v?C?^ii:ƣ[[Լ˽ z"xV-?஥ ii}9;c9cՏҀ+oQ?؟d?;s[^f?8)^|OjV Y:O7bxAv \78x=0DG\^jlj|Aq1OA#I Fsu4&.7 -ƈY]1G l!K!uݡ ]s @'תh<-ih%1YǠ'@+?BK9HȂY!At9ր74[t )kO-ݵenW?NU|tQq (dBoŒA@InQzqXVմo_O̗S&p x'þW?l}$ocnnJï:>W"Gۼo__+~߲om8нr',|#t#@OBy$N!;vOGQ@/EWǏ?u7y{xﶽ|gPx{5-^ H{FG>'& X]/gvsHع#il9Ǩ'U_[KgPխΛ]i׷gc6rs`UOM;b߽qz5 N/,/.ifGdx،H%H[4W?ЗO˸y~^дmCItQD**Arűp$he)"xG_Z4H.ofdfpoޠ~ xxVC@f+sj lgldɍۀF1@z n/ 6{hʘo)E]k7#gY^5sgB_3s?k.{xqgx?z>VIJn q  $?]sHHlr3ބ6ߘNqh -ƽu ZTui nS!PKszWyX~~ytw)@1' dwyZ3"ɻkr/+^^ K ;q+(G-qxiwK"odR~J ]ZD4 WLBK DH rcg5c ~Ig;Ws_QInQhh |b [IѾ}._Lw)S9G"oo|GOj7/Kv 8WpPaUoqJMˑ~6:0<ǂ|;`icV;Inv8V!ojYk\(ć9wTۺ/9//വA.H,x$ƸR_?^ۏ9]EmC᫫?3HX[0(7ߜs@_WAw?e]O羅nn3ҳO gw/ڦ}ᜃ#@Gۼ?`<߷񞙯MFxgѵ -O{d8,Uca'|:& gOyNvo8Ͻa <Q=cE{@*$EcN8P?"UC+۫rYw/.;WYmi]9Ky"Yf`1?} IcagYgaiy rI8Q$5'|/7LoimŲx9fCOvv4Ojޟ(+Mrn) "DJM6AI |9#,q!.3PY*w$ |,N@I4Me3`@GX Oracle Legal Notices

Oracle Legal Notices

Copyright Notice

Copyright © 1994-2014, Oracle and/or its affiliates. All rights reserved.

Trademark Notice

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

License Restrictions Warranty/Consequential Damages Disclaimer

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

Warranty Disclaimer

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

Restricted Rights Notice

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

Hazardous Applications Notice

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Third-Party Content, Products, and Services Disclaimer

This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.

Alpha and Beta Draft Documentation Notice

If this document is in preproduction status:

This documentation is in preproduction status and is intended for demonstration and preliminary use only. It may not be specific to the hardware on which you are using the software. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to this documentation and will not be responsible for any loss, costs, or damages incurred due to the use of this documentation.

Oracle Logo

PK0hPKz\EOEBPS/dcommon/blafdoc.cssc@charset "utf-8"; /* Copyright 2002, 2011, Oracle and/or its affiliates. All rights reserved. Author: Robert Crews Version: 2011.8.12 */ body { font-family: Tahoma, sans-serif; /* line-height: 125%; */ color: black; background-color: white; font-size: small; } * html body { /* http://www.info.com.ph/~etan/w3pantheon/style/modifiedsbmh.html */ font-size: x-small; /* for IE5.x/win */ f\ont-size: small; /* for other IE versions */ } h1 { font-size: 165%; font-weight: bold; border-bottom: 1px solid #ddd; width: 100%; text-align: left; } h2 { font-size: 152%; font-weight: bold; text-align: left; } h3 { font-size: 139%; font-weight: bold; text-align: left; } h4 { font-size: 126%; font-weight: bold; text-align: left; } h5 { font-size: 113%; font-weight: bold; display: inline; text-align: left; } h6 { font-size: 100%; font-weight: bold; font-style: italic; display: inline; text-align: left; } a:link { color: #039; background: inherit; } a:visited { color: #72007C; background: inherit; } a:hover { text-decoration: underline; } a img, img[usemap] { border-style: none; } code, pre, samp, tt { font-family: monospace; font-size: 110%; } caption { text-align: center; font-weight: bold; width: auto; } dt { font-weight: bold; } table { font-size: small; /* for ICEBrowser */ } td { vertical-align: top; } th { font-weight: bold; text-align: left; vertical-align: bottom; } li { text-align: left; } dd { text-align: left; } ol ol { list-style-type: lower-alpha; } ol ol ol { list-style-type: lower-roman; } td p:first-child, td pre:first-child { margin-top: 0px; margin-bottom: 0px; } table.table-border { border-collapse: collapse; border-top: 1px solid #ccc; border-left: 1px solid #ccc; } table.table-border th { padding: 0.5ex 0.25em; color: black; background-color: #f7f7ea; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; } table.table-border td { padding: 0.5ex 0.25em; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; } span.gui-object, span.gui-object-action { font-weight: bold; } span.gui-object-title { } p.horizontal-rule { width: 100%; border: solid #cc9; border-width: 0px 0px 1px 0px; margin-bottom: 4ex; } div.zz-skip-header { display: none; } td.zz-nav-header-cell { text-align: left; font-size: 95%; width: 99%; color: black; background: inherit; font-weight: normal; vertical-align: top; margin-top: 0ex; padding-top: 0ex; } a.zz-nav-header-link { font-size: 95%; } td.zz-nav-button-cell { white-space: nowrap; text-align: center; width: 1%; vertical-align: top; padding-left: 4px; padding-right: 4px; margin-top: 0ex; padding-top: 0ex; } a.zz-nav-button-link { font-size: 90%; } div.zz-nav-footer-menu { width: 100%; text-align: center; margin-top: 2ex; margin-bottom: 4ex; } p.zz-legal-notice, a.zz-legal-notice-link { font-size: 85%; /* display: none; */ /* Uncomment to hide legal notice */ } /*************************************/ /* Begin DARB Formats */ /*************************************/ .bold, .codeinlinebold, .syntaxinlinebold, .term, .glossterm, .seghead, .glossaryterm, .keyword, .msg, .msgexplankw, .msgactionkw, .notep1, .xreftitlebold { font-weight: bold; } .italic, .codeinlineitalic, .syntaxinlineitalic, .variable, .xreftitleitalic { font-style: italic; } .bolditalic, .codeinlineboldital, .syntaxinlineboldital, .titleinfigure, .titleinexample, .titleintable, .titleinequation, .xreftitleboldital { font-weight: bold; font-style: italic; } .itemizedlisttitle, .orderedlisttitle, .segmentedlisttitle, .variablelisttitle { font-weight: bold; } .bridgehead, .titleinrefsubsect3 { font-weight: bold; } .titleinrefsubsect { font-size: 126%; font-weight: bold; } .titleinrefsubsect2 { font-size: 113%; font-weight: bold; } .subhead1 { display: block; font-size: 139%; font-weight: bold; } .subhead2 { display: block; font-weight: bold; } .subhead3 { font-weight: bold; } .underline { text-decoration: underline; } .superscript { vertical-align: super; } .subscript { vertical-align: sub; } .listofeft { border: none; } .betadraft, .alphabetanotice, .revenuerecognitionnotice { color: #f00; background: inherit; } .betadraftsubtitle { text-align: center; font-weight: bold; color: #f00; background: inherit; } .comment { color: #080; background: inherit; font-weight: bold; } .copyrightlogo { text-align: center; font-size: 85%; } .tocsubheader { list-style-type: none; } table.icons td { padding-left: 6px; padding-right: 6px; } .l1ix dd, dd dl.l2ix, dd dl.l3ix { margin-top: 0ex; margin-bottom: 0ex; } div.infoboxnote, div.infoboxnotewarn, div.infoboxnotealso { margin-top: 4ex; margin-right: 10%; margin-left: 10%; margin-bottom: 4ex; padding: 0.25em; border-top: 1pt solid gray; border-bottom: 1pt solid gray; } p.notep1 { margin-top: 0px; margin-bottom: 0px; } .tahiti-highlight-example { background: #ff9; text-decoration: inherit; } .tahiti-highlight-search { background: #9cf; text-decoration: inherit; } .tahiti-sidebar-heading { font-size: 110%; margin-bottom: 0px; padding-bottom: 0px; } /*************************************/ /* End DARB Formats */ /*************************************/ @media all { /* * * { line-height: 120%; } */ dd { margin-bottom: 2ex; } dl:first-child { margin-top: 2ex; } } @media print { body { font-size: 11pt; padding: 0px !important; } a:link, a:visited { color: black; background: inherit; } code, pre, samp, tt { font-size: 10pt; } #nav, #search_this_book, #comment_form, #comment_announcement, #flipNav, .noprint { display: none !important; } body#left-nav-present { overflow: visible !important; } } PKr.hcPKz\EOEBPS/dcommon/doccd_epub.jsM /* Copyright 2006, 2012, Oracle and/or its affiliates. All rights reserved. Author: Robert Crews Version: 2012.3.17 */ function addLoadEvent(func) { var oldOnload = window.onload; if (typeof(window.onload) != "function") window.onload = func; else window.onload = function() { oldOnload(); func(); } } function compactLists() { var lists = []; var ul = document.getElementsByTagName("ul"); for (var i = 0; i < ul.length; i++) lists.push(ul[i]); var ol = document.getElementsByTagName("ol"); for (var i = 0; i < ol.length; i++) lists.push(ol[i]); for (var i = 0; i < lists.length; i++) { var collapsible = true, c = []; var li = lists[i].getElementsByTagName("li"); for (var j = 0; j < li.length; j++) { var p = li[j].getElementsByTagName("p"); if (p.length > 1) collapsible = false; for (var k = 0; k < p.length; k++) { if ( getTextContent(p[k]).split(" ").length > 12 ) collapsible = false; c.push(p[k]); } } if (collapsible) { for (var j = 0; j < c.length; j++) { c[j].style.margin = "0"; } } } function getTextContent(e) { if (e.textContent) return e.textContent; if (e.innerText) return e.innerText; } } addLoadEvent(compactLists); function processIndex() { try { if (!/\/index.htm(?:|#.*)$/.test(window.location.href)) return false; } catch(e) {} var shortcut = []; lastPrefix = ""; var dd = document.getElementsByTagName("dd"); for (var i = 0; i < dd.length; i++) { if (dd[i].className != 'l1ix') continue; var prefix = getTextContent(dd[i]).substring(0, 2).toUpperCase(); if (!prefix.match(/^([A-Z0-9]{2})/)) continue; if (prefix == lastPrefix) continue; dd[i].id = prefix; var s = document.createElement("a"); s.href = "#" + prefix; s.appendChild(document.createTextNode(prefix)); shortcut.push(s); lastPrefix = prefix; } var h2 = document.getElementsByTagName("h2"); for (var i = 0; i < h2.length; i++) { var nav = document.createElement("div"); nav.style.position = "relative"; nav.style.top = "-1.5ex"; nav.style.left = "1.5em"; nav.style.width = "90%"; while (shortcut[0] && shortcut[0].toString().charAt(shortcut[0].toString().length - 2) == getTextContent(h2[i])) { nav.appendChild(shortcut.shift()); nav.appendChild(document.createTextNode("\u00A0 ")); } h2[i].parentNode.insertBefore(nav, h2[i].nextSibling); } function getTextContent(e) { if (e.textContent) return e.textContent; if (e.innerText) return e.innerText; } } addLoadEvent(processIndex); PKo"nR M PKz\EOEBPS/deploy_tags.htm&t Schema Reference: Deployment deployment.xsd

E Schema Reference: Deployment deployment.xsd

This appendix provides a reference to the elements of the deployment.xsd schema, the schema behind the XML with which you configure Oracle CEP application deployment.

E.1 Overview of the Oracle CEP Deployment Elements

Oracle CEP provides a number of application assembly elements 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.

E.1.1 Element Hierarchy

The Oracle CEP component configuration elements are organized into the following hierarchy:

beans
    Standard Spring and OSGi elements such as bean, osgi-service, and so on.

E.1.2 Example of an Oracle CEP Deployment Configuration File

The following sample deployment configuration file from the fx application shows how to use many of the Oracle CEP elements:

<?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:wlevs="http://www.bea.com/ns/wlevs/deployment" xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.bea.com/ns/wlevs/deployment
    http://www.bea.com/ns/wlevs/deployment/deployment.xsd">
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
</bean>
<wlevs:deployment 
    id="fx" 
    state="start"
    location="file:${wlevs.domain.home}/applications/fx/com.bea.wlevs.example.fx_11.1.0.0.jar"/>
</beans>

E.2 wlevs:deployment

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

E.2.1 Child Elements

The wlevs:deployment deployment element has no child elements:

E.2.2 Attributes

Table E-1 lists the attributes of the wlevs:deployment deployment element.

Table E-1 Attributes of the wlevs:deployment Deployment Element

AttributeDescriptionData TypeRequired?

id

Unique identifier for this deployed application.

String

Yes.

depends-on

The names of the beans that this deployment bean depends on being initialized. The bean factory will guarantee that these beans get initialized before this bean.

String

Yes.

location

URL that specifies the location of the bundle that is to be deployed. If a relative URL is specified then the location is relative the DOMAIN_DIR domain directory.

For example:

location="file:applications/simpleApp/simpleApp.jar"

Specifies that the bundle simpleApp.jar, located in the DOMAIN_DIR/applications/simpleApp directory, is to be deployed to Oracle CEP server.

String

No.

state

Specifies the state that the bundle should be in once it is deployed to the Oracle CEP server. The value of this attribute must be one of the following:

  • start: Install and start the bundle so that it immediately begins taking client requests.

  • install: Install the bundle, but do not start it.

  • update: Update an existing bundle.

Default value: start.

String

No.


E.2.3 Example

The following example shows how to use the wlevs:deployment element in the deployment file:

<?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:wlevs="http://www.bea.com/ns/wlevs/deployment" xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.bea.com/ns/wlevs/deployment
    http://www.bea.com/ns/wlevs/deployment/deployment.xsd">
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
</bean>
<wlevs:deployment 
    id="fx" 
    state="start"
    location="file:${wlevs.domain.home}/applications/fx/com.bea.wlevs.example.fx_11.1.0.0.jar"/>
</beans>
PKTj&&PKz\EOEBPS/ide_epn.htm Oracle CEP IDE for Eclipse and the Event Processing Network

6 Oracle CEP IDE for Eclipse and the Event Processing Network

This chapter describes how to use the Oracle Complex Event Processing (Oracle CEP) IDE for Eclipse to develop event processing networks (EPNs), where application components are wired together. The EPN Editor provides a graphical view of the EPN and offers visualization and navigation features to help you build Oracle CEP applications.

This section describes how to use the editor and the information it displays, including:

6.1 Opening the EPN Editor

You can open the EPN Editor from either the project folder or a context or configuration file of an Oracle CEP application.

6.1.1 How to Open the EPN Editor from a Project Folder

You can open the EPN Editor from the Eclipse project folder of an Oracle CEP application. Alternatively, you can open the EPN Editor from a context or configuration file (see Section 6.1.2, "How to Open the EPN Editor from a Context or Configuration File").

To open the EPN Editor from a project:

  1. Launch the Oracle CEP IDE for Eclipse.

  2. Open your Oracle CEP project in the Project Explorer.

  3. Right-click the project folder and select Open EPN Editor as Figure 6-1 shows.

    Figure 6-1 Opening the EPN Editor from a Project

    Description of Figure 6-1 follows

    The EPN Editor opens in a tab named EPN:PROJECT-NAME, where PROJECT-NAME is the name of your Oracle CEP project, as Figure 6-2 shows.

    Figure 6-2 EPN Editor

    Description of Figure 6-2 follows

6.1.2 How to Open the EPN Editor from a Context or Configuration File

You can open the EPN Editor from a Spring context file or an Oracle CEP server configuration file in an Oracle CEP application. Alternatively, you can open the EPN Editor from a context or configuration file (see Section 6.1.1, "How to Open the EPN Editor from a Project Folder")

To open the EPN Editor from a context or configuration file:

  1. Launch the Oracle CEP IDE for Eclipse.

  2. Open your Oracle CEP project in the Project Explorer.

  3. Right-click a context or configuration file and select Open in EPN Editor as Figure 6-3 shows.

    Figure 6-3 Opening the EPN Editor from a Context or Configuration File

    Description of Figure 6-3 follows

    The EPN Editor opens in a tab named EPN:PROJECT-NAME, where PROJECT-NAME is the name of your Oracle CEP project, as Figure 6-4 shows.

    Figure 6-4 EPN Editor

    Description of Figure 6-4 follows

6.2 EPN Editor Overview

This section describes the main controls you use to manage the EPN view and how the EPN Editor displays Oracle CEP application information, including:

6.2.1 Flow Representation

The primary display in the editor is of the flow inside the application as Figure 6-5 shows.

Figure 6-5 EPN Flow Representation

Description of Figure 6-5 follows

The EPN is composed of nodes connected by links and streams. Nodes are of various types including adapter, processor, database table, bean, and cache. For more information on the graphic notation the EPN Editor uses on nodes, links, and streams, see:

6.2.2 Filtering

Although you often specify your EPN in a single assembly file, you may specify an EPN across multiple assembly files.

By default the EPN Editor shows the EPN for a single Oracle CEP application bundle with the information combined from all files.

To see the network for a single assembly file simply select that file from the Filter pull-down menu as Figure 6-6 shows.

Figure 6-6 Filtering the EPN by Assembly File

Description of Figure 6-6 follows

When editing an EPN, the assembly file shown in the EPN Editor filter is the assembly file to which new nodes will be added. If the EPN Editor filter is set to Full EPN then the first assembly file in the filter list will be the file to which new nodes will be added. Existing nodes will be edited in or deleted from the assembly file in which they are defined.

If the assembly file the EPN Editor edits is open in an Eclipse source editor, then the edits will be made to the editor for that open file. In this case, you will need to save changes to the open editor before the changes appear in the file on disk.

If the assembly file the EPN Editor edits is not open in an Eclipse source editor, then the edits are immediately applied to the file on disk.

For more information, see Section 4.3, "Creating EPN Assembly Files".

6.2.3 Zooming

You can change the zoom level of the EPN Editor by entering a percent value into the zoom field or selecting a value from the zoom field pull-down menu as Figure 6-7 shows. To fit the EPN into the current EPN Editor window, select Fit to Window.

Figure 6-7 Zoom Level

Description of Figure 6-7 follows

6.2.4 Layout

You can optimize and simplify the EPN layout by clicking Layout EPN as Figure 6-8 shows.

Figure 6-8 Optimize Layout

Description of Figure 6-8 follows

6.2.5 Showing and Hiding Unconnected Beans

You can also filter out <bean> elements with no references in the EPN. Clicking Show/Hide Unconnected Beans will toggle the visibility of such beans as Figure 6-9 shows. For more information, see Section 6.4.3, "Laying Out Nodes".

Figure 6-9 Show/Hide Unconnected Beans

Description of Figure 6-9 follows

6.2.6 Printing and Exporting to an Image

You can export the EPN Editor view to an image file by clicking Export to Image as Figure 6-10 shows. You can export the image as a .bmp, .gif, .jpg, or .png file.

Figure 6-10 Exporting the EPN as an Image File

Description of Figure 6-10 follows

You can print the EPN Editor view by clicking Print as Figure 6-11 shows.

Figure 6-11 Printing the EPN

Description of Figure 6-11 follows

6.2.7 Configuration Badging

Nodes that have configuration information in one of the configuration files in the META-INF/wlevs directories are badged with an indicator on the bottom right as Figure 6-12 shows.

Figure 6-12 Configuration Badging

Description of Figure 6-12 follows

Nodes with this badge will also have the Go To Configuration Source context menu item.

6.2.8 Link Specification Location Indicator

When working with streams, you can specify a link in the assembly file as a:

  • source element in the downstream node.

  • listener element in the upstream node

A circle on the line indicates where a particular link is specified in the assembly file.

Figure 6-13 shows an example in which the link is specified as a source element on the downstream node outStream so the circle is next to the outStream node. Figure 6-14 shows the corresponding assembly file.

Figure 6-13 Link Source

Description of Figure 6-13 follows

Figure 6-14 Link Source Assembly File

Description of Figure 6-14 follows

Figure 6-15 shows an example in which the link is specified as a listener element in the upstream node algoTradingProcessor so the circle is next to the algoTradingProcessor node. Figure 6-16 shows the corresponding assembly file.

Figure 6-15 Link Listener

Description of Figure 6-15 follows

Figure 6-16 Link Listener Assembly File

Description of Figure 6-16 follows

6.2.9 Nested Stages

When you define a child node within a parent node, the child node is said to be nested. Only the parent node can specify the child node as a listener. You can drag references from a nested element, but not to them. For more information, see Section 6.4.2, "Connecting Nodes".

Consider the EPN that Figure 6-17 shows. Example 6-1 shows the EPN assembly source for this EPN. Note that the HelloWorldBean is nested within the helloworldOutputChannel. As a result, it appears within a box in the EPN diagram. Only the parent helloworldOutputChannel may specify the nested bean as a listener.

Figure 6-17 EPN With Nested Bean

Description of Figure 6-17 follows

Example 6-1 Assembly Source for EPN With Nested Bean

<wlevs:adapter id="helloworldAdapter"
 class="com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter" >
    <wlevs:instance-property name="message" value="HelloWorld - the current time is:"/>
</wlevs:adapter>

<wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
    <wlevs:listener ref="helloworldProcessor"/>
    <wlevs:source ref="helloworldAdapter"/>
</wlevs:channel>

<wlevs:processor id="helloworldProcessor" />

<wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent" advertise="true">
    <wlevs:listener>
        <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
    </wlevs:listener>
    <wlevs:source ref="helloworldProcessor"/>
</wlevs:channel>

Alternatively, you can define this EPN so that all nodes are nested as Figure 6-18 shows. Example 6-2 shows the EPN assembly source for this EPN. Note that all the nodes are nested and as a result, all nodes appear within a box in the EPN diagram. The helloworldAdapter is the outermost parent node and does not appear within a box in the EPN diagram.

Figure 6-18 EPN With all Nodes Nested

Description of Figure 6-18 follows

Example 6-2 Assembly Source for EPN With all Nodes Nested

<wlevs:adapter id="helloworldAdapter" class="com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter" >
    <wlevs:instance-property name="message" value="HelloWorld - the current time is:"/>
    <wlevs:listener>
        <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
            <wlevs:listener>
                <wlevs:processor id="helloworldProcessor">
                    <wlevs:listener>
                        <wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent">
                            <wlevs:listener>
                                <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
                            </wlevs:listener>
                        </wlevs:channel>
                    </wlevs:listener>
                </wlevs:processor>
            </wlevs:listener>
        </wlevs:channel>
    </wlevs:listener>
</wlevs:adapter>

6.2.10 Event Type Repository Editor

You can create and edit JavaBean and tuple event types using the event type repository editor.

To open the event type repository editor, click on the Event Types tab in the EPN editor as Figure 6-19 shows.

Figure 6-19 Event Type Repository Editor

Description of Figure 6-19 follows

For more information, see:

For information on the other types of events you can create, see Section 1.1.2, "Oracle CEP Event Types".

6.3 Navigating the EPN Editor

Because the EPN Editor has a view of the whole project it is a natural place from which to navigate to the various artifacts that make up an Oracle CEP application. Oracle CEP IDE for Eclipse offers the following features to help navigate the EPN Editor:

6.3.1 Moving the Canvas

To move the EPN canvas without using the horizontal and vertical scroll bars, you can use any of the following options:

  • Position the cursor on the canvas, hold down the middle mouse button, and drag.

  • Hold down the space bar and click and drag the canvas.

  • In the Overview view, click in the highlight box and drag.

6.3.2 Shortcuts to Component Configuration and EPN Assembly Files

If a node has a configuration object associated with it, then double-clicking that node will open the component configuration file where that node's behavior is defined.

Otherwise, double-clicking that node will open the EPN assembly file (the Spring context file) where that node is defined.

A configuration badge will be shown on nodes with associated configuration objects as shown in Figure 6-20.

Figure 6-20 Node with Configuration Badge

Description of Figure 6-20 follows

For more information, see:

6.3.3 Hyperlinking

When editing a component configuration file, EPN assembly file, or Oracle CQL statement, hold down the Ctrl key to turn on hyperlinking. Using hyperlinking, you can easily move between assembly and configuration files and follow reference IDs to jump to bean implementation classes.

This section describes:

6.3.3.1 Hyperlinking in Component Configuration and EPN Assembly Files

Figure 6-21 shows a component configuration file with the cursor over the value of a processor element name child element while holding down the Ctrl key. The name value has an underline to indicate it is a hyperlink. Click this link to jump to the corresponding element in the EPN assembly file as Figure 6-22 shows.

Figure 6-21 Component Configuration File: Hyperlinking to EPN Assembly File

Description of Figure 6-21 follows

Similarly, hovering over the wlevs:processor element id child element value filterFanoutProcessor while holding down the Ctrl key allows you to hyperlink back to the component configuration file.

Figure 6-22 EPN Assembly File: Hyperlinking to Component Configuration File

Description of Figure 6-22 follows

6.3.3.2 Hyperlinking in Oracle CQL Statements

Figure 6-23 shows a component configuration file with the cursor over an event attribute while holding down the Ctrl key. The fromRate attribute has an underline to indicate it is a hyperlink. Click this link to jump to the corresponding event definition in the EPN assembly file as Figure 6-24 shows.


Note:

Hyperlinking in Oracle SQL statements is designed for simple use cases and may not work as expected in more complex implementations.


Figure 6-23 Oracle CQL Statement: Event Schema

Description of Figure 6-23 follows

Figure 6-24 Corresponding Event Definition in EPN Assembly File

Description of Figure 6-24 follows

Similarly, you can Ctrl-click the FxQuoteStream channel in the Oracle CQL statement that Figure 6-23 shows to jump to the channel's definition. This is applicable wherever references to external objects are present in a Oracle CQL statement.

6.3.4 Context Menus

Each node on the EPN Editor has a group of context menu items that provide convenient access to various node-specific functions. Right-click the node to display its context menu.

Depending on the node type, you can use the EPN Editor context menu to select from the following options:

  • Go to Configuration Source: opens the corresponding component configuration file and positions the cursor in the appropriate element. You can use hyperlinking to quickly move from this file to the corresponding EPN assembly file. For more information, see Section 6.3.3, "Hyperlinking".

  • Go to Assembly Source: opens the corresponding EPN assembly file and positions the cursor in the appropriate element. You can use hyperlinking to quickly move from this file to the corresponding component configuration file. For more information, see Section 6.3.3, "Hyperlinking"

  • Go to Java Source: opens the corresponding Java source file for this component.

  • Delete: deletes the component from both the EPN assembly file and component configuration file (if applicable).

  • Rename: allows you to change the name of the component. The name is updated in both the EPN assembly file and component configuration file (if applicable).

  • Help: displays context sensitive help for the component.

Note that these navigation options will become disabled when a corresponding source artifact cannot be found. For example, if an adapter does not have a corresponding entry in a configuration XML file, its Go to Configuration Source menu item will be greyed out.

6.3.5 Browsing Oracle CEP Types

A typical Oracle CEP project contains many instances of Oracle CEP types such as adapters, channels, processors, event beans. In a large, complex Oracle CEP project, it can be a challenge to locate a particular instance. The Oracle CEP IDE for Eclipse provides an Oracle CEP type browser that you can use to quickly locate instances of any Oracle CEP type.

6.3.5.1 How to Browse Oracle CEP Types

You can open the Oracle CEP type browser using the keyboard short cut Ctrl-Alt-T.

To browse Oracle CEP types:

  1. Open an Oracle CEP project.

    In the following procedure, consider the Oracle CEP project that Figure 6-25 shows. This is based on the Oracle CEP foreign exchange example. For more information on this example, see "Foreign Exchange (FX) Example" in the Oracle Fusion Middleware Getting Started Guide for Oracle Complex Event Processing.

    Figure 6-25 Example Oracle CEP EPN

    Description of Figure 6-25 follows

  2. Type the keyboard short cut Ctrl-Alt-T.

    The Oracle CEP type browser appears as Figure 6-26 shows.

    Figure 6-26 Oracle CEP Type Browser

    Description of Figure 6-26 follows

  3. Configure the Oracle CEP Type dialog as shown in Table 6-1.

    Table 6-1 Oracle CEP Type Dialog

    AttributeDescription

    Select an item to open

    Specify a filter to match the names of the items you wan to find.

    Use the ? wildcard for any single character and the * wildcard for any string of two or more characters.

    Matching items

    The list of Oracle CEP type instances whose name matches the filter you specified.


    By default, the status line below the Matching items list shows the fully qualified path to the selected item in the Select an item to open list. To toggle status line display, click on the pull-down menu in the right hand corner and select Show Status Line.

  4. Select a type in the Matching Items list and click OK.

    The type is opened in the source file in which it is defined. For example, selecting FilterAsia from the Matching Items list and clicking OK opens the com.oracle.cep.sample.fx.content.xml EPN assembly file in which this processor is defined as Figure 6-27 shows.

    Figure 6-27 Opening the FilterAsia EPN Assembly File

    Description of Figure 6-27 follows

    To navigate to the corresponding component configuration file as Figure 6-28 shows, Ctrl-click the FilterAsia id attribute value.

    Figure 6-28 Opening the FilterAsia Component Configuration File

    Description of Figure 6-28 follows

    For more information on hyperlinking, see Section 6.3.3, "Hyperlinking".

6.4 Using the EPN Editor

The EPN Editor allows you to create and edit an application's EPN using actions on the editor surface. Most actions in the EPN Editor result in edits to an assembly file in that application. You can use a single EPN assembly file or multiple EPN assembly files (for more information, see Section 6.2.2, "Filtering").

The following sections describe EPN Editor editing tasks, including:

For more information, see:

6.4.1 Creating Nodes

When adding new nodes to an EPN using the EPN editor, a new node will appear at the location of the mouse click that was used to show the EPN Editor context menu. You can create any of the nodes that Table 6-2 lists.

Table 6-2 EPN Editor Icons

NodeDescription
Adapter icon

Adapter: a node that interfaces an event data source with the EPN or interfaces the EPN with an event data sink.

For more information, see:

Channel icon


Channel: a node that conveys events between an event data source and an event data sink.

For more information, see:

Processor icon


Processor: a node that executes Oracle CQL or EPL rules on the event data offered to it by one or more channels.

For more information, see:

Event Bean icon


Event Bean: a node similar to a standard Spring bean except that it can be managed by the Oracle CEP management framework and can actively use the capabilities of the Oracle CEP server container.

For more information, see:

Bean icon


Spring Bean: a Plain Old Java Object (POJO) node that consumes events. A Spring bean is managed by the Spring framework.

For more information, see:

Cache icon


Cache: a node that provides a temporary storage area for events, created exclusively to improve the overall performance of your Oracle CEP application.

For more information, see:

Table icon


Table: a node that connects a relational database table to the EPN as an event data source.

For more information, see:


The user may not reposition the nodes on the EPN Editor. To refresh the layout of the nodes on the EPN Editor, click the Layout EPN button on the EPN Editor toolbar. For more information, see Section 6.4.3, "Laying Out Nodes".

When a child node is nested within a parent node, its icon appears within a box. For more information, see Section 6.2.9, "Nested Stages".

6.4.1.1 How to Create a Basic Node

Basic nodes include beans, caches, channels, event beans, and tables.

For information on how to create other nodes, see Section 6.4.1, "Creating Nodes".

To create a basic node:

  1. Open the EPN Editor (see Section 6.1, "Opening the EPN Editor").

  2. Right-click on an empty portion of the EPN Editor surface and select New from the context menu as Figure 6-29 shows.

    Figure 6-29 Creating a Basic Node

    Description of Figure 6-29 follows

  3. Select the type of node you want to create.

    The EPN Editor edits the source file indicated in the EPN Editor filter and the EPN Editor displays the new EPN node. For most nodes, a default ID is chosen and the new node is immediately opened for rename as Figure 6-30 shows.

    Figure 6-30 New Basic Node

    Description of Figure 6-30 follows

    To rename the node, see Section 6.4.4, "Renaming Nodes".

    To reposition the node and update the EPN Editor layout, see Section 6.4.3, "Laying Out Nodes".

  4. Optionally, configure additional node options.

    See:

6.4.1.2 How to Create an Adapter Node

This section describes how to create an adapter using the EPN Editor, including:

  • JMS adapters (in-bound or out-bound)

  • HTTP publish-subscribe server adapters (publishing or subscribing)

For information on how to create other nodes, see Section 6.4.1, "Creating Nodes".

To create an adapter node:

  1. Open the EPN Editor (see Section 6.1, "Opening the EPN Editor").

  2. Right-click on an empty portion of the EPN Editor surface and select New from the context menu as Figure 6-31 shows.

    Figure 6-31 Creating an Adapter Node

    Description of Figure 6-31 follows

  3. Select node type Adapter.

    The New Adapter wizard appears as shown in Figure 6-32.

    Figure 6-32 New Adapter Wizard

    Description of Figure 6-32 follows

  4. Configure the New Adapter Wizard - Page 1 as shown in Table 6-3.

    Table 6-3 New Adapter Wizard - Page 1

    AttributeDescription

    Adapter ID

    Specifies the ID of the adapter EPN element and the name of the associated adapter configuration element.

    Provider

    Select the adapter provider type from the pull-down menu for an adapter already defined in the Oracle CEP component configuration schema.

    Select one of:

    • jms-inbound: JMS in-bound adapter.

    • jms-outbound: JMS out-bound adapter.

    • httppub: HTTP publish-subscribe adapter for publishing.

    • httpsub: HTTP publish-subscribe adapter for subscribing.

    Class

    Specify the fully qualified Java class name of a custom adapter.

    NOTE: If you are using a custom adapter factory, you must add the wlevs:factory element manually. For more information, see Chapter 14, "Configuring Custom Adapters".

    Create a new file

    Creates the adapter component configuration in a new file.

    The new file is created in the application's META-INF/wlevs directory with the same name as the adapter ID.

    Use an existing configuration file

    Creates the adapter component configuration in an existing configuration file.

    The new adapter configuration element is appended to the configurations in the selected file.


  5. Proceed depending on how you configured the adapter implementation:

    1. If you selected Class, Proceed to step 8.

    2. If you selected Provider, proceed to step 6.

  6. Click Next.

    The provider-specific New Adapter Wizard page appears.

  7. Configure the provider-specific New Adapter Wizard page as the following figures show:

    Figure 6-33 New Adapter Wizard - jms-inbound

    Description of Figure 6-33 follows

    Figure 6-34 New Adapter Wizard - jms-outbound

    Description of Figure 6-34 follows

    Figure 6-35 New Adapter Wizard - httppub

    Description of Figure 6-35 follows

    Figure 6-36 New Adapter Wizard - httpsub

    Description of Figure 6-36 follows

  8. Click Finish.

  9. Use the new adapter node on the EPN.

    The EPN Editor creates the adapter configuration in the file you specified in the New Adapter wizard, edits the source file indicated in the EPN Editor filter, and displays the new EPN node as Figure 6-37 shows.

    Figure 6-37 New Adapter Node

    Description of Figure 6-37 follows

    To rename the node, see Section 6.4.4, "Renaming Nodes".

    To reposition the node and update the EPN Editor layout, see Section 6.4.3, "Laying Out Nodes".

  10. Optionally, configure additional node options.

    For more information, see:

6.4.1.3 How to Create a Processor Node

This section describes how to create a processor node using the EPN Editor. For information on creating other node types, see Section 6.4.1.1, "How to Create a Basic Node".

When deploying an Oracle CEP application with a wlevs:processor node, other nodes in an EPN may reference that processor only if a processor configuration exists for that processor. Processor configurations are defined in Oracle CEP application configuration files. See Section 1.1.5, "Component Configuration Files" for more information about CEP configuration files.

To create a processor node:

  1. Open the EPN Editor (see Section 6.1, "Opening the EPN Editor").

  2. Right-click on an empty portion of the EPN Editor surface and select New from the context menu as Figure 6-38 shows.

    Figure 6-38 Creating a Processor Node

    Description of Figure 6-38 follows

  3. Select node type Processor.

    The New Processor dialog appears as shown in Figure 6-39.

    Figure 6-39 New Processor Dialog

    Description of Figure 6-39 follows

  4. Configure the New Processor dialog as shown in Table 6-4.

    Table 6-4 New Processor Dialog

    AttributeDescription

    Processor ID

    Specifies the ID of the processor EPN element and the name of the associated processor configuration element

    Create a new file

    Creates the processor configuration in a new file.

    The new file is created in the application's META-INF/wlevs directory with the same name as the processor ID.

    Use an existing configuration file

    Creates the processor configuration in an existing configuration file.

    The new processor configuration element is appended to the configurations in the selected file.


  5. Click OK.

    The EPN Editor creates the processor configuration in the file you specified in the New Processor dialog, edits the source file indicated in the EPN Editor filter, and displays the new EPN node as Figure 6-40 shows.

    Figure 6-40 New Processor Node

    Description of Figure 6-40 follows

    To rename the node, see Section 6.4.4, "Renaming Nodes".

    To reposition the node and update the EPN Editor layout, see Section 6.4.3, "Laying Out Nodes".


    Note:

    In Oracle CEP, you must use a channel to connect a push event source to an Oracle CQL processor and to connect an Oracle CQL processor to an event sink. For more information, see Section 9.1.2, "Channels Representing Streams and Relations".


  6. Optionally, configure additional processor options.

    See:

6.4.2 Connecting Nodes

The nodes in the EPN represent the flow of events through an Event Processing Network of an Oracle CEP application. When a node may forward events to another node in the EPN, the EPN Editor allows you to connect that node visually by dragging a line from the source node to the destination node.

6.4.2.1 How to Connect Nodes

This section describes how to connect nodes in the EPN Editor.

To connect nodes:

  1. Open the EPN Editor (see Section 6.1, "Opening the EPN Editor").

  2. Select the source of events and drag to the target of the event flow.

    • If a connection is allowed, a plug icon is shown at the target end as Figure 6-41 shows.

      Figure 6-41 Connecting Nodes: Connection Allowed

      Description of Figure 6-41 follows

    • If the connection is not allowed, a forbidden icon is shown at the target end as Figure 6-42 shows.

      Figure 6-42 Connecting Nodes: Connection Forbidden

      Description of Figure 6-42 follows

      Not all nodes may be a target of event flow. For example, connection is forbidden if:

  3. Release the mouse button to complete the connection.

    When the connection is made, the EPN Editor updates the EPN assembly file. For example:

    • When you connect an adapter to a channel or a channel to a processor or event bean, the EPN Editor adds a wlevs:listener element to the source node with a reference to the target node by ID.

    • When you connect a table to a processor, the EPN Editor adds a wlevs:table-source element to the target processor node that references the source table.

    For example, suppose you connect the adapter to the channel, and the channel to the processor shown in Figure 6-43.

    Figure 6-43 Valid Connections

    Description of Figure 6-43 follows

    Figure 6-44 shows the EPN assembly file before connection.

    Figure 6-44 EPN Assembly File: Before Connection

    Description of Figure 6-44 follows

    Figure 6-45 shows the EPN assembly file after connection.

    Figure 6-45 EPN Assembly File: After Connection

    Description of Figure 6-45 follows

6.4.3 Laying Out Nodes

Certain EPN Editor actions will use the location of the action as the location of the rendered result. For example, when adding new nodes to an EPN using the EPN editor, a new node will appear at the location of the mouse click that was used to show the EPN Editor context menu. The user may not reposition the nodes on the EPN Editor. To refresh the layout of the nodes on the EPN Editor, click the Layout EPN button on the EPN Editor toolbar as Figure 6-46 shows.

Figure 6-46 Laying Out Nodes

Description of Figure 6-46 follows

For more information, see Section 6.2.4, "Layout".

6.4.4 Renaming Nodes

Most node types support a rename operation that will change all references to the node across both assembly and configuration XML files. You can select Rename from the node's context menu as Figure 6-47 shows.

Figure 6-47 Renaming Nodes

Description of Figure 6-47 follows

6.4.5 Deleting Nodes

You may delete most nodes and connections visible on the EPN Editor using the node's context menu or the Delete key:

  • Using the keyboard, select the object you want to delete and then click the Delete key.

  • Using the context menu, right-click on the object to show the context menu, then select Delete as Figure 6-48 shows.

    Figure 6-48 Deleting Nodes

    Description of Figure 6-48 follows

When deleting a node, the incoming and outgoing connections are also deleted. For example, Figure 6-49 shows the EPN and Figure 6-51 shows the assembly file before deleting the channel node named stream.

Figure 6-49 EPN Before Deleting a Channel Node

Description of Figure 6-49 follows

Figure 6-50 Assembly File Before Deleting a Channel Node

Description of Figure 6-50 follows

Figure 6-51 shows the EPN and Figure 6-52 shows the assembly file after deleting this channel node.

Figure 6-51 EPN After Deleting a Channel Node

Description of Figure 6-51 follows

Figure 6-52 Assembly File After Deleting a Channel Node

Description of Figure 6-52 follows


Note:

If a bean or other anonymous element is deleted, then the object containing that object is deleted too. For example, given a bean within a wlevs:listener element, then deleting the bean will delete the listener element too.


PKp5.PKz\EOEBPS/prt_dep.htm Assembly, Deployment, and Testing PK6PKz\E OEBPS/toc.ncx'R Oracle® Fusion Middleware Developer's Guide for Oracle Complex Event Processing for Eclipse, 11g Release 1 (11.1.1.6.3) Cover Title and Copyright Information Contents List of Examples List of Figures List of Tables Preface What's New in This Guide for Release 11.1.1.6.x Part I Introduction 1 Overview of Creating Oracle CEP Applications 2 Overview of Oracle CEP Events Part II Oracle CEP IDE for Eclipse 3 Overview of the Oracle CEP IDE for Eclipse 4 Oracle CEP IDE for Eclipse Projects 5 Oracle CEP IDE for Eclipse and Oracle CEP Servers 6 Oracle CEP IDE for Eclipse and the Event Processing Network Part III Building the Oracle CEP Event Processing Network 7 Configuring JMS Adapters 8 Configuring HTTP Publish-Subscribe Server Adapters 9 Configuring Channels 10 Configuring Oracle CQL Processors 11 Configuring EPL Processors 12 Configuring Caching 13 Configuring Event Record and Playback Part IV Extending the Oracle CEP Event Processing Network 14 Configuring Custom Adapters 15 Configuring Custom Event Beans 16 Configuring Custom Spring Beans 17 Configuring Web Services 18 Configuring Applications With Data Cartridges 19 Extending Component Configuration Part V Developing Applications for High Availability 20 Understanding High Availability 21 Configuring High Availability Part VI Developing Applications for Scalability 22 Understanding Scalability 23 Configuring Scalability Part VII Assembly, Deployment, and Testing 24 Assembling and Deploying Oracle CEP Applications 25 Testing Applications With the Load Generator and csvgen Adapter 26 Testing Applications With the Event Inspector 27 Performance Tuning Part VIII Oracle CEP Reference A Additional Information about Spring and OSGi B Oracle CEP Schemas C Schema Reference: EPN Assembly spring-wlevs-v11_1_1_6.xsd D Schema Reference: Component Configuration wlevs_application_config.xsd E Schema Reference: Deployment deployment.xsd F Schema Reference: Server Configuration wlevs_server_config.xsd G Schema Reference: Message Catalog msgcat.dtd H Schema Reference: Locale Message Catalog l10n_msgcat.dtd I Oracle CEP Metadata Annotation Reference J Oracle CEP IDE for Eclipse Tutorial Index Copyright PK_%''PKz\EOEBPS/content.opf"s݌ Oracle® Fusion Middleware Developer's Guide for Oracle Complex Event Processing for Eclipse, 11g Release 1 (11.1.1.6.3) en-US E14301-10 Oracle Corporation Oracle Corporation Oracle® Fusion Middleware Developer's Guide for Oracle Complex Event Processing for Eclipse, 11g Release 1 (11.1.1.6.3) 2012-08-03T11:20:05Z Describes how to use the Oracle Complex Event Processing Eclipse-based IDE to create and deploy Oracle Complex Event Processing applications, including the Event Processing Network (EPN) configuration file. PKZ's"sPKz\EOEBPS/part_ha.htm  Developing Applications for High Availability

Part V

Developing Applications for High Availability

Part V contains the following chapters:

PK: PKz\EOEBPS/spring_tags.htm Schema Reference: EPN Assembly spring-wlevs-v11_1_1_6.xsd

C Schema Reference: EPN Assembly spring-wlevs-v11_1_1_6.xsd

This appendix provides a reference to elements of the spring-wlevs-v11_1_1_6.xsd schema, the schema behind assembly XML files with which you declare the components that make up your Oracle Complex Event Processing (Oracle CEP) event processing networks (EPNs).

C.1 Overview of the Oracle CEP Application Assembly Elements

Oracle CEP provides a number of application assembly elements 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.

C.1.2 Example of an EPN Assembly File That Uses Oracle CEP Elements

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

<?xwml 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-v11_1_1_6.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:channel id="helloworldInstream" >
        <wlevs:listener ref="helloworldProcessor"/>
        <wlevs:source ref="helloworldAdapter"/>
    </wlevs:channel>
    <wlevs:channel id="helloworldOutstream" advertise="true">
        <wlevs:listener>
            <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
        </wlevs:listener>
        <wlevs:source ref="helloworldProcessor"/>
    </wlevs:channel>
</beans>

C.2 wlevs:adapter

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

C.2.1 Child Elements

The wlevs:adapter application assembly element supports the following child elements:

C.2.2 Attributes

Table C-1 lists the attributes of the wlevs:adapter application assembly element.

Table C-1 Attributes of the wlevs:adapter Application Assembly Element

AttributeDescriptionData TypeRequired?

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


C.2.3 Example

The following example shows how to use the wlevs:adapter element 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.

C.3 wlevs:application-timestamped

Use this element to specify if an wlevs:channel is application timestamped, that is, if the application is responsible for assigning a timestamp to each event, using any time domain.

Otherwise, wlevs:channel is system timestamped, that is, the Oracle CEP server is responsible for assigning a timestamp to each event using System.nanoTime.

C.3.1 Child Elements

The wlevs:application-timestamped application assembly element supports the following child elements.

  • wlevs:expression—Specifies an expression to be used as an application timestamp for event processing.

C.3.2 Attributes

Table C-2 lists the attributes of the wlevs:application-timestamped application assembly element.

Table C-2 Attributes of the wlevs:application-timestamped Application Assembly Element

AttributeDescriptionData TypeRequired?

is-total-order

Indicates if the application time published is always strictly greater than the last value used.

Valid values are true or false. Default: false.

For more information, see "Time" in the Oracle Fusion Middleware CQL Language Reference for Oracle Complex Event Processing.

Boolean

No.


C.3.3 Example

The following example shows how to use the wlevs:application-timestamped element in the EPN assembly file to specify an implicitly application timestamped channel:

<wlevs:channel id="fxMarketAmerOut" >
    <wlevs:application-timestamped>
    </wlevs:application-timestamped>
</wlevs:channel>

In the example, the application handles event timestamps internally.

The following example shows how to use wlevs:application-timestamped element in the EPN assembly file to specify an explicitly application timestamped channel by specifying the wlevs:expression element.

<wlevs:channel id="fxMarketAmerOut" >
    <wlevs:application-timestamped>
        <wlevs:expression>mytime+10</wlevs:expression>
    </wlevs:application-timestamped>
</wlevs:channel>

In the example, the wlevs:expression element defines the arithmetic expression used to assign a timestamp to each event.

C.4 wlevs:cache

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

C.4.1 Child Elements

The wlevs:cache application assembly element supports the following child elements.

  • wlevs:caching-system—Specifies the caching system to which this cache belongs.


    Note:

    This child element is different from the wlevs:caching-system element used to declare a caching system. The child element of the wlevs:cache element takes a single attribute, ref, that references the id attribute of a declared caching system.


  • wlevs:cache-loader—Specifies the cache loader for this cache.

  • wlevs:cache-store—Specifies a cache store for this cache.

  • wlevs:cache-listener—Specifies a listener for this cache, or a component to which the cache sends events.

C.4.2 Attributes

Table C-3 lists the attributes of the wlevs:cache application assembly element.

Table C-3 Attributes of the wlevs:cache Application Assembly Element

AttributeDescriptionData TypeRequired?

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 Oracle CQL or 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.


C.4.3 Example

The following example shows how to use the wlevs:cache element 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.

C.5 wlevs:cache-listener

Use this element 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 element is always a child of wlevs:cache.

C.5.1 Attributes

Table C-4 lists the attributes of the wlevs:cache-listener application assembly element.

Table C-4 Attributes of the wlevs:cache-listener Application Assembly Element

AttributeDescriptionData TypeRequired?

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.


C.5.2 Example

The following example shows how to use the wlevs:cache-listener element 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.

C.6 wlevs:cache-loader

spring-wlevs-v11_1_1_6.xsdSpecifies the Spring bean that implements an object that loads data into a cache.

This element is always a child of wlevs:cache.

C.6.1 Attributes

Table C-5 lists the attributes of the wlevs:cache-loader application assembly element.

Table C-5 Attributes of the wlevs:cache-loader Application Assembly Element

AttributeDescriptionData TypeRequired?

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.


C.6.2 Example

The following example shows how to use the wlevs:cache-loader element 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.

C.7 wlevs:cache-source

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

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

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

C.7.1 Attributes

Table C-6 lists the attributes of the wlevs:cache-source application assembly element.

Table C-6 Attributes of the wlevs:cache-source Application Assembly Element

AttributeDescriptionData TypeRequired?

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.


C.7.2 Example

The following example shows how to use the wlevs:cache-source element 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:channel 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 channel as usual; however, the Oracle CQL or 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.

C.8 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 element is always a child of wlevs:cache.

C.8.1 Attributes

Table C-7 lists the attributes of the wlevs:cache-store application assembly element.

Table C-7 Attributes of the wlevs:cache-store Application Assembly Element

AttributeDescriptionData TypeRequired?

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.


C.8.2 Example

The following example shows how to use the wlevs:cache-store element 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.

C.9 wlevs:caching-system

Specifies the caching system used by the application.

C.9.1 Child Elements

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

C.9.2 Attributes

Table C-8 lists the attributes of the wlevs:caching-system application assembly element.

Table C-8 Attributes of the wlevs:caching-system Application Assembly Element

AttributeDescriptionData TypeRequired?

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:

<wlevs:caching-system id="myCachingSystem" provider=coherence" />

Typically this attribute corresponds to the provider-name attribute of a <factory> Spring element 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 the Oracle CEP native 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 the Oracle CEP native caching 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 the Oracle CEP native caching implementation for local single-JVM caches; this implementation uses an in-memory store.

String

No


C.9.3 Example

The following example shows the simplest use of the wlevs:caching-system element 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.

C.10 wlevs:channel

Use this element to declare a channel to the Spring application context.

By default, channels assume that events are system timestamped. To configure application timestamped events, see child element wlevs:application-timestamped.

C.10.1 Child Elements

The wlevs:channel application assembly element supports the following child elements:

C.10.2 Attributes

Table C-9 lists the attributes of the wlevs:channel application assembly element.

Table C-9 Attributes of the wlevs:channel Application Assembly Element

AttributeDescriptionData TypeRequired?

advertise

Advertises this service in the OSGi registry.

Valid values are true and false. Default value is false.

Boolean

No.

batching

Specifies whether batching of events should be enabled for the event channel.

Valid values are true and false. Default value is false.

For more information, see Section 9.1.6, "Batch Processing Channels".

Boolean

No.

event-type

Specifies the type of events that are allowed to pass through the event channel.

String

Yes.

id

Unique identifier for this component.

This identifier must correspond to the <name> element in the XML configuration file for this channel, if one exists.

String

Yes.

is-relation

Specifies the kind of events that are allowed to pass through the event channel. Two kind of events are supported: streams and relations. Streams are append-only. Relations support insert, delete, and updates.

The default value for this attribute 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 element (wlevs:adapter, wlevs:channel, or wlevs:processor) that defines the listening component.

String

No.

max-size

Specifies the maximum size of the FIFO buffer for this channel as max-size number of events.

When max-size = 0, the channel synchronously passes-through events.

When max-size > 0, the channel processes events asynchronously, buffering events by the requested size.

If max-threads is zero, then max-size is zero.

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

When max-threads = 0, the channel acts as a pass-through. Event ordering is preserved.

When max-threads > 0, the channel acts as classic blocking queue, where upstream components are producers of events and the downstream components are the consumers of events. The queue size is defined by the configuration max-size. There will be up to max-threads number of threads consuming events from the queue. Event ordering is non-deterministic.

You can change max-threads from 0 to a positive integer (that is, from a pass through to multiple threads) without redeploying. However, if you change max-threads from a positive integer to 0 (that is, from multiple threads to a pass through), then you must redeploy your application.

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.

primary-key

Specifies the primary key of a relation, as a list of event property names, separated by "," or white-spaces.

For more information, see Section 9.1.2.2, "Channels as Relations".

String

No.

provider

Specifies the streaming provider.

Valid values are:

  • oracle.channel

Default value is oracle.channel, which is the out-of-the-box streaming provider.

String

No.

source

Specifies the component from which the channel sources events.

Set this attribute to the value of the id attribute of the element (wlevs:adapter, wlevs:channel, or wlevs:processor) that defines the source component.

String

No.


C.10.3 Example

The following example shows how to use the wlevs:channel element in the EPN assembly file:

<wlevs:channel id="fxMarketAmerOut" />

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

C.11 wlevs:class

Use this element to specify the fully-qualified name of the JavaBean class to use as an event type implementation. This element must be a child of the wlevs:event-type element.

C.11.1 Example

The following example shows how to use the wlevs:class element in the EPN assembly file:

<wlevs:event-type-repository>
        <wlevs:event-type type-name="SimpleEvent">
            <wlevs:class>com.example.myapp.MyEventType</wlevs:class>
    </wlevs:event-type>
...
</wlevs:event-type-repository>

C.12 wlevs:event-bean

Use this element 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.

C.12.1 Child Elements

The wlevs:event-bean application assembly element supports the following child elements:

C.12.2 Attributes

Table C-10 lists the attributes of the wlevs:event-bean application assembly element.

Table C-10 Attributes of the wlevs:event-bean Application Assembly Element

AttributeDescriptionData TypeRequired?

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


C.12.3 Example

The following example shows how to use the wlevs:event-bean element 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.

C.13 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 Oracle CQL rules.

You can define an event type in the following ways:

  • Create a JavaBean class that represents your event type and specify its fully qualified classname using the wlevs:class child element.

  • Specify event type properties declaratively by using a wlevs:properties child element.

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

The best practice is to define your event type by using the wlevs:class child element because you can then reuse the specified JavaBean class, and you control exactly what the event type looks like.

C.13.1 Child Elements

The wlevs:event-type application assembly element supports the following child elements:

C.13.2 Attributes

Table C-11 lists the attributes of the wlevs:event-type application assembly element.

Table C-11 Attributes of the wlevs:event-type Application Assembly Element

AttributeDescriptionData TypeRequired?

id

Specifies the unique identifier for this event type.

If you do not specify this attribute, Oracle CEP automatically generates an identifier for you.

String

No.

type-name

Specifies the name of this event type.

This is the name you use whenever you reference the event type in the adapter, business POJO, or Oracle CQL or EPL rules.

String

Yes.


C.13.3 Example

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

<wlevs:event-type-repository>
        <wlevs:event-type type-name="SimpleEvent">
            <wlevs:properties>
                <wlevs:property name="msg" type="char" />
                <wlevs:property name="count" type="long" />
                <wlevs:property name="time_stamp" type="timestamp" />
        </wlevs:properties>
    </wlevs:event-type>
...
</wlevs:event-type-repository>

In the example, the name of the event type is SimpleEvent and its definition is determined by the wlevs:property elements. The values for the type attribute must conform to the com.bea.wlevs.ede.api.Type class.

For more information, see Section 2.1.3, "Event Type Data Types".

C.14 wlevs:event-type-repository

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

This element does not have any attributes.

C.14.1 Child Elements

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

C.14.2 Example

The following example shows how to use the wlevs:event-type-repository element 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 element groups a single wlevs:event-type element to declare a single event type: HelloWorldEvent. See Section C.13, "wlevs:event-type" for additional details.

C.15 wlevs:expression

Use this element to specify an arithmetic expression in wlevs:application-timestamped to be used as an application timestamp for event processing.

For more information, see "arith_expr" in the Oracle Fusion Middleware CQL Language Reference for Oracle Complex Event Processing.

C.15.1 Example

The following example shows how to use wlevs:expression element in the EPN assembly file to specify an explicitly application timestamped channel.

<wlevs:channel id="fxMarketAmerOut" >
    <wlevs:application-timestamped>
        <wlevs:expression>mytime + 10</wlevs:expression>
    </wlevs:application-timestamped>
</wlevs:channel>

In the example, the wlevs:expression element defines the arithmetic expression used to assign a timestamp to each event.

C.16 wlevs:factory

Use this element to register a factory class as a service. Use of this element 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 element does not allow you to specify service properties. If you need to specify service properties, then you must use the Spring- OSGi osgi:service element instead.

This element does not have any child elements.

C.16.1 Attributes

Table C-12 lists the attributes of the wlevs:factory application assembly element.

Table C-12 Attributes of the wlevs:factory Application Assembly Element

AttributeDescriptionData TypeRequired?

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.


C.16.2 Example

The following example shows how to use the wlevs:factory element 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.

C.17 wlevs:function

Use this element to specify a bean that contains user-defined functions for a processor. Oracle CEP supports both single-row and aggregate functions.

This element always has a standard Spring bean element either as a child or as a reference that specifies the Spring bean that implements the user-defined function.

For a single-row function for an Oracle CQL processor, you may specify one method on the implementing class as the function using the exec-method attribute. In this case, the method must be public and must be uniquely identifiable by its name (that is, the method cannot have been overridden). You may define an alias for the exec-method name using the function-name attribute. In the Oracle CQL query, you may call only the exec-method (either by its name or the function-name alias).

For a single-row function on an EPL processor, you may define an alias for the implementing class name using the function-name attribute. The exec-method name is not applicable in this case. In the EPL query, you may call any public or static method on the implementing class using either the implementing class name or the function-name alias.

For an aggregate function on either an Oracle CQL or EPL processor, the Spring bean must implement the following interfaces from the com.bea.wlevs.processor package:

  • AggregationFunctionFactory

  • AggregationFunction

For an aggregate function, the exec-method attribute is not applicable on both an Oracle CQL processor and an EPL processor.

For more information, see:

C.17.1 Attributes

Table C-13 lists the attributes of the wlevs:function application assembly element.

Table C-13 Attributes of the wlevs:function Application Assembly Element

AttributeDescriptionData TypeRequired?

exec-method

For a user-defined single-row function on an Oracle CQL processor, this element specifies the method name of the Spring bean that implements the function. In this case, the method must be public and must be uniquely identifiable by its name (that is, the method cannot have been overridden).

For a user-defined single-row or aggregate function on an EPL processor or a user-defined aggregate function on an Oracle CQL processor, this attribute is not applicable.

String

No.

function-name

For a user-defined single-row function on an Oracle CQL processor, use this attribute to define an alias for the exec-method name. You can then use the function-name in your Oracle CQL query instead of the exec-name.

For a user-defined single-row function on an EPL processor, use this attribute to define an alias for the implementing Spring bean class name. You can then use the function-name in your EPL query instead of the Spring bean class name and still invoke any public or static method that the Spring bean class implements.

For a user-defined aggregate function on an Oracle CQL or EPL processor, use this attribute to define an alias for the implementing Spring bean class name. You can then use the function-name in your EPL query instead of the Spring bean class name.

The default value is the Spring bean name.

String

No.

ref

Specifies the Spring bean that implements the function.

Set this attribute to the value of the id attribute of the Spring bean.

This is an alternative to making the Spring bean element a child of the wlevs:function element.

String

No.


C.17.2 Example

The following examples show how to use the wlevs:function element and its attributes on both Oracle CQL and EPL processors:

C.17.2.1 Single-Row User-Defined Function on an Oracle CQL Processor

Example C-1 shows how you implement a single-row user-defined the function for an Oracle CQL processor.

Example C-1 Single-Row User Defined Function Implementation Class

package com.bea.wlevs.example.function;

public class MyMod {
    public Object execute(int arg0, int arg1) {
        return new Integer(arg0 % arg1);
    }
}

Example C-2 shows how to use the wlevs:function to define a single-row function on an Oracle CQL processor in the EPN assembly file.

Example C-2 Single-Row User Defined Function for an Oracle CQL Processor

<wlevs:processor id="testProcessor">
    <wlevs:listener ref="providerCache"/>
    <wlevs:listener ref="outputCache"/>
    <wlevs:cache-source ref="testCache"/>
    <wlevs:function function-name="mymod" exec-method=”execute” />
        <bean class="com.bea.wlevs.example.function.MyMod"/>
    </wlevs:function>
</wlevs:processor>

Example C-3 shows how you invoke the function in an Oracle CQL query.

Example C-3 Invoking the Single-Row User-Defined Function on an Oracle CQL Processor

...
<view id="v1" schema="c1 c2 c3 c4"><![CDATA[ 
    select
        mymod(c1, 100), c2, c3, c4 
    from 
        S1
]]></view>
...
<query id="q1"><![CDATA[
    select * from v1 [partition by c1 rows 1] where c4 - c3 = 2.3 
]]></query>
...

C.17.2.2 Single-Row User-Defined Function on an EPL Processor

Example C-4 shows how you implement a single-row user-defined the function for an EPL processor.

Example C-4 Single-Row User Defined Function Implementation Class

package com.bea.wlevs.example.function;

public class LegacyMathBean {
    public Object square(Object[] args) {
    ...
    }
    public Object cube(Object[] args) {
    ...
    }
}

Example C-5 shows how to use the wlevs:function to define a single-row function for an EPL processor in the EPN assembly file.

Example C-6 shows how you invoke the function in an EPL query.

Example C-6 Invoking the Single-Row User-Defined Function on an EPL Processor

<rule><![CDATA[ 
    select math.square(inputValue) ...
]]></rule>

C.17.2.3 Aggregate User-Defined Function on an Oracle CQL Processor

Example C-7 shows how to implement a user-defined aggregate function for an Oracle CQL processor.

Example C-7 Aggregate User Defined Function Implementation Class

package com.bea.wlevs.test.functions;
 
import com.bea.wlevs.processor.AggregationFunction;
import com.bea.wlevs.processor.AggregationFunctionFactory;
 
public class Variance implements AggregationFunctionFactory, AggregationFunction {
 
    private int count;
    private float sum;
    private float sumSquare;
 
    public Class<?>[] getArgumentTypes() {
        return new Class<?>[] {Integer.class};
    }
 
    public Class<?> getReturnType() {
        return Float.class;
    }
 
    public AggregationFunction newAggregationFunction() {
        return new Variance();
    }
 
    public void releaseAggregationFunction(AggregationFunction function) {
    }
 
    public Object handleMinus(Object[] params) {
        if (params != null && params.length == 1) {
            Integer param = (Integer) params[0];
            count--;
            sum -= param;
            sumSquare -= (param * param);
        }
        
        if (count == 0) {
            return null;
        } else {
            return getVariance();
        }
    }
 
    public Object handlePlus(Object[] params) {
        if (params != null && params.length == 1) {
            Integer param = (Integer) params[0];
            count++;
            sum += param;
            sumSquare += (param * param);
        }
        
        if (count == 0) {
            return null;
        } else {
            return getVariance();
        }
    }
 
    public Float getVariance() {
        float avg = sum / (float) count;
        float avgSqr = avg * avg;
        float var = sumSquare / (float)count - avgSqr;
        return var;
    }
 
    public void initialize() {
        count = 0;
        sum = 0.0F;
        sumSquare = 0.0F;
    }
 
}

Example C-8 shows how to use the wlevs:function to define an aggregate function on an Oracle CQL processor in the EPN assembly file.

Example C-8 Aggregate User Defined Function for an Oracle CQL Processor

  <wlevs:processor id="testProcessor">
     <wlevs:listener ref="providerCache"/>
     <wlevs:listener ref="outputCache"/>
     <wlevs:cache-source ref="testCache"/>
     <wlevs:function function-name="var">
       <bean class="com.bea.wlevs.test.functions.Variance"/>
     </wlevs:function>
   </wlevs:processor>

Example C-9 shows how you invoke the function in an Oracle CQL query.

Example C-9 Invoking the Aggregate User-Defined Function on an Oracle CQL Processor

...
<query id="uda6"><![CDATA[ 
    select var(c2) from S4[range 3] 
]]></query>
...

C.17.2.4 Aggregate User-Defined Function on an EPL Processor

Example C-10 shows how to implement a user-defined aggregate function for an EPL processor.

Example C-10 Aggregate User Defined Function Implementation Class

package com.bea.wlevs.test.functions;
 
import com.bea.wlevs.processor.AggregationFunction;
import com.bea.wlevs.processor.AggregationFunctionFactory;
 
public class Variance implements AggregationFunctionFactory, AggregationFunction {
 
    private int count;
    private float sum;
    private float sumSquare;
 
    public Class<?>[] getArgumentTypes() {
        return new Class<?>[] {Integer.class};
    }
 
    public Class<?> getReturnType() {
        return Float.class;
    }
 
    public AggregationFunction newAggregationFunction() {
        return new Variance();
    }
 
    public void releaseAggregationFunction(AggregationFunction function) {
    }
 
    public Object handleMinus(Object[] params) {
        if (params != null && params.length == 1) {
            Integer param = (Integer) params[0];
            count--;
            sum -= param;
            sumSquare -= (param * param);
        }
        
        if (count == 0) {
            return null;
        } else {
            return getVariance();
        }
    }
 
    public Object handlePlus(Object[] params) {
        if (params != null && params.length == 1) {
            Integer param = (Integer) params[0];
            count++;
            sum += param;
            sumSquare += (param * param);
        }
        
        if (count == 0) {
            return null;
        } else {
            return getVariance();
        }
    }
 
    public Float getVariance() {
        float avg = sum / (float) count;
        float avgSqr = avg * avg;
        float var = sumSquare / (float)count - avgSqr;
        return var;
    }
 
    public void initialize() {
        count = 0;
        sum = 0.0F;
        sumSquare = 0.0F;
    }
 
}

Example C-11 shows how to use the wlevs:function to define an aggregate function on an EPL processor in the EPN assembly file.

Example C-11 Aggregate User Defined Function for an EPL Processor

  <wlevs:processor id="testProcessor" provider="epl">
     <wlevs:listener ref="providerCache"/>
     <wlevs:listener ref="outputCache"/>
     <wlevs:cache-source ref="testCache"/>
     <wlevs:function function-name="var">
       <bean class="com.bea.wlevs.test.functions.Variance"/>
     </wlevs:function>
   </wlevs:processor>

Example C-12 shows how you invoke the function in an EPL query.

Example C-12 Invoking the Aggregate User-Defined Function on an EPL Processor

...
<rule><![CDATA[ 
    select var(c2) from S4
]]></rule>
...

C.17.2.5 Specifying the Implementation Class: Nested Bean or Reference

Example C-13 shows how to use the wlevs:function element with a nested bean element in the EPN assembly file.

Example C-13 User Defined Function Using Nested Bean Element

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

Example C-14 shows how to use the wlevs:function element and its ref attribute to reference a bean element defined outside of the wlevs:function element in the EPN assembly file.

Example C-14 User Defined Function Using Reference

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

C.18 wlevs:instance-property

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

For example, when you specify an wlevs:instance-property for a wlevs:event-bean, Oracle CEP will look for a corresponding setter method on the Java class you implement, not on the com.bea.wlevs.spring.EventBeanFactoryBean that instantiates your class. To specify a property on the factory, use wlevs:property

This element is used only as a child of wlevs:adapter, wlevs:event-bean, wlevs:processor, wlevs:channel, or wlevs:caching-system.

The wlevs:instance-property element is defined as the Spring propertyType type; for additional details of this Spring data type, the definition of the allowed child elements, and so on, see the http://www.springframework.org/schema/beans/spring-beans-2.0.xsd.

C.18.1 Child Elements

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

  • meta

  • bean

  • ref

  • idref

  • value

  • null

  • list

  • set

  • map

  • props

C.18.2 Attributes

Table C-14 lists the attributes of the wlevs:instance-property application assembly element.

Table C-14 Attributes of the wlevs:instance-property Application Assembly Element

AttributeDescriptionData TypeRequired?

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.


C.18.3 Example

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

<wlevs:event-bean id="pubsubCounterBeanRemote"
    class="com.oracle.cep.example.httppubsub.RemoteEventCounter">
    <wlevs:listener ref="pubsubRemote" />
    <wlevs:instance-property name="expectedEvents" value="4000" />
</wlevs:event-bean>

In the example, the event bean com.oracle.cep.example.httppubsub.RemoteEventCounter class provides an appropriate setter method:

...
    private int expectedEvents;
 
    public void setExpectedEvents(String expectedEvents) {
        this.expectedEvents = new Integer(expectedEvents).intValue();
    }
...

Note that the instance-property is of type String. Your setter method must convert this if necessary. In this example, the String is converted to an int value.

The name of the setter method must conform to JavaBean naming conventions. In this example, the setter name is setExpectedEvents and this corresponds to the wlevs:instance-property element name attribute value expectedEvents, according to JavaBean conventions. If the name attribute value is obj and the setter method name is setObject, Oracle CEP will throw an Invalid Property exception. In this case, the setter name should be setObj.

C.19 wlevs:listener

Specifies the component that listens to the component to which this element 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.


Caution:

Nested definitions are not eligible for dynamic configuration or monitoring.


This element is always a child of wlevs:adapter, wlevs:processor, wlevs:channel, or wlevs:caching-system.

C.19.1 Attributes

Table C-15 lists the attributes of the wlevs:listener application assembly element.

Table C-15 Attributes of the wlevs:listener Application Assembly Element

AttributeDescriptionData TypeRequired?

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.


C.19.2 Example

The following example shows how to use the wlevs:listener element 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:channel, or wlevs:processor element whose unique identifier is helloworldOutstream.

C.20 wlevs:metadata

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

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

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

The wlevs:metadata element is defined as the Spring mapType type; for additional details of this Spring data type, see the http://www.springframework.org/schema/beans/spring-beans-2.0.xsd.

C.20.1 Child Elements

The wlevs:metadata element can have one or more standard Spring entry child elements as defined in the http://www.springframework.org/schema/beans/spring-beans-2.0.xsd.

C.20.2 Attributes

Table C-16 lists the attributes of the wlevs:metadata application assembly element.

Table C-16 Attributes of the wlevs:metadata Application Assembly Element

AttributeDescriptionData TypeRequired?

key-type

The default fully qualified classname of a Java data type for nested entry elements.

You use this attribute only if you have nested entry elements.

String

No.


C.20.3 Example

The following example shows how to use the wlevs:metadata element 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 element groups together four standard Spring entry elements 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.

C.21 wlevs:processor

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

C.21.1 Child Elements

The wlevs:processor Spring element supports the following child elements:

C.21.2 Attributes

Table C-17 lists the attributes of the wlevs:processor application assembly element.

Table C-17 Attributes of the wlevs:processor Application Assembly Element

AttributeDescriptionData TypeRequired?

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 Oracle CQL or 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 Oracle Continuous Query Language (Oracle CQL) or Event Processor Language (EPL).

Valid values are:

  • epl

  • cql

The default value is cql.

String

No.

queryURL

Specifies a URL that points to an Oracle CQL or EPL rules definition file for this processor.

String.

No.


C.21.3 Example

The following example shows how to use the wlevs:processor element 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 Oracle CQL rules for this processor, the name element must contain the value spreader. This way Oracle CEP knows which Oracle CQL or EPL rules it must file for this particular processor.

C.22 wlevs:properties

Defines the list of properties for an event type. Use this element when you are defining an event type declaratively, such as for a type based on a tuple or java.util.Map. For an event type created from a JavaBean class, allow properties to be defined by accessor methods in the class.

C.22.1 Child Elements

The wlevs:properties application assembly element supports the following child elements:

C.22.2 Attributes

<cza href="#CHDIECEA">Table C-18 lists the attributes of the wlevs:event-type application assembly element.

Table C-18 Attributes of the wlevs:properties Application Assembly Element

AttributeDescriptionData TypeRequired?

type

Specifies the type that this event type should be created from. Allowable values are tuple and map; default is tuple.

If this attribute's value is map, then Oracle CEP will instantiate the event type as a java.util.Map instance. Otherwise, the type will be instantiated as a tuple.

String

No.


C.22.3 Example

The following example shows how to use the wlevs:properties element in the EPN assembly file:

<wlevs:event-type-repository>
        <wlevs:event-type type-name="SimpleEvent">
            <wlevs:properties>
                <wlevs:property name="msg" type="char" />
                <wlevs:property name="count" type="long" />
                <wlevs:property name="time_stamp" type="timestamp" />
        </wlevs:properties>
    </wlevs:event-type>
...
</wlevs:event-type-repository>

In the example, the name of the event type is SimpleEvent and its definition is determined by the wlevs:property elements. The values for the type attribute must conform to the com.bea.wlevs.ede.api.Type class.

For more information, see Section 2.1.3, "Event Type Data Types".

C.23 wlevs:property

Defines the property of an event type that you create declaratively, such as an event type based on a tuple or java.util.Map. You use this wlevs:property element as a child of the wlevs:properties element.

Note that this element is different from the wlevs:property element that is an extension of the Spring beans property element. This element must always be used as a child of the wlevs:properties element.

C.23.1 Attributes

Table C-19 lists the attributes of the wlevs:property application assembly element.

Table C-19 Attributes of the wlevs:property Application Assembly Element

AttributeDescriptionData TypeRequired?

name

Name of the event property.

String

Yes.

type

Type of the event property.

If this event type is defined as a tuple, then the type attribute value must be one of the OCEP native types defined by com.bea.wlevs.ede.api.Type. Those include bigint, boolean, byte, char, double, float, int, interval, object, sqlxml, timestamp, unknown, xmltype.

If this event type is defined as a map, then the type attribute value is the fully qualified name of a Java class that must be available in the class loader of the application that defines the event type. The string used as the Java class name must conform to the same rules as Class.forName(). In addition, Java primitives can be used (for example, int and float).

Finally, you can specify an array by appending the characters "[]" to the Java class name.

String

Yes.

length

If the property is of array type, this specifies the length of the array. If the type is not an array and length is specified, it will be ignored.

.

String

No.


C.23.2 Example

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

<wlevs:event-type-repository>
        <wlevs:event-type type-name="SimpleEvent">
            <wlevs:properties>
                <wlevs:property name="msg" type="char" />
                <wlevs:property name="count" type="long" />
                <wlevs:property name="time_stamp" type="timestamp" />
        </wlevs:properties>
    </wlevs:event-type>
...
</wlevs:event-type-repository>

In the example, the name of the event type is SimpleEvent and its definition is determined by the wlevs:property elements. The values for the type attribute must conform to the com.bea.wlevs.ede.api.Type class.

For more information, see Section 2.1.3, "Event Type Data Types".

C.24 wlevs:property

Specifies a custom property to apply to the event type.

For example, when you specify a wlevs:property for a wlevs:event-bean, Oracle CEP will look for a corresponding setter method on the com.bea.wlevs.spring.EventBeanFactoryBean that instantiates your Java class, not on the Java class you implement. To specify a property on your Java class, use wlevs:instance-property.

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

The wlevs:property element is defined as the Spring propertyType type; for additional details of this Spring data type, the definition of the allowed child elements, and so on, see the http://www.springframework.org/schema/beans/spring-beans-2.0.xsd.

C.24.1 Child Elements

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

  • meta

  • bean

  • ref

  • idref

  • value

  • null

  • list

  • set

  • map

  • props

C.24.2 Attributes

Table C-20 lists the attributes of the wlevs:property application assembly element.

Table C-20 Attributes of the wlevs:property Application Assembly Element

AttributeDescriptionData TypeRequired?

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.


C.24.3 Example

The following example shows how to use the wlevs:property element 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 element defines a custom property of the ForeignExchangeEvent called builderFactory. The property uses the standard Spring bean element to specify the Spring bean used as a factory to create ForeignExchangeEvents.

C.25 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.


Caution:

Nested definitions are not eligible for dynamic configuration or monitoring.


This element is a child of wlevs:channel or wlevs:processor.

C.25.1 Attributes

Table C-21 lists the attributes of the wlevs:source application assembly element.

Table C-21 Attributes of the wlevs:source Application Assembly Element

AttributeDescriptionData TypeRequired?

ref

Specifies the source of the channel to which this element 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.


C.25.2 Example

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

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

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

C.26 wlevs:table

Specifies a relational database table that supplies data to one or more processor components. The processor components in turn are associated with an Oracle CQL query that directly references the table.

C.26.1 Attributes

Table C-22 lists the attributes of the wlevs:table application assembly element.

Table C-22 Attributes of the wlevs:table Application Assembly Element

AttributeDescriptionData TypeRequired?

id

Unique identifier for this component.

This identifier must correspond to the <name> element in the XML configuration file for this table.

String

Yes.

event-type

The name of the event type associated with this table as defined in the event type repository.

String

Yes.

data-source

The name of the relational data source defined in the Oracle CEP server configuration file used to access this database table.

String

Yes.


C.26.2 Example

The following example shows how to use the wlevs:table element in the EPN assembly file:

<wlevs:table id="Stock" event-type="StockEvent" data-source="StockDs" />

<wlevs:processor id="proc">
    <wlevs:table-source ref="Stock" />
</wlevs:processor>

In this example, a wlevs:processor references the table using its wlevs:table-source element.

C.27 wlevs:table-source

Specifies a relational database table that supplies data to this processor component. The processor component in turn is associated with an Oracle CQL query that directly references the table.

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

C.27.1 Attributes

Table C-23 lists the attributes of the wlevs:table-source application assembly element.

Table C-23 Attributes of the wlevs:table-source Application Assembly Element

AttributeDescriptionData TypeRequired?

ref

Specifies the relational database table that is a source of data for the processor component.

Set this attribute to the value of the id attribute of a wlevs:table element.

String

Yes.


C.27.2 Example

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

<wlevs:table id="Stock" event-type="StockEvent" data-source="StockDs" />

<wlevs:processor id="proc">
    <wlevs:table-source ref="Stock" />
</wlevs:processor>
PKg]͞ccPKz\EOEBPS/processorcql.htm Configuring Oracle CQL Processors

10 Configuring Oracle CQL Processors

This chapter describes how to configure Oracle Continuous Query Language (CQL) processors for Oracle Complex Event Processing (Oracle CEP) event processing networks. It includes information on configuring the processor's data source and optimizing performance.


Note:

Oracle CQL replaces Event Processing Language (EPL) in Oracle CEP 11g Release 1 (11.1.1). Oracle CEP supports EPL for backwards compatibility. For more information, see Chapter 11, "Configuring EPL Processors".


10.1 Overview of Oracle CQL Processor Configuration

An Oracle CEP application contains one or more complex event processors, or processors for short. Each processor takes as input events from one or more adapters; these adapters in turn listen to data feeds that send a continuous stream of data from a source. The source could be anything, such as a financial data feed or the Oracle CEP load generator.

The main feature of an Oracle CQL processor is its associated Oracle Continuous Query Language (Oracle CQL) rules that select a subset of the incoming events to then pass on to the component that is listening to the processor. The listening component could be another processor, or the business object POJO that typically defines the end of the event processing network, and thus does something with the events, such as publish them to a client application. For more information on Oracle CQL, see the Oracle Fusion Middleware CQL Language Reference for Oracle Complex Event Processing.

For each Oracle CQL processor in your application, you must create a processor element in a component configuration file. In this processor element you specify the initial set of Oracle CQL rules of the processor and any optional processor configuration.

You can configure additional optional Oracle CQL processor features in the Oracle CQL processor EPN assembly file.

The component configuration file processor element's name element must match the EPN assembly file processor element's id attribute. For example, given the EPN assembly file processor element shown in Example 10-1, the corresponding component configuration file processor element is shown in Example 10-2.

Example 10-1 EPN Assembly File Oracle CQL Processor Id: proc

<wlevs:processor id="proc">
    <wlevs:table-source ref="Stock" />
</wlevs:processor>

Example 10-2 Component Configuration File Oracle CQL Processor Name: proc

<processor>
    <name>proc</name>
    <rules>
        <query id="q1"><![CDATA[
            SELECT ExchangeStream.symbol, ExchangeStream.price, Stock.exchange
            FROM   ExchangeStream [Now], Stock
            WHERE  ExchangeStream.symbol = Stock.symbol 
        ]]></query>
    </rules>
</procesor>

You can create a processor element in any of the following component configuration files:

  • The default Oracle CEP application configuration file (by default, META-INF/wlevs/config.xml).

  • A separate configuration file.

If your application has more than one processor, you can create a processor element for each of them in the default config.xml file, you can create separate XML files in META-INF/wlevs for each, or create a single XML file in META-INF/wlevs that contains the configuration for all processors, or even all components of your application (adapters, processors, and channels). Choose the method that best suits your development environment.

By default, Oracle CEP IDE for Eclipse creates one component configuration file and one EPN assembly file. When you create an Oracle CQL processor using Oracle CEP IDE for Eclipse, by default, the processor element is added to the default component configuration file META-INF/wlevs/config.xml file. Using Oracle CEP IDE for Eclipse, you can choose to create a new configuration file or use an existing configuration file at the time you create the Oracle CQL processor.

Component configuration files are deployed as part of the Oracle CEP application bundle. You can later update this configuration at runtime using Oracle CEP Visualizer, the wlevs.Admin utility, or manipulating the appropriate JMX Mbeans directly.

For more information, see:

For more information on Oracle CQL processor configuration, see:

10.1.1 Controlling Which Queries Output to a Downstream Channel

If you configure an Oracle CQL processor with more than one query, by default, all queries output their results to the downstream channel.

You can control which queries may output their results to a downstream channel using the channel selector element to specify a space delimited list of query names that may output their results on this channel.

You may configure a channel element with a selector before creating the queries in the upstream processor. In this case, you must specify query names that match the names in the selector.

For more information, see Section 9.1.5, "Controlling Which Queries Output to a Downstream Channel: selector".

10.2 Configuring an Oracle CQL Processor

You can configure a processor manually or by using the Oracle CEP IDE for Eclipse.

See Section B.2, "Component Configuration Schema wlevs_application_config.xsd" for the complete XSD Schema that describes the processor component configuration file.

See Section 10.6, "Example Oracle CQL Processor Configuration Files" for a complete example of an Oracle CQL processor component configuration file and assembly file.

This section describes the following topics:

10.2.1 How to Configure an Oracle CQL Processor Using Oracle CEP IDE for Eclipse

The most efficient and least error-prone way to create and edit a processor is to use the Oracle CEP IDE for Eclipse. Optionally, you can create and edit a processor manually (see Section 10.2.2, "How to Create an Oracle CQL Processor Component Configuration File Manually").

To configure an Oracle CQL processor using Oracle CEP IDE for Eclipse:

  1. Use Oracle CEP IDE for Eclipse to create a processor.

    See Section 6.4.1.3, "How to Create a Processor Node".

    When you use the EPN editor to create an Oracle CQL processor, Oracle CEP IDE for Eclipse prompts you to choose either the default component configuration file or a new component configuration file. For more information, see Chapter 6, "Oracle CEP IDE for Eclipse and the Event Processing Network".

  2. Right-click the processor node and select Go to Configuration Source.

    Oracle CEP IDE for Eclipse opens the appropriate component configuration file. The default processor component configuration is shown in Example 10-3.

    The default processor component configuration includes a name element and rules element.

    Use the rules element to group the child elements you create to contain the Oracle CQL statements this processor executes, including:

    • rule: contains Oracle CQL statements that register or create user-defined windows. The rule element id attribute must match the name of the window.

    • view: contains Oracle CQL view statements (the Oracle CQL equivalent of subqueries). The view element id attribute defines the name of the view.

    • query: contains Oracle CQL select statements. The query element id attribute defines the name of the query.

    The default processor component configuration includes a dummy query element with id Query.

    Example 10-3 Default Processor Component Configuration

    <processor>
        <name>proc</name>
        <rules>
            <query id="Query"><!-- <![CDATA[ select * from MyChannel [now] ]]> -->
            </query>
        </rules>
    </processor>
    
  3. Replace the dummy query element with the rule, view, and query elements you create to contain the Oracle CQL statements this processor executes.

    For more information, see "Introduction to Oracle CQL Queries, Views, and Joins" in the Oracle Fusion Middleware CQL Language Reference for Oracle Complex Event Processing.

  4. Select File > Save.

  5. Optionally, configure additional Oracle CQL processor features in the assembly file:

10.2.2 How to Create an Oracle CQL Processor Component Configuration File Manually

Although the most efficient and least error-prone way to create and edit a processor configuration is to use the Oracle CEP IDE for Eclipse (see Section 10.2.1, "How to Configure an Oracle CQL Processor Using Oracle CEP IDE for Eclipse"), alternatively, you can also create and maintain a processor configuration file manually.

This section describes the main steps to create the processor configuration file manually. For simplicity, it is assumed in the procedure that you are going to configure all processors in a single XML file, although you can also create separate files for each processor.

To create an Oracle CQL processor component configuration file manually:

  1. Design the set of Oracle CQL rules that the processor executes. These rules can be as simple as selecting all incoming events to restricting the set based on time, property values, and so on, as shown in the following:

    SELECT *
    FROM   TradeStream [Now]
    WHERE  price > 10000
    

    Oracle CQL is similar in many ways to Structure Query Language (SQL), the language used to query relational database tables, although the syntax between the two differs in many ways. The other big difference is that Oracle CQL queries take another dimension into account (time), and the processor executes the Oracle CQL continually, rather than SQL queries that are static.

    For more information, see "Introduction to Oracle CQL Queries, Views, and Joins" in the Oracle Fusion Middleware CQL Language Reference for Oracle Complex Event Processing.

  2. Create the processor configuration XML file that will contain the Oracle CQL rules you designed in the preceding step, as well as other optional features, for each processor in your application.

    You can name this XML file anything you want, provided it ends with the .xml extension.

    The root element of the processor configuration file is config, with namespace definitions shown in the next step.

  3. For each processor in your application, add a processor child element of config.

    Uniquely identify each processor with the name child element. This name must be the same as the value of the id attribute in the wlevs:processor element of the EPN assembly file that defines the event processing network of your application. This is how Oracle CEP knows to which particular processor component in the EPN assembly file this processor configuration applies. See Section 4.3, "Creating EPN Assembly Files" for details.

    For example, if your application has two processors, the configuration file might initially look like:

    <?xml version="1.0" encoding="UTF-8"?>
    <n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application">
      <processor>
        <name>firstProcessor</name>
         ...
      </processor>
      <processor>
        <name>secondProcessor</name>
         ...
       </processor>
    </n1:config>
    

    In the example, the configuration file includes two processors called firstProcessor and secondProcessor. This means that the EPN assembly file must include at least two processor registrations with the same identifiers:

    <wlevs:processor id="firstProcessor" ...>
      ...
    </wlevs:processor>
    <wlevs:processor id="secondProcessor" ...>
      ...
    </wlevs:processor>
    

    Caution:

    Identifiers and names in XML files are case sensitive, so be sure you specify the same case when referencing the component's identifier in the EPN assembly file.


  4. Add a rules child element to each processor element.

    Use the rules element to group the child elements you create to contain the Oracle CQL statements this processor executes, including:

    • rule: contains Oracle CQL statements that register or create user-defined windows. The rule element id attribute must match the name of the window.

    • view: contains Oracle CQL view statements (the Oracle CQL equivalent of subqueries). The view element id attribute defines the name of the view.

    • query: contains Oracle CQL select statements. The query element id attribute defines the name of the query.

    Use the required id attribute of the view and query elements to uniquely identify each rule. Use the XML CDATA type to input the actual Oracle CQL rule. For example:

    <?xml version="1.0" encoding="UTF-8"?>
    <n1:config
        xsi:schemaLocation="http://www.bea.com/ns/wlevs/config/application wlevs_application_config.xsd"
        xmlns:n1="http://www.bea.com/ns/wlevs/config/application"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <processor>
            <name>proc</name>
            <rules>
                <view id="lastEvents" schema="cusip bid srcId bidQty"><![CDATA[ 
                    select mod(price) 
                    from filteredStream[partition by srcId, cusip rows 1]
                ]]></view>
                <query id="q1"><![CDATA[
                    SELECT *
                    FROM   lastEvents [Now]
                    WHERE  price > 10000
                ]]></query>
            </rules>
        </processor>
    </n1:config>]]></query>
    
  5. Save and close the file.

  6. Optionally, configure additional Oracle CQL processor features in the assembly file:

10.3 Configuring an Oracle CQL Processor Table Source

You can configure an Oracle CQL processor to access a table in a relational database as an event stream in which each row in the table is represented as a tuple.

In this section, assume that you create the table you want to access using the SQL statement that Example 10-4 shows.

Example 10-4 Table Create SQL Statement

create table Stock (symbol varchar(16), exchange varchar(16));

After configuration, you can define Oracle CQL queries that access the Stock table as if it was just another event stream. In the following example, the query joins one event stream ExchangeStream with the Stock table:

Example 10-5 Oracle CQL Query on Relational Database Table Stock

SELECT ExchangeStream.symbol, ExchangeStream.price, Stock.exchange
FROM   ExchangeStream [Now], Stock
WHERE  ExchangeStream.symbol = Stock.symbol

Note:

Because changes in the table source are not coordinated in time with stream data, you may only join the table source to an event stream using a Now window and you may only join to a single database table.

To integrate arbitrarily complex SQL queries and multiple tables with your Oracle CQL queries, consider using the Oracle JDBC data cartridge instead.

For more information, see "Understanding the Oracle JDBC Data Cartridge" in the Oracle Fusion Middleware CQL Language Reference for Oracle Complex Event Processing.


10.3.1 How to Configure an Oracle CQL Processor Table Source Using Oracle CEP IDE for Eclipse

The most efficient and least error-prone way to configure an Oracle CQL processor to access a relational database table is to use the Oracle CEP IDE for Eclipse.

To configure an Oracle CQL processor table source using Oracle CEP IDE for Eclipse:

  1. Create a data source for the database that contains the table you want to use.

    Example 10-6 shows an example Oracle CEP server config.xml file with data source StockDS.

    Example 10-6 Oracle CEP Server config.xml File With Data Source StockDS

    <?xml version="1.0" encoding="UTF-8"?>
    <n1:config xsi:schemaLocation="http://www.bea.com/ns/wlevs/config/server wlevs_server_config.xsd" 
        xmlns:n1="http://www.bea.com/ns/wlevs/config/server" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <domain>
         <name>ocep_domain</name>
      </domain>
    
    ...
    
      <data-source>
        <name>StockDs</name>
        <connection-pool-params>
          <initial-capacity>1</initial-capacity>
          <max-capacity>10</max-capacity>     
        </connection-pool-params>
        <driver-params>
          <url>jdbc:derby:</url>
          <driver-name>org.apache.derby.jdbc.EmbeddedDriver</driver-name>
          <properties>
            <element>
              <name>databaseName</name>
              <value>db</value>
            </element>
            <element>
              <name>create</name>
              <value>true</value>
            </element>
          </properties>
        </driver-params>
        <data-source-params>
          <jndi-names>
            <element>StockDs</element>
          </jndi-names>
          <global-transactions-protocol>None</global-transactions-protocol>
        </data-source-params>
      </data-source>
    
    ...
    
    </n1:config>
    

    For more information, see "Configuring Access to a Relational Database" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

  2. Use Oracle CEP IDE for Eclipse to create a table node.

    See Section 6.4.1.1, "How to Create a Basic Node".

  3. Use Oracle CEP IDE for Eclipse to create an Oracle CQL processor.

    See Section 6.4.1.3, "How to Create a Processor Node".

  4. Connect the table node to the Oracle CQL processor node.

    See Section 6.4.2.1, "How to Connect Nodes".

    The EPN Editor adds a wlevs:table-source element to the target processor node that references the source table.

  5. Right-click the table node in your EPN and select Go to Assembly Source.

    Oracle CEP IDE for Eclipse opens the EPN assembly file for this table node.

  6. Edit the table element as Example 10-7 shows and configure the table element attributes as shown in Table 10-1.

    Example 10-7 EPN Assembly File table Element

    <wlevs:table id="Stock" event-type="StockEvent" data-source="StockDs" />
    

    Table 10-1 EPN Assembly File table Element Attributes

    AttributeDescription

    id

    The name of the table source. Subsequent references to this table source use this name.

    event-type

    The type-name you specify for the table event-type you create in step 9.

    data-source

    The data-source name you specified in the Oracle CEP server config.xml file in step 1.


  7. Right-click the Oracle CQL processor node connected to the table in your EPN and select Go to Assembly Source.

    Oracle CEP IDE for Eclipse opens the EPN assembly file for this Oracle CQL processor.

  8. Edit the Oracle CQL processor element's table-source child element as Example 10-8 shows.

    Set the ref attribute to the id of the table element you specified in step 6.

    Example 10-8 EPN Assembly File table-source Element

    <wlevs:processor id="proc">
        <wlevs:table-source ref="Stock" />
    </wlevs:processor>
    
  9. Edit the EPN assembly file to update the event-type-repository element with a new event-type child element for the table as Example 10-9shows.

    Create a property child element for each column of the table you want to access and configure the property attributes as shown in Table 10-2.

    Example 10-9 EPN Assembly File event-type element for a Table

    <wlevs:event-type-repository>
        ...
        <wlevs:event-type type-name="StockEvent">
            <wlevs:properties>
                <wlevs:property name="symbol" type="char[]" length="16" />
                <wlevs:property name="exchange" type="char[]" length="16" />
            </wlevs:properties>
        </wlevs:event-type>
        ...
    </wlevs:event-type-repository>
    

    Table 10-2 EPN Assembly File event-type Element Property Attributes

    AttributeDescription

    name

    The name of the table column you want to access as specified in the SQL create table statement. You do not need to specify all columns.

    type

    The Oracle CEP Java type from Table 10-3 that corresponds to the column's SQL data type.

    In Example 10-4, the type value for column symbol is char[].

    length

    The column size as specified in the SQL create table statement.

    In Example 10-4, the length of column symbol is 16.


    Table 10-3 SQL Column Types and Oracle CEP Type Equivalents

    SQL TypeOracle CEP Java Typecom.bea.wlevs.ede.api.TypeDescription

    ARRAY

    [Ljava.lang.Object


    Array, of depth 1, of java.lang.Object.

    BIGINT

    java.math.BigInteger

    bigint

    An instance of java.math.BigInteger.

    BINARY

    byte[]


    Array, of depth 1, of byte.

    BIT

    java.lang.Boolean

    boolean

    An instance of java.lang.Boolean.

    BLOB

    byte[]


    Array, of depth 1, of byte.

    BOOLEAN

    java.lang.Boolean

    boolean

    An instance of java.lang.Boolean.

    CHAR

    java.lang.Character

    char

    An instance of java.lang.Character.

    CLOB

    byte[]


    Array, of depth 1, of byte.

    DATE

    java.sql.Date

    timestamp

    An instance of java.sql.Date.

    DECIMAL

    java.math.BigDecimal


    An instance of java.math.BigDecimal.

    BINARY_DOUBLEFoot 1  or DOUBLEFoot 2 

    java.lang.Double

    double

    An instance of java.lang.Double

    BINARY_FLOATFootref 1 or FLOATFootref 2

    java.lang.Double

    float

    An instance of java.lang.Double

    INTEGER

    java.lang.Integer

    int

    An instance of java.lang.Integer.

    JAVA_OBJECT

    java.lang.Object

    object

    An instance of java.lang.Object.

    LONGNVARCHAR

    char[]

    char

    Array, of depth 1, of char.

    LONGVARBINARY

    byte[]


    Array, of depth 1, of byte.

    LONGVARCHAR

    char[]

    char

    Array, of depth 1, of char.

    NCHAR

    char[]

    char

    Array, of depth 1, of char.

    NCLOB

    byte[]


    Array, of depth 1, of byte.

    NUMERIC

    java.math.BigDecimal


    An instance of java.math.BigDecimal.

    NVARCHAR

    char[]

    char

    Array, of depth 1, of char.

    OTHER

    java.lang.Object

    object

    An instance of java.lang.Object.

    REAL

    java.lang.Float

    float

    An instance of java.lang.Float

    SMALLINT

    java.lang.Integer

    int

    An instance of java.lang.Integer.

    SQLXML

    xmltype

    xmltype

    For more information on processing XMLTYPE data in Oracle CQL, see "SQL/XML (SQLX)" in the Oracle Fusion Middleware CQL Language Reference for Oracle Complex Event Processing.

    TIME

    java.sql.Time


    An instance of java.sql.Time.

    TIMESTAMP

    java.sql.Timestamp

    timestamp

    An instance of java.sql.Timestamp.

    TINYINT

    java.lang.Integer

    int

    An instance of java.lang.Integer.

    VARBINARY

    byte[]


    Array, of depth 1, of byte.

    VARCHAR

    char[]

    char

    Array, of depth 1, of char.


    Footnote 1 Oracle SQL.

    Footnote 2 Non-Oracle SQL.

    For more information on creating event types, see:

  10. Right-click the Oracle CQL processor node connected to the table in your EPN and select Go to Configuration Source.

    Oracle CEP IDE for Eclipse opens the component configuration file for this Oracle CQL processor.

  11. Edit the component configuration file to add Oracle CQL queries that use the table's event-type as shown in Example 10-10.

    Example 10-10 Oracle CQL Query Using Table Event Type StockEvent

    <processor>
        <name>proc</name>
        <rules>
            <query id="q1"><![CDATA[
                SELECT  ExchangeStream.symbol, ExchangeStream.price, Stock.exchange
                FROM    ExchangeStream [Now], Stock
                WHERE   ExchangeStream.symbol = Stock.symbol 
            ]]></query>
        </rules>
    </processor>
    

    Note:

    Because changes in the table source are not coordinated in time with stream data, you may only use a Now window. For more information, see "S[Now]" in the Oracle Fusion Middleware CQL Language Reference for Oracle Complex Event Processing.


10.4 Configuring an Oracle CQL Processor Cache Source

You can configure an Oracle CQL processor to access the Oracle CEP cache.

For more information, see:

10.5 Configuring an Oracle CQL Processor for Parallel Query Execution

For improved performance, you can enable a CQL query to execute in parallel rather than serially, as it does by default. When the CQL code supports it, you can configure a query so that it can process incoming events in parallel when multiple threads are available to the CQL processor.

You should enable parallel query execution only in cases where the relative order of the query output events is unimportant to the query's downstream client. For example, event ordering probably isn't important if your query is intended primarily to filter events, such as to deliver to clients a set of stock transactions involving a particular company, where the transaction sequence is irrelevant.

By default (without enabling parallel execution), queries process events from a channel serially. For events routed through a channel that uses a system timestamp, event order is the order in which events are received; through a channel that is application timestamped, event order is the order determined by a timestamp value included in the event. Relaxing the total order constraint allows the configured query to not consider event order for that query, processing events in parallel where possible.

10.5.1 Setting Up Parallel Query Execution Support

While specifying support for parallel query execution is at its core a simple configuration task, be sure to follow the other steps below so that you get the most out of the feature.

  • Use the ordering-constraint attribute to support parallel execution.

  • Make sure you have enough threads calling into the processor to meet your performance goals. The maximum amount of parallel query execution is constrained by the number of threads available to the CQL processor. For example, if an adapter upstream of the processor supports the number of threads you need and there is a channel between the adapter and the processor, try configuring the channel with a max-threads count of 0 so that it acts as a pass-through.

    If you don't want a pass-through, be sure to configure the query's upstream channel with a max-threads value greater than 1. (To make a max-threads value setting useful, you'll need to also set the max-size attribute to a value greater than 0.) For more information, see Chapter 9, "Configuring Channels".

  • Follow other guidelines related to setting the max-threads attribute value. For example, to make a max-threads value setting useful, you'll need to also set the max-size attribute to a value greater than 0.

  • Ensure, if necessary, that a bean receiving the query results is thread-aware, such as by using synchronized blocks. For example, you might need to do so if the bean's code builds a list from results received from queries executed on multiple threads.

10.5.2 Using the ordering-constraint Attribute

You enable parallel query execution by relaxing the default ordering constraint that ensures that events are processed serially. You do this by setting the ordering-constraint attribute on a query or view element.

In Example 10-11, the ordering-constraint attribute is set to UNORDERED so that the query will execute in parallel whenever possible:

Example 10-11 Query Configured to Allow Parallel Execution

<query id="myquery" ordering-constraint="UNORDERED">
    SELECT symbol FROM S WHERE price > 10
</query>

The ordering-constraint attribute supports the following three values:

  • ORDERED means that the order of output events (as implied by the order of input events) is important. The CQL engine will process events serially. This is the default behavior.

  • UNORDERED means that order of the output events is not important to the consumer of the output events. This gives the freedom to the CQLProcessor to process events in parallel on multiple threads. When possible, the query will execute in parallel on multiple threads to process the events.

  • PARTITION_ORDERED means that you're specifying that order of output events within a partition is to be preserved (as implied by the order of input events) while order of output events across different partitions is not important to the consumer of the output events. This relaxation provides some freedom to the CQL engine to process events across partitions in parallel (when possible) on multiple threads.

Use the PARTITION_ORDERED value when you want to specify that events conforming to a given partition are processed serially, but that order can be disregarded across partitions and events belonging to different partitions may be processed in parallel. When using the PARTITION_ORDERED value, you must also add the partition-expression attribute to specify which expression for partitioning should be the basis for relaxing the cross-partition ordering constraint.

In Example 10-12, the GROUP BY clause partitions the output based on symbol values. The partition-expression attribute specifies that events in a given subset of events corresponding to a particular symbol value should be handled serially. Across partitions, on the other hand, order can be disregarded.

Example 10-12 Query Configured to Allow Parallel Execution Across Partitions

<query id="myquery" ordering-constraint="PARTITION_ORDERED"
    partitioning-expression="symbol">
    SELECT
        COUNT(*) as c, symbol
    FROM
        S[RANGE 1 minute]
    GROUP BY
        symbol
</query>

10.5.3 Using partition-order-capacity with Partitioning Queries

In general, you'll probably see improved performance for queries by making more threads available and setting the ordering-constraint attribute so that they're able to execute in parallel when possible. As with most performance tuning techniques, a little trial and error with these settings should yield a combination that gets better results.

However, in some cases where your queries use partitioning -- and you've set the ordering-constraint attribute to PARTITION_ORDERED -- you might not see the amount of scaling you'd expect. For example, consider a case in which running with four threads doesn't improve performance very much over running with two threads. In such a case, you can try using the partition-order-capacity value to get the most out of CQL engine characteristics at work with queries that include partitions.

The partition-order-capacity value specifies the maximum amount of parallelism that will be permitted within a given processor instance when processing a PARTITION_ORDERED query. When available threads are handling events belonging to different partitions, the value sets a maximum number of threads that will be allowed to simultaneously run in the query.

As with other aspects of performance tuning, getting the most out of partition-order-capacity may take a bit of experimentation. When tuning with partition-order-capacity, a good starting point is to set it equal to the maximum number of threads you expect to have active in any CQL processor instance. In some cases (for example, at high data rates or with expensive processing downstream from the CQL processor), it may be helpful to set the partition-order-capacity value even higher than the available number of threads. However, you should only do this if performance testing confirms that it's helpful for a given application and load.

The partition-order-capacity value is set from one of four places, two of which are fallbacks when you don't explicitly set it yourself. These are, in order of precedence:

  1. The partition-order-capacity element set on a channel configuration. If you specify this on the input channel for a processor, it takes effect for any PARTITION_ORDERED queries in that processor. For more information, see Section D.67, "partition-order-capacity" in Appendix D, "Schema Reference: Component Configuration wlevs_application_config.xsd".

  2. The partition-order-capacity property in server configuration. This value will be used for all PARTITION_ORDERED queries running on the server unless the value is set on a channel. For more information, see Section F.29, "partition-order-capacity" in Appendix F, "Schema Reference: Server Configuration wlevs_server_config.xsd".

  3. The max-threads value set on a channel configuration. If you specify this on the input channel for a processor, it takes effect for any PARTITION_ORDERED queries in that processor

  4. A system default value (currently set to 4) is used if you don't specify either a partition-order-capacity value or max-threads value, or if the max-threads value is set to 0 (meaning it's a pass-through channel).

When using partition-order-capacity, keep in mind the following:

  • The partition-order-capacity value is only useful when you're setting the ordering-constraint attribute to PARTITION_ORDERED.

  • Increasing partition-order-capacity generally increases parallelism and scaling. For example, if your profiling reveals lock contention bottlenecks, you might find it helpful to increase partition-order-capacity to see if contention is reduced.

  • Setting partition-order-capacity even higher than the number of available threads can be helpful in some cases because of the particular way partitioning is done in the CQL processor.

  • There is some resource cost in memory used by specifying very high values.

  • Tuning this parameter is very dependent on details of the application and the input rate. Tuning by experimentation may be necessary to determine an optimal value.

10.5.4 Limitations

Think of parallel query execution as a performance enhancement feature that you specify support for so that the CQL processor can use it whenever possible. Not all queries can be executed in parallel. This includes queries using certain CQL language features.

For example, if your query uses some form of aggregation -- such as to find the maximum value from a range of values -- the CQL processor may not be able to fully execute the query in parallel2 (this is needed to guarantee the correct result considering the ordering constraint). Some query semantics in themselves also constrain the query to ordered processing. Such queries will be executed serially regardless of whether you specify support for parallel execution.

Also, the IStream, RStream and DStream operators maintain the state of their operand for processing, making it necessary for the CQL processor to synchronize threads in order to execute the query.

Note that the CQL processor always respects the semantic intention of your query. In cases where the ordering-constraint attribute would change this intention, the attribute is coerced to a value that keeps the intention intact.

If you're using the partitioning-expression attribute, keep in mind that the attribute supports a single expression only. Entering multiple property names for the value is not supported.

10.6 Example Oracle CQL Processor Configuration Files

This section provides example Oracle CQL processor configuration files, including:

10.6.1 Oracle CQL Processor Component Configuration File

The following example shows a component configuration file for an Oracle CQL processor.

<?xml version="1.0" encoding="UTF-8"?>
<n1:config
    xsi:schemaLocation="http://www.bea.com/ns/wlevs/config/application wlevs_application_config.xsd"
    xmlns:n1="http://www.bea.com/ns/wlevs/config/application"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <processor>
        <name>proc</name>
        <rules>
            <view id="lastEvents"><![CDATA[ 
                select mod(price) 
                from filteredStream[partition by srcId, cusip rows 1]
            ]]></view>
            <query id="q1"><![CDATA[
                SELECT *
                FROM   lastEvents
                WHERE  price > 10000
            ]]></query>
        </rules>
    </processor>
</n1:config>

In the example, the name element specifies that the processor for which the Oracle CQL rules are being configured is called proc. This in turn implies that the EPN assembly file that defines your application must include a corresponding wlevs:processor element with an id attribute value of proc to link these Oracle CQL rules with an actual proc processor instance (see Section 10.6.2, "Oracle CQL Processor EPN Assembly File").

This Oracle CQL processor component configuration file also defines a view element to specify an Oracle CQL view statement (the Oracle CQL equivalent of a subquery). The results of the view's select are not output to a down-stream channel.

Finally, this Oracle CQL processor component configuration file defines a query element to specify an Oracle CQL query statement. The query statement selects from the view. By default, the results of a query are output to a down-stream channel. You can control this behavior in the channel configuration using a selector element. For more information, see:

10.6.2 Oracle CQL Processor EPN Assembly File

The following example shows an EPN assembly file for an Oracle CQL processor.

<?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-v11_1_1_6.xsd">

    <wlevs:event-type-repository>
        <wlevs:event-type type-name="ExchangeEvent">
            <wlevs:properties>
                <wlevs:property name="symbol" type="char[]" length="16" />
                <wlevs:property name="price" type="java.lang.Double" />
            </wlevs:properties>
        </wlevs:event-type>
        <wlevs:event-type type-name="StockExchangeEvent">
            <wlevs:properties>
                <wlevs:property name="symbol" type="char[]" length="16" />
                <wlevs:property name="price" type="java.lang.Double" />
                <wlevs:property name="exchange" type="char[]" length="16" />
            </wlevs:properties>
        </wlevs:event-type>
        <wlevs:event-type type-name="StockEvent">
            <wlevs:properties>
                <wlevs:property name="symbol" type="char[]" length="16" />
                <wlevs:property name="exchange" type="char[]" length="16" />
            </wlevs:properties>
        </wlevs:event-type>
    </wlevs:event-type-repository>

    <!-- Assemble EPN (event processing network) -->
    <wlevs:adapter id="adapter" class="com.bea.wlevs.example.db.ExchangeAdapter" >
        <wlevs:listener ref="ExchangeStream"/>
    </wlevs:adapter>

    <wlevs:channel id="ExchangeStream" event-type="ExchangeEvent" >
        <wlevs:listener ref="proc"/>
    </wlevs:channel>

    <wlevs:table id="Stock" event-type="StockEvent" data-source="StockDs" />

    <wlevs:processor id="proc" advertise="true" >
        <wlevs:table-source ref="Stock" />
    </wlevs:processor>

    <wlevs:channel id="OutputStream" advertise="true" event-type="StockExchangeEvent" >
        <wlevs:listener ref="bean"/>
        <wlevs:source ref="proc"/>
    </wlevs:channel>

    <osgi:reference id="ds" interface="com.bea.core.datasource.DataSourceService" cardinality="0..1" />

    <!-- Create business object -->
    <bean id="bean" class="com.bea.wlevs.example.db.OutputBean">
        <property name="dataSourceService" ref="ds"/>
    </bean>

</beans>
PKpPKz\EOEBPS/haconfig.htm Configuring High Availability

21 Configuring High Availability

This chapter describes how to configure high availability for your Oracle Complex Event Processing (Oracle CEP) application to provide the quality of service you require, including information on configuring failover, recovery and queue trimming, as well as configuring high availability adapters.

For more information on high availability options, see Chapter 20, "Understanding High Availability".

21.1 Configuring High Availability Quality of Service

You configure Oracle CEP high availability quality of service in the EPN assembly file and component configuration files. For general information about these configuration files, see:


Note:

After making any Oracle CEP high availability configuration changes, you must redeploy your Oracle CEP application. See Section 24.5, "Deploying Oracle CEP Applications".


This section describes:

For more information on configuring an Oracle CEP high availability application for scalability, see Section 20.1.4, "High Availability and Scalability".

21.1.1 How to Configure Simple Failover

You configure simple failover using the Oracle CEP buffering output adapter with a sliding window size of zero (0).

This procedure starts with the example EPN that Figure 21-1 shows and adds the required components to configure it for simple failover. Example 21-1 shows the corresponding EPN assembly file and Example 21-2 shows the corresponding component configuration file.

For more information about this Oracle CEP high availability quality of service, see Section 20.2.1, "Simple Failover".

Figure 21-1 Simple Failover EPN

Description of Figure 21-1 follows

Example 21-1 Simple Failover EPN Assembly File

<?xml version="1.0" encoding="UTF-8"?>
<beans ...>

    <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 current time is:"/>
    </wlevs:adapter>

    <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
        <wlevs:listener ref="helloworldProcessor"/>
        <wlevs:source ref="helloworldAdapter"/>
    </wlevs:channel>

    <wlevs:processor id="helloworldProcessor" />
    
    <wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent" advertise="true">
        <wlevs:listener>
            <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
        </wlevs:listener>
        <wlevs:source ref="helloworldProcessor"/>
    </wlevs:channel>

</beans>

Example 21-2 Simple Failover Component Configuration Assembly File

<?xml version="1.0" encoding="UTF-8"?>
<wlevs:config 
        xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
        xmlns:ha="http://www.oracle.com/ns/cep/config/cluster">
    <processor>
        <name>helloworldProcessor</name>
        <rules>
            <query id="helloworldRule">
                <![CDATA[ select * from helloworldInputChannel [Now] ]]>
            </query>
        </rules>
    </processor>
</wlevs:config>

To configure simple failover:

  1. Create a multi-server domain using Oracle Coherence.

    For more information, see:

  2. Create an Oracle CEP application.

    For more information, see Section 4.2, "Creating Oracle CEP Projects".

  3. Edit the MANIFEST.MF file to add the following Import-Package entries:

    • com.bea.wlevs.ede.api.cluster

    • com.oracle.cep.cluster.hagroups

    • com.oracle.cep.cluster.ha.adapter

    • com.oracle.cep.cluster.ha.api

    For more information, see Section 4.7.2, "How to Add an OSGi Bundle to an Oracle CEP Project".

  4. Configure your Oracle CEP application EPN assembly file to add an Oracle CEP high availability buffering output adapter as Example 21-3 shows.

    • Add a wlevs:adapter element with provider set to ha-buffering after channel helloworldOutputChannel.

    • Update the wlevs:listener element in channel helloworldOutputChannel to reference the ha-buffering adapter by its id.

    • Add a wlevs:listener element to the ha-buffering adapter that references the HelloWorldBean class.

    Example 21-3 Simple Failover EPN Assembly File: Buffering Output Adapter

    <?xml version="1.0" encoding="UTF-8"?>
    <beans ...>
    
        <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 current time is:"/>
        </wlevs:adapter>
    
        <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
            <wlevs:listener ref="helloworldProcessor"/>
        </wlevs:channel>
    
        <wlevs:processor id="helloworldProcessor" />
    
        <wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent" advertise="true">
            <wlevs:listener ref="myHaSlidingWindowAdapter"/>
            <wlevs:source ref="helloworldProcessor"/>
        </wlevs:channel>
    
        <wlevs:adapter id="myHaSlidingWindowAdapter" provider="ha-buffering" >
            <wlevs:listener>
                <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
            </wlevs:listener>
        </wlevs:adapter>
    
    </beans>
    
  5. Optionally, configure the channel downstream from the input adapter (helloworldInputChannel) to configure an application timestamp based on an appropriate event property as Example 21-4 shows.

    For simple failover, you can use system timestamps because events are not correlated between servers. However, it is possible that slightly different results might be output from the buffer if application timestamps are not used.

    In this example, event property arrivalTime is used.

    The wlevs:expression should be set to this event property.

    Example 21-4 Application Timestamp Configuration

    ...
        <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
            <wlevs:listener ref="helloworldProcessor"/>
            <wlevs:source ref="myHaInputAdapter"/>
            <wlevs:application-timestamped>
                <wlevs:expression>arrivalTime</wlevs:expression>
            </wlevs:application-timestamped>
        </wlevs:channel>
    ...
    
  6. Configure the Oracle CEP high availability buffering output adapter.

    Set the instance property windowLength to zero (0) as Example 21-5 shows.

    Example 21-5 Configuring windowLength in the Buffering Output Adapter

    ...
        <wlevs:adapter id="myHaSlidingWindowAdapter" provider="ha-buffering" >
            <wlevs:listener>
                <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
            </wlevs:listener>
            <wlevs:instance-property name="windowLength" value="0"/>
        </wlevs:adapter>
    ...
    

    For more information, see Section 21.2.2.1, "Buffering Output Adapter EPN Assembly File Configuration".

  7. Optionally, configure the component configuration file to include the Oracle CEP high availability buffering output adapter as Example 21-6 shows.

    Example 21-6 Simple Failover Component Configuration File With High Availability Adapters

    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config 
            xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
            xmlns:ha="http://www.oracle.com/ns/cep/config/cluster">
        <processor>
            <name>helloworldProcessor</name>
            <rules>
                <query id="helloworldRule">
                    <![CDATA[ select * from helloworldInputChannel [Now] ]]>
                </query>
            </rules>
        </processor>
    
        <ha:ha-buffering-adapter >
            <name>myHaSlidingWindowAdapter</name>
            <window-length>0</window-length>
        </ha:ha-buffering-adapter >
    
    </wlevs:config>
    

    For more information, see:

  8. Deploy your application to the deployment group you created in step 1.

    For more information, see Section 24.5, "Deploying Oracle CEP Applications".

    Oracle CEP automatically selects one of the Oracle CEP servers as the primary.

21.1.2 How to Configure Simple Failover With Buffering

You configure simple failover using the Oracle CEP buffering output adapter with a sliding window size greater than zero (0).

This procedure starts with the example EPN that Figure 21-2 shows and adds the required components to configure it for simple failover with buffering. Example 21-7 shows the corresponding EPN assembly file and Example 21-8 shows the corresponding component configuration file.

For more information about this Oracle CEP high availability quality of service, see Section 20.2.2, "Simple Failover with Buffering".

Figure 21-2 Simple Failover With Buffering EPN

Description of Figure 21-2 follows

Example 21-7 Simple Failover With Buffering EPN Assembly File

<?xml version="1.0" encoding="UTF-8"?>
<beans ...>

    <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 current time is:"/>
    </wlevs:adapter>

    <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
        <wlevs:listener ref="helloworldProcessor"/>
        <wlevs:source ref="helloworldAdapter"/>
    </wlevs:channel>

    <wlevs:processor id="helloworldProcessor" />
    
    <wlevs:channel id="helloworldOutputChannel" 
        event-type="HelloWorldEvent" advertise="true">
        <wlevs:listener>
            <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
        </wlevs:listener>
        <wlevs:source ref="helloworldProcessor"/>
    </wlevs:channel>

</beans>

Example 21-8 Simple Failover With Buffering Component Configuration Assembly File

<?xml version="1.0" encoding="UTF-8"?>
<wlevs:config 
        xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
        xmlns:ha="http://www.oracle.com/ns/cep/config/cluster">
    <processor>
        <name>helloworldProcessor</name>
        <rules>
            <query id="helloworldRule">
                <![CDATA[ select * from helloworldInputChannel [Now] ]]>
            </query>
        </rules>
    </processor>
</wlevs:config>

To configure simple failover with buffering:

  1. Create a multi-server domain using Oracle Coherence.

    For more information, see:

  2. Create an Oracle CEP application.

    For more information, see Section 4.2, "Creating Oracle CEP Projects".

  3. Edit the MANIFEST.MF file to add the following Import-Package entries:

    • com.bea.wlevs.ede.api.cluster

    • com.oracle.cep.cluster.hagroups

    • com.oracle.cep.cluster.ha.adapter

    • com.oracle.cep.cluster.ha.api

    For more information, see Section 4.7.2, "How to Add an OSGi Bundle to an Oracle CEP Project".

  4. Configure your Oracle CEP application EPN assembly file to add an Oracle CEP high availability buffering output adapter as Example 21-3 shows.

    • Add a wlevs:adapter element with provider set to ha-buffering after channel helloworldOutputChannel.

    • Update the wlevs:listener element in channel helloworldOutputChannel to reference the ha-buffering adapter by its id.

    • Add a wlevs:listener element to the ha-buffering adapter that references the HelloWorldBean class.

    Example 21-9 Simple Failover EPN Assembly File: Buffering Output Adapter

    <?xml version="1.0" encoding="UTF-8"?>
    <beans ...>
    
        <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 current time is:"/>
        </wlevs:adapter>
    
        <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
            <wlevs:listener ref="helloworldProcessor"/>
        </wlevs:channel>
    
        <wlevs:processor id="helloworldProcessor" />
    
        <wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent" 
            advertise="true">
            <wlevs:listener ref="myHaSlidingWindowAdapter"/>
            <wlevs:source ref="helloworldProcessor"/>
        </wlevs:channel>
    
        <wlevs:adapter id="myHaSlidingWindowAdapter" provider="ha-buffering" >
            <wlevs:listener>
                <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
            </wlevs:listener>
        </wlevs:adapter>
    
    </beans>
    
  5. Optionally, configure the channel downstream from the input adapter (helloworldInputChannel) to configure an application timestamp based on an appropriate event property as Example 21-10 shows.

    For simple failover with buffering, you can use system timestamps because events are not correlated between servers. However, it is possible that slightly different results might be output from the buffer if application timestamps are not used.

    In this example, event property arrivalTime is used.

    The wlevs:expression should be set to this event property.

    Example 21-10 Application Timestamp Configuration

    ...
        <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
            <wlevs:listener ref="helloworldProcessor"/>
            <wlevs:source ref="myHaInputAdapter"/>
            <wlevs:application-timestamped>
                <wlevs:expression>arrivalTime</wlevs:expression>
            </wlevs:application-timestamped>
        </wlevs:channel>
    ...
    
  6. Configure the Oracle CEP high availability buffering output adapter.

    Set the instance property windowLength to a value greater than zero (0) as Example 21-11 shows.

    Example 21-11 Configuring windowLength in the Buffering Output Adapter

    ...
        <wlevs:adapter id="myHaSlidingWindowAdapter" provider="ha-buffering" >
            <wlevs:listener>
                <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
            </wlevs:listener>
            <wlevs:instance-property name="windowLength" value="15000"/>
        </wlevs:adapter>
    ...
    

    For more information, see Section 21.2.2.1, "Buffering Output Adapter EPN Assembly File Configuration".

  7. Optionally, configure the component configuration file to include the Oracle CEP high availability buffering output adapter as Example 21-12 shows.

    Example 21-12 Simple Failover With Buffering Component Configuration File

    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config 
            xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
            xmlns:ha="http://www.oracle.com/ns/cep/config/cluster">
        <processor>
            <name>helloworldProcessor</name>
            <rules>
                <query id="helloworldRule">
                    <![CDATA[ select * from helloworldInputChannel [Now] ]]>
                </query>
            </rules>
        </processor>
    
        <ha:ha-buffering-adapter >
            <name>myHaSlidingWindowAdapter</name>
            <window-length>15000</window-length>
        </ha:ha-buffering-adapter >
    
    </wlevs:config>
    

    For more information, see:

  8. If your application is an Oracle CEP high availability Type 1 application (the application must generate exactly the same sequence of output events as existing secondaries), configure the warm-up-window-length for the buffering output adapter.

    For more information, see:

  9. Deploy your application to the deployment group you created in step 1.

    For more information, see Section 24.5, "Deploying Oracle CEP Applications".

    Oracle CEP automatically selects one of the Oracle CEP servers as the primary.

21.1.3 How to Configure Light-Weight Queue Trimming

You configure light-weight queue trimming using the Oracle CEP high availability input adapter and the broadcast output adapter.

This procedure starts with the example EPN that Figure 21-3 shows and adds the required components to configure it for light-weight queue trimming. Example 21-13 shows the corresponding EPN assembly file and Example 21-14 shows the corresponding component configuration file.

For more information about this Oracle CEP high availability quality of service, see Section 20.2.3, "Light-Weight Queue Trimming".

Figure 21-3 Light-Weight Queue Trimming EPN

Description of Figure 21-3 follows

Example 21-13 Light-Weight Queue Trimming EPN Assembly File

<?xml version="1.0" encoding="UTF-8"?>
<beans ...>

    <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 current time is:"/>
    </wlevs:adapter>

    <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
        <wlevs:listener ref="helloworldProcessor"/>
        <wlevs:source ref="helloworldAdapter"/>
    </wlevs:channel>

    <wlevs:processor id="helloworldProcessor" />
    
    <wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent" 
        advertise="true">
        <wlevs:listener>
            <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
        </wlevs:listener>
        <wlevs:source ref="helloworldProcessor"/>
    </wlevs:channel>

</beans>

Example 21-14 Light-Weight Queue Trimming Component Configuration Assembly File

<?xml version="1.0" encoding="UTF-8"?>
<wlevs:config 
        xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
        xmlns:ha="http://www.oracle.com/ns/cep/config/cluster">
    <processor>
        <name>helloworldProcessor</name>
        <rules>
            <query id="helloworldRule">
                <![CDATA[ select * from helloworldInputChannel [Now] ]]>
            </query>
        </rules>
    </processor>
</wlevs:config>

To configure light-weight queue trimming:

  1. Create a multi-server domain using Oracle Coherence.

    For more information, see:

  2. Create an Oracle CEP application.

    For more information, see Section 4.2, "Creating Oracle CEP Projects".

  3. Edit the MANIFEST.MF file to add the following Import-Package entries:

    • com.bea.wlevs.ede.api.cluster

    • com.oracle.cep.cluster.hagroups

    • com.oracle.cep.cluster.ha.adapter

    • com.oracle.cep.cluster.ha.api

    For more information, see Section 4.7.2, "How to Add an OSGi Bundle to an Oracle CEP Project".

  4. Configure your Oracle CEP application EPN assembly file to add an Oracle CEP high availability input adapter as Example 21-15 shows:

    • Add a wlevs:adapter element with provider set to ha-inbound after the regular input adapter helloworldAdapter.

    • Add a wlevs:listener element to the regular input adapter helloworldAdapter that references the ha-inbound adapter by its id.

    • Add a wlevs:source element to the helloworldInputChannel that references the ha-inbound adapter by its id.

    Example 21-15 Light-Weight Queue Trimming EPN Assembly File: High Availability Input Adapter

    <?xml version="1.0" encoding="UTF-8"?>
    <beans ...>
    
        <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 current time is:"/>
            <wlevs:listener ref="myHaInputAdapter"/>
        </wlevs:adapter>
    
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
        </wlevs:adapter>
    
        <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
            <wlevs:listener ref="helloworldProcessor"/>
            <wlevs:source ref="myHaInputAdapter"/>
        </wlevs:channel>
    
        <wlevs:processor id="helloworldProcessor" />
    
        <wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent" 
            advertise="true">
            <wlevs:listener>
                <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
            </wlevs:listener>
            <wlevs:source ref="helloworldProcessor"/>
        </wlevs:channel>
    
    </beans>
    
  5. Configure your Oracle CEP application EPN assembly file to add an Oracle CEP high availability broadcast output adapter as Example 21-16 shows.

    • Add a wlevs:adapter element with provider set to ha-broadcast after channel helloworldOutputChannel.

    • Update the wlevs:listener element in channel helloworldOutputChannel to reference the ha-broadcast adapter by its id.

    • Add a wlevs:listener element to the ha-broadcast adapter that references the HelloWorldBean class.

    Example 21-16 Light-Weight Queue Trimming EPN Assembly File: Broadcast Output Adapter

    <?xml version="1.0" encoding="UTF-8"?>
    <beans ...>
    
        <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 current time is:"/>
            <wlevs:listener ref="myHaInputAdapter"/>
        </wlevs:adapter>
    
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
        </wlevs:adapter>
    
        <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
            <wlevs:listener ref="helloworldProcessor"/>
            <wlevs:source ref="myHaInputAdapter"/>
        </wlevs:channel>
    
        <wlevs:processor id="helloworldProcessor" />
    
        <wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent" 
            advertise="true">
            <wlevs:listener ref="myHaBroadcastAdapter"/>
            <wlevs:source ref="helloworldProcessor"/>
        </wlevs:channel>
    
        <wlevs:adapter id="myHaBroadcastAdapter" provider="ha-broadcast" >
            <wlevs:listener>
                <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
            </wlevs:listener>
        </wlevs:adapter>
    
    </beans>
    
  6. Configure the Oracle CEP high availability input adapter.

    Consider the following example configurations:

    For more information, see Section 21.2.1.1, "High Availability Input Adapter EPN Assembly File Configuration".

    Example 21-17 High Availability Input Adapter: Default Configuration

    This example shows a high availability input adapter configuration using all defaults. The mandatory key is based on all event properties and the event property that the high availability input adapter assigns a time value to is an event property named arrivalTime.

    ...
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
            <wlevs:instance-property name="timeProperty" value="arrivalTime"/>
        </wlevs:adapter>
    ...
    

    Example 21-18 High Availability Input Adapter: Tuple Events

    This example shows a high availability input adapter configuration using all defaults. The mandatory key is based on all event properties and the event property that the high availability input adapter assigns a time value to is an event property named arrivalTime. Because the events are tuple-based events, you must specify the event type (MyEventType) using the eventType property.

    ...
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
            <wlevs:instance-property name="timeProperty" value="arrivalTime"/>
            <wlevs:instance-property name="eventType" value="MyEventType"/>
        </wlevs:adapter>
    ...
    

    Example 21-19 High Availability Input Adapter: Key of One Event Property

    This example shows a high availability input adapter configuration where the mandatory key is based on one event property (named id) and the event property that the high availability input adapter assigns a time value to is an event property named arrivalTime.

    ...
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
            <wlevs:instance-property name="keyProperties" value="id"/>
            <wlevs:instance-property name="timeProperty" value="arrivalTime"/>
        </wlevs:adapter>
    ...
    

    Example 21-20 High Availability Input Adapter: Key of Multiple Event Properties

    This example shows a high availability input adapter configuration where the mandatory key is based on more than one event property (properties orderID and accountID) and the event property that the high availability input adapter assigns a time value to is an event property named arrivalTime. A compound key Java class (com.acme.MyCompoundKeyClass) is mandatory and its implementation is shown in Example 21-21. The hashCode and equals methods are required. When you specify a keyClass, the keyProperties instance property is ignored: Oracle CEP assumes that the compound key is based on all the getter methods in the keyClass.

    ...
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
            <wlevs:instance-property name="timeProperty" value="arrivalTime"/>
            <wlevs:instance-property name="keyClass" value="com.acme.MyCompoundKeyClass"/>
        </wlevs:adapter>
    ...
    

    Example 21-21 MyCompoundKeyClass Implementation

    package com.acme;
    
    public class MyCompoundKeyClass {
        private int orderID;
        private int accountID;
    
        public MyCompoundKeyClass() {}
    
        public int getOrderID() {
            return orderID;
        }
        public setOrderID(int orderID) {
            this.orderID = orderID;
        }
        public int getAccountID() {
            return accountID;
        }
        public setOrderID(int accountID) {
            this.accountID = accountID;
        }
    
        public int hashCode() {
        int hash = 1;
        hash = hash * 31 + orderID.hashCode();
        hash = hash * 31 + (accountID == null ? 0 : accountID.hashCode());
        return hash;
        }
    
        public boolean equals(Object obj) {
            if (obj == this) return true;
            if (obj == null) return false;
            if (!(obj instanceof MyCompoundKeyClass)) return false;
            MyCompoundKeyClass k = (MyCompoundKeyClass) obj;
            return k.accountID == accountID && k.orderID == orderID;
        }
    }
    
  7. Configure the channel downstream from the high availability input adapter (helloworldInputChannel) to configure an application timestamp based on the high availability input adapter timeProperty setting as Example 21-22 shows.

    The wlevs:expression should be set to the timeProperty value.

    Example 21-22 Application Timestamp Configuration

    ...
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
            <wlevs:instance-property name="keyProperties" value="id"/>
            <wlevs:instance-property name="eventType" value="HelloWorldEvent"/>
            <wlevs:instance-property name="timeProperty" value="arrivalTime"/>
        </wlevs:adapter>
    
        <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" >
            <wlevs:listener ref="helloworldProcessor"/>
            <wlevs:source ref="myHaInputAdapter"/>
            <wlevs:application-timestamped>
                <wlevs:expression>arrivalTime</wlevs:expression>
            </wlevs:application-timestamped>
        </wlevs:channel>
    ...
    
  8. Configure the Oracle CEP high availability broadcast output adapter.

    Consider the following example configurations:

    For more information, see Section 21.2.3.1, "Broadcast Output Adapter EPN Assembly File Configuration".

    Example 21-23 Broadcast Output Adapter: Default Configuration

    This example shows a broadcast output adapter configuration using all defaults. The mandatory key is based on all event properties, key values are nonmonotonic (do not increase continually) and total order (unique).

    ...
        <wlevs:adapter id="myHaSlidingWindowAdapter" provider="ha-buffering" >
            <wlevs:listener>
                <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
            </wlevs:listener>
        </wlevs:adapter>
    ...
    

    Example 21-24 Broadcast Output Adapter: Key of One Event Property

    This example shows a broadcast output adapter configuration where the mandatory key is based on one event property (named timeProperty), key values are monotonic (they do increase continually) and not total order (not unique).

    ...
        <wlevs:adapter id="myHaSlidingWindowAdapter" provider="ha-buffering" >
            <wlevs:listener>
                <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
            </wlevs:listener>
            <wlevs:instance-property name="keyProperties" value="timeProperty"/>
            <wlevs:instance-property name="monotonic" value="true"/>
            <wlevs:instance-property name="total-order" value="false"/>
        </wlevs:adapter>
    ...
    

    Example 21-25 Broadcast Output Adapter: Key of Multiple Event Properties

    This example shows a broadcast output adapter configuration where the mandatory key is based on more than one event property (properties timeProperty and accountID), key values are monotonic (they do increase continually) and total order (unique). A compound key Java class (com.acme.MyCompoundKeyClass) is mandatory and its implementation is shown in Example 21-26. The hashCode and equals methods are required. When you specify a keyClass, the keyProperties instance property is ignored: Oracle CEP assumes that the compound key is based on all the getter methods in the keyClass.

    ...
        <wlevs:adapter id="myHaSlidingWindowAdapter" provider="ha-buffering" >
            <wlevs:listener>
                <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/>
            </wlevs:listener>
            <wlevs:instance-property name="keyClass" value="com.acme.MyCompoundKeyClass"/>
            <wlevs:instance-property name="monotonic" value="true"/>
            <wlevs:instance-property name="total-order" value="true"/>
        </wlevs:adapter>
    ...
    

    Example 21-26 MyCompoundKeyClass Implementation

    package com.acme;
    
    public class MyCompoundKeyClass {
        private int timeProperty;
        private int accountID;
    
        public MyCompoundKeyClass() {}
    
        public int getTimeProperty() {
            return orderID;
        }
        public setTimeProperty(int timeProperty) {
            this.timeProperty = timeProperty;
        }
        public int getAccountID() {
            return accountID;
        }
        public setOrderID(int accountID) {
            this.accountID = accountID;
        }
    
        public int hashCode() {
        int hash = 1;
        hash = hash * 31 + timeProperty.hashCode();
        hash = hash * 31 + (accountID == null ? 0 : accountID.hashCode());
        return hash;
        }
    
        public boolean equals(Object obj) {
            if (obj == this) return true;
            if (obj == null) return false;
            if (!(obj instanceof MyCompoundKeyClass)) return false;
            MyCompoundKeyClass k = (MyCompoundKeyClass) obj;
            return k.accountID == accountID && k.orderID == orderID;
        }
    }
    
  9. Optionally, configure the component configuration file to include the Oracle CEP high availability input adapter and buffering output adapter as Example 21-27 shows.

    Example 21-27 Light-Weight Queue Trimming Component Configuration File

    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config 
            xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
            xmlns:ha="http://www.oracle.com/ns/cep/config/cluster">
        <processor>
            <name>helloworldProcessor</name>
            <rules>
                <query id="helloworldRule">
                    <![CDATA[ select * from helloworldInputChannel [Now] ]]>
                </query>
            </rules>
        </processor>
    
        <ha:ha-inbound-adapter>
            <name>myHaInputAdapter</name>
        </ha:ha-inbound-adapter>
     
        <ha:ha-broadcast-adapter>
            <name>myHaBroadcastAdapter</name>
            <trimming-interval units="events">10</trimming-interval>
        </ha:ha-broadcast-adapter>
    
    </wlevs:config>
    

    For more information, see:

  10. If your application is an Oracle CEP high availability Type 1 application (the application must generate exactly the same sequence of output events as existing secondaries), configure the warm-up-window-length for the broadcast output adapter.

    For more information, see:

  11. Deploy your application to the deployment group you created in step 1.

    For more information, see Section 24.5, "Deploying Oracle CEP Applications".

    Oracle CEP automatically selects one of the Oracle CEP servers as the primary.

21.1.4 How to Configure Precise Recovery With JMS

You configure precise recovery with JMS using the Oracle CEP high availability input adapter and correlating output adapter.

This procedure describes how to create the example EPN that Figure 21-4 shows. Example 21-28 shows the corresponding EPN assembly file and Example 21-29 shows the corresponding component configuration file.

For more information about this Oracle CEP high availability quality of service, see Section 20.2.4, "Precise Recovery with JMS".


Note:

The JMS destination used by JMS adapters for precise recovery must be topics, rather than queues.


Figure 21-4 Precise Recovery With JMS EPN

Description of Figure 21-4 follows

Example 21-28 Precise Recovery With JMS EPN Assembly File

<?xml version="1.0" encoding="UTF-8"?>
<beans ... >

    <wlevs:event-type-repository>
        <wlevs:event-type type-name="StockTick">
            <wlevs:properties>
                <wlevs:property name="lastPrice" type="double" />
                <wlevs:property name="symbol" type="char" />
            </wlevs:properties>
        </wlevs:event-type>
    </wlevs:event-type-repository>

    <wlevs:adapter id="JMSInboundAdapter" provider="jms-inbound">
        <wlevs:listener ref="myHaInputAdapter"/>
    </wlevs:adapter>

    <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
        <wlevs:instance-property name="keyProperties" value="sequenceNo"/>
        <wlevs:instance-property name="timeProperty" value="inboundTime"/>
    </wlevs:adapter>

    <wlevs:channel id="channel1" event-type="StockTick">
        <wlevs:listener ref="processor1" />
        <wlevs:source ref="myHaInputAdapter"/>
        <wlevs:application-timestamped>
            <wlevs:expression>inboundTime</wlevs:expression>
        </wlevs:application-timestamped>
    </wlevs:channel>

    <wlevs:processor id="processor1">
        <wlevs:listener ref="channel2" />
    </wlevs:processor>

    <wlevs:adapter id="myHaCorrelatingAdapter" provider="ha-correlating" >
        <wlevs:instance-property name="correlatedSource" ref="clusterCorrelatingOutstream"/> 
        <wlevs:instance-property name="failOverDelay" value="2000"/> 
        <wlevs:listener ref="JMSOutboundAdapter"/>
    </wlevs:adapter>

    <wlevs:channel id="channel2" event-type="StockTick">
        <wlevs:listener ref="myHaCorrelatingAdapter" />
    </wlevs:channel>

    <wlevs:adapter id="JMSOutboundAdapter" provider="jms-outbound">
    </wlevs:adapter>

    <wlevs:adapter id="JMSInboundAdapter2" provider="jms-inbound">
    </wlevs:adapter>

    <wlevs:channel id="clusterCorrelatingOutstream" event-type="StockTick" advertise="true">
        <wlevs:source ref="JMSInboundAdapter2"/>
    </wlevs:channel> 
</beans>

Example 21-29 Precise Recovery With JMS Component Configuration Assembly File

<?xml version="1.0" encoding="UTF-8"?>
<wlevs:config 
        xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
        xmlns:ha="http://www.oracle.com/ns/cep/config/cluster">
    <processor>
        <name>processor1</name>
        <rules>
            <query id="helloworldRule">
                <![CDATA[ select * from channel1 [Now] ]]>
            </query>
        </rules>
    </processor>
</wlevs:config>

To configure precise recovery with JMS:

  1. Create a multi-server domain using Oracle Coherence.

    For more information, see:

  2. Create an Oracle CEP application.

    For more information, see Section 4.2, "Creating Oracle CEP Projects".

  3. Edit the MANIFEST.MF file to add the following Import-Package entries:

    • com.bea.wlevs.ede.api.cluster

    • com.oracle.cep.cluster.hagroups

    • com.oracle.cep.cluster.ha.adapter

    • com.oracle.cep.cluster.ha.api

    For more information, see Section 4.7.2, "How to Add an OSGi Bundle to an Oracle CEP Project".

  4. Configure your Oracle CEP application EPN assembly file to add an Oracle CEP high availability input adapter as Example 21-30 shows:

    • Add a wlevs:adapter element with provider set to ha-inbound after the regular input adapter JMSInboundAdapter.

    • Add a wlevs:listener element to the regular input adapter JMSInboundAdapter that references the ha-inbound adapter by its id.

    • Add a wlevs:source element to the channel channel1 that references the ha-inbound adapter by its id.

    Example 21-30 Precise Recovery With JMS EPN Assembly File: High Availability Input Adapter

    <?xml version="1.0" encoding="UTF-8"?>
    <beans ...>
    
        <wlevs:event-type-repository>
            <wlevs:event-type type-name="StockTick">
                <wlevs:properties>
                    <wlevs:property name="lastPrice" type="double" />
                    <wlevs:property name="symbol" type="char" />
                </wlevs:properties>
            </wlevs:event-type>
        </wlevs:event-type-repository>
    
        <wlevs:adapter id="JMSInboundAdapter" provider="jms-inbound">
            <wlevs:listener ref="myHaInputAdapter"/>
        </wlevs:adapter>
    
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
        </wlevs:adapter>
    
        <wlevs:channel id="channel1" event-type="StockTick">
            <wlevs:listener ref="processor1" />
            <wlevs:source ref="myHaInputAdapter"/>
        </wlevs:channel>
    
    ...
    
    </beans>
    
  5. Configure your Oracle CEP application EPN assembly file to add an Oracle CEP high availability correlating output adapter as Example 21-31 shows.

    • Add a wlevs:adapter element with provider set to ha-correlating after channel channel2.

    • Update the wlevs:listener element in channel channel2 to reference the ha-correlating adapter by its id.

    • Add a wlevs:listener element to the ha-correlating adapter that references the regular output adapter JMSOutboundAdapter.

    Example 21-31 Precise Recovery With JMS EPN Assembly File: Correlating Output Adapter

    <?xml version="1.0" encoding="UTF-8"?>
    <beans ...>
    
        <wlevs:event-type-repository>
            <wlevs:event-type type-name="StockTick">
                <wlevs:properties>
                    <wlevs:property name="lastPrice" type="double" />
                    <wlevs:property name="symbol" type="char" />
                </wlevs:properties>
            </wlevs:event-type>
        </wlevs:event-type-repository>
    
        <wlevs:adapter id="JMSInboundAdapter" provider="jms-inbound">
            <wlevs:listener ref="myHaInputAdapter"/>
        </wlevs:adapter>
    
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
        </wlevs:adapter>
    
        <wlevs:channel id="channel1" event-type="StockTick">
            <wlevs:listener ref="processor1" />
            <wlevs:source ref="myHaInputAdapter"/>
        </wlevs:channel>
    
        <wlevs:processor id="processor1">
            <wlevs:listener ref="channel2" />
        </wlevs:processor>
    
        <wlevs:channel id="channel2" event-type="StockTick">
            <wlevs:listener ref="myHaCorrelatingAdapter" />
        </wlevs:channel>
    
        <wlevs:adapter id="myHaCorrelatingAdapter" provider="ha-correlating" >
            <wlevs:listener ref="JMSOutboundAdapter"/>
        </wlevs:adapter>
    
        <wlevs:adapter id="JMSOutboundAdapter" provider="jms-outbound">
        </wlevs:adapter>
    
    ...
    
    </beans>
    
  6. Configure the Oracle CEP high availability input adapter.

    Consider the following example configurations:

    For more information, see Section 21.2.1.1, "High Availability Input Adapter EPN Assembly File Configuration".

    Example 21-32 High Availability Input Adapter: Default Configuration

    This example shows a high availability input adapter configuration using all defaults. The mandatory key is based on all event properties and the event property that the high availability input adapter assigns a time value to is an event property named arrivalTime.

    ...
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
            <wlevs:instance-property name="timeProperty" value="arrivalTime"/>
        </wlevs:adapter>
    ...
    

    Example 21-33 High Availability Input Adapter: Tuple Events

    This example shows a high availability input adapter configuration using all defaults. The mandatory key is based on all event properties and the event property that the high availability input adapter assigns a time value to is an event property named arrivalTime. Because the events are tuple-based events, you must specify the event type (MyEventType) using the eventType property.

    ...
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
            <wlevs:instance-property name="timeProperty" value="arrivalTime"/>
            <wlevs:instance-property name="eventType" value="MyEventType"/>
        </wlevs:adapter>
    ...
    

    Example 21-34 High Availability Input Adapter: Key of One Event Property

    This example shows a high availability input adapter configuration where the mandatory key is based on one event property (named sequenceNo) and the event property that the high availability input adapter assigns a time value to is an event property named inboundTime.

    ...
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
            <wlevs:instance-property name="keyProperties" value="sequenceNo"/>
            <wlevs:instance-property name="timeProperty" value="inboundTime"/>
        </wlevs:adapter>
    ...
    

    Example 21-35 High Availability Input Adapter: Key of Multiple Event Properties

    This example shows a high availability input adapter configuration where the mandatory key is based on more than one event property (properties orderID and accountID) and the event property that the high availability input adapter assigns a time value to is an event property named arrivalTime. A compound key Java class (com.acme.MyCompoundKeyClass) is mandatory and its implementation is shown in Example 21-36. The hashCode and equals methods are required. When you specify a keyClass, the keyProperties instance property is ignored: Oracle CEP assumes that the compound key is based on all the getter methods in the keyClass.

    ...
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
            <wlevs:instance-property name="timeProperty" value="arrivalTime"/>
            <wlevs:instance-property name="keyClass" value="com.acme.MyCompoundKeyClass"/>
        </wlevs:adapter>
    ...
    

    Example 21-36 MyCompoundKeyClass Implementation

    package com.acme;
    
    public class MyCompoundKeyClass {
        private int orderID;
        private int accountID;
    
        public MyCompoundKeyClass() {}
    
        public int getOrderID() {
            return orderID;
        }
        public setOrderID(int orderID) {
            this.orderID = orderID;
        }
        public int getAccountID() {
            return accountID;
        }
        public setOrderID(int accountID) {
            this.accountID = accountID;
        }
    
        public int hashCode() {
        int hash = 1;
        hash = hash * 31 + orderID.hashCode();
        hash = hash * 31 + (accountID == null ? 0 : accountID.hashCode());
        return hash;
        }
    
        public boolean equals(Object obj) {
            if (obj == this) return true;
            if (obj == null) return false;
            if (!(obj instanceof MyCompoundKeyClass)) return false;
            MyCompoundKeyClass k = (MyCompoundKeyClass) obj;
            return k.accountID == accountID && k.orderID == orderID;
        }
    }
    
  7. Configure the channel downstream from the high availability input adapter (channel1) to configure an application timestamp based on the high availability input adapter timeProperty setting as Example 21-37 shows.

    The wlevs:expression should be set to the timeProperty value.

    Example 21-37 Application Timestamp Configuration

    ...
        <wlevs:adapter id="myHaInputAdapter" provider="ha-inbound" >
            <wlevs:instance-property name="eventType" value="HelloWorldEvent"/>
            <wlevs:instance-property name="keyProperties" value="sequenceNo"/>
            <wlevs:instance-property name="timeProperty" value="inboundTime"/>
        </wlevs:adapter>
    
        <wlevs:channel id="channel1" event-type="StockTick">
            <wlevs:listener ref="processor1" />
            <wlevs:source ref="myHaInputAdapter"/>
            <wlevs:application-timestamped>
                <wlevs:expression>inboundTime</wlevs:expression>
            </wlevs:application-timestamped>
        </wlevs:channel>
    ...
    
  8. Configure the Oracle CEP high availability correlating output adapter failOverDelay.

    Example 21-38 shows a correlating output adapter configuration where the failOverDelay is 2000 milliseconds.

    Example 21-38 Correlating Output Adapter Configuration: failOverDelay

    ...
        <wlevs:adapter id="myHaCorrelatingAdapter" provider="ha-correlating" >
            <wlevs:listener ref="JMSOutboundAdapter"/>
            <wlevs:instance-property name="failOverDelay" value="2000"/>
        </wlevs:adapter>
    ...
    

    For more information, see Section 21.2.4.1, "Correlating Output Adapter EPN Assembly File Configuration".

  9. Create a second regular JMS input adapter.

    Example 21-39 shows a JMS adapter named JMSInboundAdapter2.

    Example 21-39 Inbound JMS Adapter Assembly File

    ...
        <wlevs:adapter id="JMSInboundAdapter2" provider="jms-inbound">
        </wlevs:adapter>
    ...
    

    This JMS input adapter must be configured identically to the first JMS input adapter (in this example, JMSInboundAdapter). Example 21-40 shows the component configuration file for both the JMS input adapters. Note that both have exactly the same configuration, including the same provider.

    Example 21-40 Inbound JMS Adapter Component Configuration File

    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config 
            xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
            xmlns:ha="http://www.oracle.com/ns/cep/config/cluster">
        ...
        <jms-adapter>
            <name>JMSInboundAdapter</name>
            <jndi-provider-url>t3://localhost:7001</jndi-provider-url>
            <destination-jndi-name>./Topic1</destination-jndi-name>
            <user>weblogic</user>
            <password>weblogic</password>
            <work-manager>JettyWorkManager</work-manager>
            <concurrent-consumers>1</concurrent-consumers>
        </jms-adapter>
    
        <jms-adapter>
            <name>JMSInboundAdapter2</name>
            <jndi-provider-url>t3://localhost:7001</jndi-provider-url>
            <destination-jndi-name>./Topic1</destination-jndi-name>
            <user>weblogic</user>
            <password>weblogic</password>
            <work-manager>JettyWorkManager</work-manager>
            <concurrent-consumers>1</concurrent-consumers>
        </jms-adapter>
        ...
    </wlevs:config>
    
  10. Create a channel to function as the correlated source.

    You must configure this channel with the second regular JMS input adapter as its source.

    Example 21-41 shows a correlated source named clusterCorrelatingOutstream whose source is JMSInboundAdapter2.

    Example 21-41 Creating the Correlated Source

    ...
        <wlevs:adapter id="JMSInboundAdapter2" provider="jms-inbound">
        </wlevs:adapter>
    
        <wlevs:channel id="clusterCorrelatingOutstream" event-type="StockTick" advertise="true">
            <wlevs:source ref="JMSInboundAdapter2"/>
        </wlevs:channel> 
    
  11. Configure the Oracle CEP high availability correlating output adapter with the correlatedSource.

    Example 21-38 shows a correlating output adapter configuration where the correlatedSource is clusterCorrelatingOutstream.

    Example 21-42 Correlating Output Adapter: correlatedSource

    ...
        <wlevs:adapter id="myHaCorrelatingAdapter" provider="ha-correlating" >
            <wlevs:listener ref="JMSOutboundAdapter"/>
            <wlevs:instance-property name="failOverDelay" value="2000"/>
            <wlevs:instance-property name="correlatedSource" value="clusterCorrelatingOutstream"/>
        </wlevs:adapter>
    ...
    

    For more information, see Section 21.2.4.1, "Correlating Output Adapter EPN Assembly File Configuration".

  12. If your application is an Oracle CEP high availability Type 1 application (the application must generate exactly the same sequence of output events as existing secondaries), configure the warm-up-window-length for the correlating output adapter.

    For more information, see:

  13. Configure the component configuration file to enable session-transacted for both inbound JMS adapters and the outbound JMS adapter as Example 21-43 shows:

    Example 21-43 Inbound and Outbound JMS Adapter Component Configuration File

    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config 
            xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
            xmlns:ha="http://www.oracle.com/ns/cep/config/cluster">
        ...
        <jms-adapter>
            <name>JMSInboundAdapter</name>
            <jndi-provider-url>t3://localhost:7001</jndi-provider-url>
            <destination-jndi-name>./Topic1</destination-jndi-name>
            <user>weblogic</user>
            <password>weblogic</password>
            <work-manager>JettyWorkManager</work-manager>
            <concurrent-consumers>1</concurrent-consumers>
            <session-transacted>true</session-transacted>
        </jms-adapter>
    
        <jms-adapter>
            <name>JMSInboundAdapter2</name>
            <jndi-provider-url>t3://localhost:7001</jndi-provider-url>
            <destination-jndi-name>./Topic1</destination-jndi-name>
            <user>weblogic</user>
            <password>weblogic</password>
            <work-manager>JettyWorkManager</work-manager>
            <concurrent-consumers>1</concurrent-consumers>
            <session-transacted>true</session-transacted>
        </jms-adapter>
        ...
        <jms-adapter>
            <name>JMSOutboundAdapter</name>
            <event-type>JMSEvent</event-type>
            <jndi-provider-url>t3://localhost:7001</jndi-provider-url>
            <destination-jndi-name>Topic1</destination-jndi-name>
            <delivery-mode>nonpersistent</delivery-mode>
            <session-transacted>true</session-transacted>
        </jms-adapter>
        ...
    </wlevs:config>
    
  14. Optionally, configure the component configuration file to include the Oracle CEP high availability input adapter and correlating output adapter as Example 21-27 shows.

    Example 21-44 High Availability Input and Output Adapter Component Configuration File

    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config 
            xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
            xmlns:ha="http://www.oracle.com/ns/cep/config/cluster">
        ...
        <ha:ha-inbound-adapter>
            <name>myHaInputAdapter</name>
        </ha:ha-inbound-adapter>
        ...
        <ha:ha-correlating-adapter>
            <name>myHaBroadcastAdapter</name>
            <fail-over-delay>2000</fail-over-delay>
        </ha:ha-correlating-adapter>
        ...
    </wlevs:config>
    

    For more information, see:

  15. Optionally, add an ActiveActiveGroupBean to your EPN to improve scalability.

    For more information, see Section 23.2, "Configuring Scalability With the ActiveActiveGroupBean".

  16. Deploy your application to the deployment group you created in step 1.

    For more information, see Section 24.5, "Deploying Oracle CEP Applications".

    Oracle CEP automatically selects one of the Oracle CEP servers as the primary.

21.2 Configuring High Availability Adapters

You configure Oracle CEP high availability adapters in the EPN assembly file and component configuration files, similar to how you configure other components in the EPN, such as channels or processors. For general information about these configuration files, see:


Note:

After making any Oracle CEP high availability configuration changes, you must redeploy your Oracle CEP application. See Section 24.5, "Deploying Oracle CEP Applications".


This section describes the configurable options for each of the Oracle CEP high availability adapters, including:

21.2.1 How to Configure the High Availability Input Adapter

The Oracle CEP high availability broadcast output adapter is implemented by BroadcastInputAdapter.

This section describes how to configure the Oracle CEP high availability input adapter, including:

For more information, see Section 20.1.3.1, "High Availability Input Adapter".

21.2.1.1 High Availability Input Adapter EPN Assembly File Configuration

The root element for declaring an Oracle CEP high availability input adapter is wlevs:adapter with provider element set to ha-inbound as Example 21-45 shows. You specify a wlevs:listener element for the Oracle CEP high availability input adapter in the actual input adapter as Example 21-45 shows.

Example 21-45 High Availability Input Adapter EPN Assembly File

<wlevs:adapter id="jmsAdapter" provider="jms-inbound"
    <wlevs:listener ref="myHaInputAdapter"/>      
</wlevs:adapter>

<wlevs:adapter id="myHaInputAdapter" provider="ha-inbound">
    <wlevs:instance-property name="keyProperties" value="id"/>
    <wlevs:instance-property name="timeProperty" value="arrivalTime"/>
    <wlevs:instance-property name="eventType" value="MyEventType"/>
</wlevs:adapter>

<wlevs:channel id="inputChannel" event-type="MyEventType ">
    <wlevs:source ref="myHaInputAdapter"/>
    <wlevs:application-timestamped>
        <wlevs:expression>arrivalTime</wlevs:expression>
    </wlevs:application-timestamped>
</wlevs:channel>

Table 21-1 describes the additional child elements of wlevs:adapter you can configure for an Oracle CEP high availability input adapter.

Table 21-1 Child Elements of wlevs:adapter for the High Availability Input Adapter

Child ElementDescription

wlevs:instance-property

Specify one or more instance-property element name and value attributes as Table 21-2 describes.


Table 21-2 lists the instance properties that the Oracle CEP high availability input adapter supports.

Table 21-2 High Availability Input Adapter Instance Properties

NameValue

timeProperty

Specify the name of the event property to which the high availability input adapter assigns a time value.

This is the same property that you use in the wlevs:application-timestamped element of the downstream EPN component to which the high availability input adapter is connected as Example 21-45 shows.

keyProperties

Specify a space delimited list of one or more event properties that the Oracle CEP high availability input adapter uses to identify event instances.

If you specify more than one event property, you must specify a keyClass.

Default: all event properties.

keyClass

Specify the fully qualified class name of a Java class used as a compound key.

By default, all JavaBean properties in the keyClass are assumed to be keyProperties, unless the keyProperties setting is used.

eventType

Specify the type name of the events that the Oracle CEP high availability input adapter receives from the actual input adapter. This is the same event type that you use in the downstream EPN component to which the high availability input adapter is connected as Example 21-45 shows.

For tuple events, this property is mandatory.

For all other Java class-based event types, this property is optional.

For more information, see Section 1.1.2, "Oracle CEP Event Types".


21.2.1.2 High Availability Input Adapter Component Configuration File Configuration

The root element for configuring an Oracle CEP high availability input adapter is ha-inbound-adapter. The name child element for a particular adapter must match the id attribute of the corresponding wlevs:adapter element in the EPN assembly file that declares this adapter as Example 21-50 shows.

Example 21-46 High Availability Input Adapter Component Configuration File

<ha:ha-inbound-adapter>
    <name>myHaInputAdapter</name>
    <heartbeat units="millis">1000</heartbeat>
    <batch-size>10</batch-size>
</ha:ha-inbound-adapter>

Table 21-3 describes the additional child elements of ha-inbound-adapter you can configure for an Oracle CEP high availability input adapter.

Table 21-3 Child Elements of ha-inbound-adapter for the High Availability Input Adapter

Child ElementDescription

heartbeat

Specify the length of time that the Oracle CEP high availability input adapter can be idle before it generates a heartbeat event to advance time as an integer number of units.

Valid values for attribute units:

  • nanos: wait the specified number of nanoseconds.

  • millis: wait the specified number of milliseconds.

  • secs: wait the specified number of seconds.

Default: Heartbeats are not sent.

batch-size

Specify the number of events in each timing message that the primary broadcasts to its secondaries. A value of n means that n {key, time} pairs are sent in each message. You can use this property for performance tuning (see Section 27.2.3, "High Availability Input Adapter Configuration"

Default: 1 (disable batching).


21.2.2 How to Configure the Buffering Output Adapter

The Oracle CEP high availability buffering output adapter is implemented by SlidingWindowQueueTrimmingAdapter.

This section describes how to configure the Oracle CEP high availability buffering output adapter, including:

For more information, see Section 20.1.3.2, "Buffering Output Adapter".

21.2.2.1 Buffering Output Adapter EPN Assembly File Configuration

The root element for declaring an Oracle CEP high availability buffering output adapter is wlevs:adapter with provider element set to ha-buffering as Example 21-47 shows.

Example 21-47 Buffering Output Adapter EPN Assembly File

<wlevs:adapter id="mySlidingWindowingAdapter" provider ="ha-buffering">
    <wlevs:listener>
        <bean class="com.bea.wlevs.example.cluster.ClusterAdapterBean"/>
    </wlevs:listener>
    <wlevs:instance-property name="windowLength" value="15000"/>
</wlevs:adapter>

Table 21-4 describes the additional child elements of wlevs:adapter you can configure for an Oracle CEP high availability buffering output adapter.

Table 21-4 Child Elements of wlevs:adapter for the Buffering Output Adapter

Child ElementDescription

wlevs:listener

Specify the regular output adapter downstream from this Oracle CEP high availability buffering output adapter.

wlevs:instance-property

Specify one or more instance-property element name and value attributes as Table 21-5 describes.


Table 21-5 lists the instance properties that the Oracle CEP high availability broadcast output adapter supports.

Table 21-5 Buffering Output Adapter Instance Properties

NameValue

windowLength

Specify the size of the sliding window as an integer number of milliseconds.

Default: 15000.


21.2.2.2 Buffering Output Adapter Component Configuration File Configuration

The root element for configuring an Oracle CEP high availability buffering output adapter is ha-buffering-adapter. The name child element for a particular adapter must match the id attribute of the corresponding wlevs:adapter element in the EPN assembly file that declares this adapter as Example 21-48 shows.

Example 21-48 Buffering Output Adapter ComponenWWt Configuration File

<ha:ha-buffering-adapter >
    <name>mySlidingWindowingAdapter</name>
    <window-length>15000</window-length>
    <warm-up-window-length units="minutes">6</warm-up-window-length>
</ha:ha-buffering-adapter >

Table 21-6 describes the additional child elements of ha-buffering-adapter you can configure for an Oracle CEP high availability buffering output adapter.

Table 21-6 Child Elements of ha-buffering-adapter for the Buffering Output Adapter

Child ElementDescription

window-length

Specify the size of the sliding window as an integer number of milliseconds.

Default: 15000.

warm-up-window

Specify the length of time it takes the application to rebuild state after a previously failed secondary restarts or a new secondary is added as an integer number of units.

Valid values for attribute units:

  • seconds: wait the specified number of seconds.

  • minutes: wait the specified number of minutes.

Default: units is events.

For more information, see Section 20.3.2.5, "Choose an Adequate warm-up-window Time".


21.2.3 How to Configure the Broadcast Output Adapter

The Oracle CEP high availability broadcast output adapter is implemented by class GroupBroadcastQueueTrimmingAdapter.

This section describes how to configure the Oracle CEP high availability broadcast output adapter, including:

For more information, see Section 20.1.3.3, "Broadcast Output Adapter".

21.2.3.1 Broadcast Output Adapter EPN Assembly File Configuration

The root element for declaring an Oracle CEP high availability broadcast output adapter is wlevs:adapter with provider element set to ha-broadcast as Example 21-49 shows.

Example 21-49 Broadcast Output Adapter EPN Assembly File

<wlevs:adapter id="myBroadcastAdapter" provider="ha-broadcast">
    <wlevs:listener ref="actualAdapter"/>
    <wlevs:instance-property name="keyProperties" value="time"/>
    <wlevs:instance-property name="monotonic" value="true"/>
</wlevs:adapter>

Table 21-7 describes the additional child elements of wlevs:adapter you can configure for an Oracle CEP high availability broadcast output adapter.

Table 21-7 Child Elements of wlevs:adapter for the Broadcast Output Adapter

Child ElementDescription

wlevs:listener

Specify the regular output adapter downstream from this Oracle CEP high availability broadcast output adapter.

wlevs:instance-property

Specify one or more instance-property element name and value attributes as Table 21-8 describes.


Table 21-8 lists the instance properties that the Oracle CEP high availability broadcast output adapter supports.

Table 21-8 Broadcast Output Adapter Instance Properties

NameValue

keyProperties

Specify a space delimited list of one or more event properties that the Oracle CEP high availability broadcast output adapter uses to identify event instances.

If you specify more than one event property, you must specify a keyClass.

Default: all event properties.

keyClass

Specify the fully qualified class name of a Java class used as a compound key.

By default, all JavaBean properties in the keyClass are assumed to be keyProperties, unless the keyProperties setting is used.

A compound key may be monotonic and may be total-order.

monotonic

Specify whether or not the key value is constantly increasing (like a time value).

Valid values are:

  • true: the key is constantly increasing.

  • false: the key is not constantly increasing.

Default: false.

total-order

Specify whether or not event keys are unique. Applicable only when instance property monotonic is set to true.

Valid values are:

  • true: event keys are unique.

  • false: event keys are not unique.

Default: true.


21.2.3.2 Broadcast Output Adapter Component Configuration File Configuration

The root element for configuring an Oracle CEP high availability broadcast output adapter is ha-broadcast-adapter. The name child element for a particular adapter must match the id attribute of the corresponding wlevs:adapter element in the EPN assembly file that declares this adapter as Example 21-50 shows.

Example 21-50 Broadcast Output Adapter Component Configuration File

<ha:ha-broadcast-adapter>
    <name>myBroadcastAdapter</name>
    <trimming-interval units="events">10</trimming-interval>
    <warm-up-window-length units="minutes">6</warm-up-window-length>
</ha:ha-broadcast-adapter>

Table 21-9 describes the additional child elements of ha-broadcast-adapter you can configure for an Oracle CEP high availability broadcast output adapter.

Table 21-9 Child Elements of ha-broadcast-adapter for the Broadcast Output Adapter

Child ElementDescription

trimming-interval

Specify the interval at which trimming messages are broadcast as an integer number of units. You can use this property for performance tuning (see Section 27.2.4, "Broadcast Output Adapter Configuration").

Valid values for attribute units:

  • events: broadcast trimming messages after the specified number of milliseconds.

  • millis: broadcast trimming messages after the specified number of events are processed.

Default: units is events.

warm-up-window

Specify the length of time it takes the application to rebuild state after a previously failed secondary restarts or a new secondary is added as an integer number of units.

Valid values for attribute units:

  • seconds: wait the specified number of seconds.

  • minutes: wait the specified number of minutes.

Default: units is events.

For more information, see Section 20.3.2.5, "Choose an Adequate warm-up-window Time".


21.2.4 How to Configure the Correlating Output Adapter

The Oracle CEP high availability correlating output adapter is implemented by class CorrelatedQueueTrimmingAdapter.

This section describes how to configure the Oracle CEP high availability correlating output adapter, including:

For more information, see Section 20.1.3.4, "Correlating Output Adapter".

21.2.4.1 Correlating Output Adapter EPN Assembly File Configuration

The root element for declaring an Oracle CEP high availability correlating output adapter is wlevs:adapter with provider element set to ha-correlating as Example 21-51 shows.

Example 21-51 Correlating Output Adapter EPN Assembly File

<wlevs:adapter id="myCorrelatingAdapter" provider="ha-correlating">
    <wlevs:listener>
        <bean class="com.bea.wlevs.example.cluster.ClusterAdapterBean"/>
    </wlevs:listener>
    <wlevs:instance-property name="correlatedSource" ref="clusterCorrOutstream"/>
    <wlevs:instance-property name="failOverDelay" value="2000"/>
</wlevs:adapter>

Table 21-10 describes the additional child elements of wlevs:adapter you can configure for an Oracle CEP high availability correlating output adapter.

Table 21-10 Child Elements of wlevs:adapter for the Correlating Output Adapter

Child ElementDescription

wlevs:listener

Specify the regular output adapter downstream from this Oracle CEP high availability buffering output adapter.

wlevs:instance-property

Specify one or more instance-property element name and value attributes as Table 21-11 describes.


Table 21-11 lists the instance properties that the Oracle CEP high availability correlating output adapter supports.

Table 21-11 Correlating Output Adapter Instance Properties

NameValue

correlatedSource

Specify the event source that will be used to correlate against. Events seen from this source will be purged from the trimming queue. Events still in the queue at failover will be replayed.

failOverDelay

Specify the delay timeout in milliseconds that is used to decide how soon after failover correlation should restart.

Default: 0 ms.


21.2.4.2 Correlating Output Adapter Component Configuration File Configuration

The root element for configuring an Oracle CEP high availability correlating output adapter is ha-correlating-adapter. The name child element for a particular adapter must match the id attribute of the corresponding wlevs:adapter element in the EPN assembly file that declares this adapter as Example 21-52 shows.

Example 21-52 Correlating Output Adapter Component Configuration File

<ha:ha-correlating-adapter>
    <name>myCorrelatingAdapter</name>
    <window-length>15000</window-length>
    <warm-up-window-length units="minutes">6</warm-up-window-length>
</ha:ha-correlating-adapter>

Table 21-12 describes the additional child elements of ha-broadcast-adapter you can configure for an Oracle CEP high availability correlating output adapter.

Table 21-12 Child Elements of ha-correlating-adapter for the Correlating Output Adapter

Child ElementDescription

fail-over-delay

Specify the delay timeout in milliseconds that is used to decide how soon after failover correlation should restart.

Default: 0 ms.

warm-up-window

Specify the length of time it takes the application to rebuild state after a previously failed secondary restarts or a new secondary is added as an integer number of units.

Valid values for attribute units:

  • seconds: wait the specified number of seconds.

  • minutes: wait the specified number of minutes.

Default: units is events.

For more information, see Section 20.3.2.5, "Choose an Adequate warm-up-window Time".


PKE|PKz\E OEBPS/lot.htm99 List of Tables

List of Tables

PK껑>999PKz\EOEBPS/deploy.htm Assembling and Deploying Oracle CEP Applications

24 Assembling and Deploying Oracle CEP Applications

This chapter describes how to assemble and deploy Oracle Complex Event Processing (Oracle CEP) applications manually, by using the Oracle CEP IDE for Eclipse, and by using Oracle CEP Visualizer.

24.1 Overview of Application Assembly and Deployment

The term application assembly refers to the process of packaging the components of an application, such as the Java files and XML configuration files, into an OSGI bundle that can be deployed to Oracle CEP. The term application deployment refers to the process of making an application available for processing client requests in an Oracle CEP domain.

This section describes:


Note:

Oracle CEP applications are built on top of the Spring Framework and OSGi Service Platform and make extensive use of their technologies and services. See Appendix A, "Additional Information about Spring and OSGi," for links to reference and conceptual information about Spring and OSGi.


24.1.1 Applications

In the context of Oracle CEP assembly and deployment, an application is defined as an OSGi bundle (see http://www2.osgi.org/javadoc/r4/org/osgi/framework/Bundle.html) JAR file that contains the following artifacts:

  • The compiled Java class files that implement some of the components of the application, such as the adapters, adapter factory, and POJO that contains the business logic.

  • One or more Oracle CEP configuration XML files that configure the components of the application. The only type of component that is required to have a configuration file is the complex event processor; all other components (adapters and streams) do not require configuration files if the default configuration of the component is adequate. You can combine all configuration files into a single file, or separate the configuration for individual components in their own files.

    The configuration files must be located in the META-INF/wlevs directory of the OSGi bundle JAR file if you plan to dynamically deploy the bundle. If you have an application already present in the domain directory, then the configuration files need to be extracted in the same directory.

  • An EPN assembly file that describes all the components of the application and how they are connected to each other.

    The EPN assembly file must be located in the META-INF/spring directory of the OSGi bundle JAR file.

  • A MANIFEST.MF file that describes the contents of the JAR.

24.1.2 Application Dependencies

The OSGI bundle declares dependencies by specifying imported and required packages. It also provides functionality to other bundles by exporting packages. If a bundle is required to provide functionality to other bundles, you must use Export-Package to allow other bundles to reference named packages. All packages not exported are not available outside the bundle.

You define dependencies at design time.

This section describes:

For more information, see:

24.1.2.1 Private Application Dependencies

Some dependencies are satisfied by a component bundled in and deployed with an application. For example, standard JAR files or property files.

For more information, see:

24.1.2.2 Shared Application Dependencies

Some dependencies are satisfied by a component deployed to the Oracle CEP server application library directory. These components are not bundled in and deployed with a specific application. Instead, they are accessible to any application that imports one or more of the packages that the application library exports.

For more information, see:

24.1.2.3 Native Code Dependencies

In some cases, you may create an application library that depends on native code libraries that you cannot or may not choose to package as application libraries.

In this case, you can put native code libraries in the operating system path (bootclasspath) of the Oracle CEP server when it is started, so that the native code libraries can be loaded by library bundles that need to call this native code.

For more information, see:

24.1.3 Application Libraries

The Oracle CEP application library gives you a convenient location to deploy shared libraries and gives you complete control over the order in which shared libraries are deployed at Oracle CEP server start up time.

An application library is an OSGi bundle that contains a Java archive (JAR) of compiled Java classes and any other required artifacts.

You can use application libraries for a variety of purposes such as drivers or foreign stages (partial or complete Oracle CEP applications that are useful to other downstream applications).

Although you can add a library to a project as a simple embedded JAR file, there are advantages to using an application library, including:

  • Simplifying application assembly and maintenance activities such as deploying an updated version of the library.

  • Encouraging re-use.

  • Reducing server disk space consumption.

You deploy application libraries to either of the following Oracle CEP server directories:

For more information, see:

24.1.3.1 Library Directory

By default, the Oracle CEP server library directory is:

DOMAIN_DIR/servername/modules

Where:

  • DOMAIN_DIR: is the domain directory such as /oracle_cep/user_projects/domains/mydomain.

  • servername: is the server instance, such as myserver.

For example:

/oracle_cep/user_projects/domains/mydomain/myserver/modules

The libraries in this directory are deployed after the components in the library extensions directory but before any Oracle CEP applications.

If your library is a driver (such as a JDBC driver), you must put it in the library extensions directory as Section 24.1.3.2, "Library Extensions Directory" describes.

To configure the root of the application library directory path, see Section 24.3.1, "How to Define the Application Library Directory Using Oracle CEP IDE for Eclipse".

24.1.3.2 Library Extensions Directory

By default, the Oracle CEP server library extensions directory is:

DOMAIN_DIR/servername/modules/ext

Where:

  • DOMAIN_DIR: is the domain directory such as /oracle_cep/user_projects/domains/mydomain.

  • servername: is the server instance, such as myserver.

For example:

/oracle_cep/user_projects/domains/mydomain/myserver/modules/ext

The libraries in this directory are deployed first along with the Oracle CEP server core modules.

If your library is a driver (such as a JDBC driver), you must put it in the library extensions directory so that it is activated in the correct order. For example, to override an older version with a newer version or to provide access to an alternative driver. For more information, see "Configuring Access to a Different Database Driver or Driver Version" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

If your library is not a driver, you may put it in the library directory as Section 24.1.3.1, "Library Directory" describes.

To configure the root of the application library extensions directory path, see Section 24.3.1, "How to Define the Application Library Directory Using Oracle CEP IDE for Eclipse".

24.1.3.3 Creating Application Libraries

Oracle CEP provides a bundler.sh utility you can use to create an OSGi bundle wrapper around an arbitrary Java Archive. The resultant bundle JAR may be deployed to an OSGi container where the Java packages/classes found within the bundle may be imported and utilized by other deployed bundles. An example use case is the packaging of third-party JDBC drivers.

The utility reads the specified source JAR file and creates a target JAR file that includes the content of the source JAR and a manifest with the appropriate bundle-related entries specified. All Java packages found in the source archive will be exported by the target bundle.

Optionally, a bundle activator can be generated that instantiates one or more classes found within the JAR and registers each object as an OSGi service. This feature provides the ability for component bundles to access and manipulate multiple versions of specific factory classes at runtime.

If you wish to manually configure the activator implementation, you can use the Oracle CEP IDE for Eclipse.

For more information, see:

24.1.4 Deployment and Deployment Order

After you have assembled the application, you deploy it by making it known to the Oracle CEP domain using the deployment tool appropriate for your needs. For detailed instructions, see Section 24.5, "Deploying Oracle CEP Applications."

The Oracle CEP server deploys components in the following order at Oracle CEP server start up time:

  1. Deploy libraries in the library extensions directory (DOMAIN_DIR/servername/modules/ext directory).

  2. Deploy libraries in the library directory (DOMAIN_DIR/servername/modules directory).

  3. Deploy Oracle CEP applications.

The Oracle CEP server deploys libraries from both the library extensions directory and library directory based on the lexical order of the library names. Lexical ordering includes the relative directory name plus JAR file name.

For example:

  • modules/a.jar will start before modules/b.jar

  • modules/0/my.jar will start before module/my.jar since 0/my.jar comes before my.jar in lexical order

Using this convention, you can control the order in which Oracle CEP server deploys JAR files simply by organizing JAR files into appropriately named subdirectories of either the library extensions directory or library directory.

Once the application is deployed to Oracle CEP, the configured adapters immediately start listening for events for which they are configured, such as financial data feeds and so on.

For more information, see Section 24.1.3, "Application Libraries".

24.1.5 Configuration History Management

When you deploy an application to the Oracle CEP server, the Oracle CEP server creates a configuration history for the application. Any configuration changes you make to rules or Oracle CEP high availability adapter configuration are recorded in this history are recorded in this history. You can view and roll-back (undo) these changes using the Oracle CEP Visualizer or wlevs.Admin tool.

For more information, see:

24.2 Assembling an Oracle CEP Application

Assembling an Oracle CEP application refers to bundling the artifacts that make up the application into an OSGi bundle JAR file as http://www2.osgi.org/javadoc/r4/org/osgi/framework/Bundle.html describes. These artifacts include:

  • compiled Java classes

  • Oracle CEP component configuration files that configure application components (such as the processors or adapters)

  • EPN assembly file

  • MANIFEST.MF file

See Appendix A, "Additional Information about Spring and OSGi," for links to reference and conceptual information about Spring and OSGi.

This section describes:

24.2.1 Assembling an Oracle CEP Application Using Oracle CEP IDE for Eclipse

You can use Oracle CEP IDE for Eclipse to easily assemble your Oracle CEP application.

For more information, see:

If your application depends on foreign stages, see Section 24.2.3, "Assembling Applications With Foreign Stages".

24.2.2 Assembling an Oracle CEP Application Manually

Optionally, you can assemble your Oracle CEP application manually.

For simplicity, the following procedure creates a temporary directory that contains the required artifacts, and then jars up the contents of this temporary directory. This is just a suggestion and you are not required, of course, to assemble the application using this method.


Note:

See the HelloWorld example source directory for a sample build.xml Ant file that performs many of the steps described below. The build.xml file is located in ORACLE_CEP_HOME\ocep_11.1\samples\source\applications\helloworld, where ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as d:\oracle_cep.


To assemble an Oracle CEP application manually:

  1. Open a command window and set your environment as described in "Setting Your Development Environment" in the Oracle Fusion Middleware Getting Started Guide for Oracle Complex Event Processing.

  2. Create an empty directory, such as output:

    prompt> mkdir output
    
  3. Compile all application Java files into the output directory.

  4. Create an output/META-INF/spring directory.

  5. Copy the EPN assembly file that describes the components of your application and how they are connected into the output/META-INF/spring directory.

    See Section 4.3, "Creating EPN Assembly Files" for details about this file.

  6. Create an output/META-INF/wlevs directory.

  7. Copy the XML files that configure the components of your application (such as the processors or adapters) into the output/META-INF/wlevs directory.

    You create these XML files during the course of creating your application, as described in Section 1.1, "Overview of the Oracle CEP Programming Model."

  8. Create a MANIFEST.MF file that contains descriptive information about the bundle.

    See Section 24.2.2.1, "Creating the MANIFEST.MF File."

  9. If you need to access third-party JAR files from your Oracle CEP application, see Section 24.2.2.2, "Accessing Third-Party JAR Files."

  10. Create a JAR file that contains the contents of the output directory.

    Be sure you specify the MANIFEST.MF file you created in the previous step rather than the default manifest file.

    You can name the JAR file anything you want. In the Oracle CEP examples, the name of the JAR file is a combination of Java package name and version, such as:

    com.bea.wlevs.example.helloworld_1.0.0.0.jar
    

    Consider using a similar naming convention to clarify which bundles are deployed to the server.

    See the Apache Ant documentation at http://ant.apache.org/manual/Tasks/jar.html for information on using the jar task or the Java SE documentation at http://download.oracle.com/javase/6/docs/technotes/tools/windows/jar.html for information on using the jar command-line tool.

  11. If your application depends on foreign stages, see Section 24.2.3, "Assembling Applications With Foreign Stages".

24.2.2.1 Creating the MANIFEST.MF File

The structure and contents of the MANIFEST.MF file is specified by the OSGi Framework. Although the value of many of the headers in the file is specific to your application or business, many of the headers are required by Oracle CEP.

In particular, the MANIFEST.MF file defines the following:

  • Application name—Specified with the Bundle-Name header.

  • Symbolic application name—Specified with the Bundle-SymbolicName header.

    Many of the Oracle CEP tools, such as the wlevs.Admin utility and JMX subsystem, use the symbolic name of the bundle when referring to the application.

  • Application version—Specified with the Bundle-Version header.

  • Imported packages—Specified with the Import-Package header.

    Oracle CEP requires that you import the following packages at a minimum:

    Import-Package:  
     com.bea.wlevs.adapter.defaultprovider;version="11.1.1",
     com.bea.wlevs.ede;version="11.1.1",
     com.bea.wlevs.ede.api;version="11.1.1",
     com.bea.wlevs.ede.impl;version="11.1.1",
     org.osgi.framework;version="1.3.0",
     org.springframework.beans.factory;version="2.5.6",
     org.apache.commons.logging;version="1.1.0",
     com.bea.wlevs.spring;version="11.1.1",
     com.bea.wlevs.util;version="11.1.1",
     org.springframework.beans;version="2.5.6",
     org.springframework.util;version="2.0",
     org.springframework.core.annotation;version="2.5.6",
     org.springframework.beans.factory;version="2.5.6",
     org.springframework.beans.factory.config;version="2.5.6",
     org.springframework.osgi.context;version="1.2.0",
     org.springframework.osgi.service;version="1.2.0"
    

    If you have extended the configuration of an adapter, then you must also import the following packages:

     javax.xml.bind;version="2.0",
     javax.xml.bind.annotation;version=2.0,
     javax.xml.bind.annotation.adapters;version=2.0,
     javax.xml.bind.attachment;version=2.0,
     javax.xml.bind.helpers;version=2.0,
     javax.xml.bind.util;version=2.0,
     com.bea.wlevs.configuration;version="11.1.1",
     com.bea.wlevs.configuration.application;version="11.1.1",
     com.sun.xml.bind.v2;version="2.0.2"
    
  • Exported packages—Specified with the Export-Package header. You should specify this header only if you need to share one or more application classes with other deployed applications. A typical example is sharing an event type JavaBean.

    If possible, you should export packages that include only the interfaces, and not the implementation classes themselves. If other applications are using the exported classes, you will be unable to fully undeploy the application that is exporting the classes.

    Exported packages are server-wide, so be sure their names are unique across the server.

The following complete MANIFEST.MF file is from the HelloWorld example, which extends the configuration of its adapter:

Manifest-Version: 1.0
Archiver-Version:
Build-Jdk: 1.6.0_06
Extension-Name: example.helloworld
Specification-Title: 1.0.0.0
Specification-Vendor: Oracle.
Implementation-Vendor: Oracle.
Implementation-Title: example.helloworld
Implementation-Version: 1.0.0.0
Bundle-Version: 11.1.1.4_0
Bundle-ManifestVersion: 1
Bundle-Vendor: Oracle.
Bundle-Copyright: Copyright (c) 2006 by Oracle.
Import-Package: com.bea.wlevs.adapter.defaultprovider;version="11.1.1",
 com.bea.wlevs.ede;version="11.1.1",
 com.bea.wlevs.ede.impl;version="11.1.1",
 com.bea.wlevs.ede.api;version="11.1.1",
 org.osgi.framework;version="1.3.0",
 org.apache.commons.logging;version="1.1.0",
 com.bea.wlevs.spring;version="11.1.1",
 com.bea.wlevs.util;version="11.1.1",
 net.sf.cglib.proxy,
 net.sf.cglib.core,
 net.sf.cglib.reflect,
 org.aopalliance.aop,
 org.springframework.aop.framework;version="2.5.6",
 org.springframework.aop;version="2.5.6",
 org.springframework.beans;version="2.5.6",
 org.springframework.util;version="2.0",
 org.springframework.core.annotation;version="2.5.6",
 org.springframework.beans.factory;version="2.5.6",
 org.springframework.beans.factory.config;version="2.5.6",
 org.springframework.osgi.context;version="1.2.0",
 org.springframework.osgi.service;version="1.2.0",
 javax.xml.bind;version="2.0",
 javax.xml.bind.annotation;version=2.0,
 javax.xml.bind.annotation.adapters;version=2.0,
 javax.xml.bind.attachment;version=2.0,
 javax.xml.bind.helpers;version=2.0,
 javax.xml.bind.util;version=2.0,
 com.bea.wlevs.configuration;version="11.1.1",
 com.bea.wlevs.configuration.application;version="11.1.1",
 com.sun.xml.bind.v2;version="2.0.2"
Bundle-Name: example.helloworld
Bundle-Description: WLEvS example helloworld
Bundle-SymbolicName: helloworld

24.2.2.2 Accessing Third-Party JAR Files

When creating your Oracle CEP applications, you might need to access legacy libraries within existing third-party JAR files. You can ensure access to this legacy code using any of the following approaches:

24.2.2.2.1 Accessing Third-Party JAR Files Using Bundle-Classpath

The recommended approach is to package the third-party JAR files in your Oracle CEP application JAR file. You can put the JAR files anywhere you want.


Note:

This approach gives you little control over the order in which JAR files are loaded and it is possible that dependency conflicts may occur. For this reason, Oracle recommends that you use the Oracle CEP server application library approach instead. For more information, see Section 24.1.3, "Application Libraries".


However, to ensure that your Oracle CEP application finds the classes in the third-party JAR file, you must update the application classpath by adding the Bundle-Classpath header to the MANIFEST.MF file. Set Bundle-Classpath to a comma-separate list of the JAR file path names that should be searched for classes and resources. Use a period (.) to specify the bundle itself. For example:

Bundle-Classpath: ., commons-logging.jar, myExcitingJar.jar, myOtherExcitingJar.jar

If you need to access native libraries, you must also package them in your JAR file and use the Bundle-NativeCode header of the MANIFEST.MF file to specify their location in the JAR.

For more information, see Section 4.7.1, "How to Add a Standard JAR File to an Oracle CEP Project".

24.2.2.2.2 Accessing Third-Party JAR Files Using -Xbootclasspath

If the JAR files include libraries used by all applications deployed to Oracle CEP, such as JDBC drivers, you can add the JAR file to the server's boot classpath by specifying the -Xbootclasspath/a option to the java command in the scripts used to start up an instance of the server.


Note:

This approach gives you little control over the order in which JAR files are loaded and it is possible that dependency conflicts may occur. For this reason, Oracle recommends that you use the Oracle CEP server application library approach instead. For more information, see Section 24.1.3, "Application Libraries".


The name of the server start script is startwlevs.cmd (Windows) or startwlevs.sh (UNIX), and the script is located in the server directory of your domain directory. The out-of-the-box sample domains are located in ORACLE_CEP_HOME/ocep_11.1/samples/domains, and the user domains are located in ORACLE_CEP_HOME/user_projects/domains, where ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as d:\oracle_cep.

Update the start script by adding the -Xbootclasspath/a option to the java command that executes the wlevs_2.0.jar file. Set the -Xbootclasspath/a option to the full pathname of the third-party JAR files you want to access system-wide.

For example, if you want all deployed applications to be able to access a JAR file called e:\jars\myExcitingJAR.jar, update the java command in the start script as follows. The updated section is shown in bold (in practice, the command should be on one line):

%JAVA_HOME%\bin\java -Dwlevs.home=%USER_INSTALL_DIR% -Dbea.home=%BEA_HOME%
    -Xbootclasspath/a:e:\jars\myExcitingJAR.jar 
    -jar "%USER_INSTALL_DIR%\bin\wlevs_2.0.jar" -disablesecurity %1 %2 %3 %4 %5 %6 

24.2.3 Assembling Applications With Foreign Stages

When assembling applications that depend on foreign stages, be aware of classpath dependencies. Consider the application dependency graph that Figure 24-1 shows.

Figure 24-1 Foreign Stage Dependency Graph

Description of Figure 24-1 follows

In this example, Application A depends on Application B, Application B depends on Application C, and Application C depends on Application A. Application C declares and exports an event type class for Java Bean event type MarketEvent. Applications A and B import the MarketEvent class that Application C provides.

Note the following:

  • When you redeploy a foreign stage, you must redeploy all foreign stages that depend on that application or foreign stage.

    For example, if you redeploy Application B, you must also redeploy Application A.

  • If there is a classpath dependency between one foreign stage and another, when you deploy the foreign stage that declares and exports the shared class, you must redeploy all foreign stages that import the shared class.

    For example, if you redeploy Application C, you must also redeploy Application A and B because Application A and B have a classpath dependency on Application C (MarketEvent).

For more information, see:

24.2.4 Assembling a Custom Adapter or Event Bean in Its Own Bundle

Typically, custom adapters and event beans are bundled in the same application JAR file that contains the other components of the EPN, such as the processor, streams, and business logic POJO.

However, you might sometimes want to bundle the adapter in its own JAR file and then reference the adapter in other application bundles. This is useful if, for example, two different applications read data coming from the same data feed provider and both applications use the same event types. In this case, it makes sense to share a single adapter and event type implementations rather than duplicate the implementation in two different applications.

There is no real difference in how you configure an adapter and an application that uses it in separate bundles; the difference lies in where you put the configuration.

This section describes:

24.2.4.1 How to Assemble a Custom Adapter in its Own Bundle

You can assemble a custom adapter and its dependent classes in its own bundle.

To assemble a custom adapter in its own bundle:

  1. Create an OSGI bundle that contains only the custom adapter Java class, the custom adapter factory Java class, and optionally, the event type Java class into which the custom adapter converts incoming data.

    In this procedure, this bundle is called GlobalAdapter.

  2. In the EPN assembly file of the GlobalAdapter bundle:

  3. Assemble and deploy the GlobalAdapter bundle as Section 24.5, "Deploying Oracle CEP Applications" describes.

  4. In the EPN assembly file of the application that is going to use the custom adapter, declare the custom adapter component as Section 14.4.2, "Declaring the Custom Adapter Components in your Application" describes.

    You still use the provider attribute to specify the OSGI-registered adapter factory, although in this case the OSGI registration happens in a different EPN assembly file (of the GlobalAdapter bundle) from the EPN assembly file that actually uses the adapter.

  5. If you have exported the event type in the GlobalAdapter bundle, you must explicitly import it into the application that is going to use it.

    You do this by adding the package to the Import-Package header of the MANIFEST.MF file of the application bundle as Section 24.2.2.1, "Creating the MANIFEST.MF File" describes.

24.2.4.2 How to Assemble a Custom Event Bean in its Own Bundle

You can assemble a custom event bean and its dependent classes in its own bundle.

To assemble a custom event bean in its own bundle:

  1. Create an OSGI bundle that contains only the custom event bean Java class and the custom event bean factory Java class.

    In this procedure, this bundle is called GlobalEventBean.

  2. In the EPN assembly file of the GlobalEventBean bundle:

  3. Assemble and deploy the GlobalEventBean bundle as Section 24.5, "Deploying Oracle CEP Applications" describes.

  4. In the EPN assembly file of the application that is going to use the custom event bean, declare the custom event bean component as Section 15.3.2, "Declaring the Custom Event Bean Components in your Application" describes.

    You still use the provider attribute to specify the OSGI-registered custom event bean factory, although in this case the OSGI registration happens in a different EPN assembly file (of the GlobalEventBean bundle) from the EPN assembly file that actually uses the adapter.

  5. If you have exported the event type in the GlobalEventBean bundle, you must explicitly import it into the application that is going to use it.

    You do this by adding the package to the Import-Package header of the MANIFEST.MF file of the application bundle as Section 24.2.2.1, "Creating the MANIFEST.MF File" describes.

24.3 Managing Application Libraries

The Oracle CEP application library gives you a convenient location to deploy shared libraries and gives you complete control over the order in which shared libraries are deployed at Oracle CEP server start up time.

This section describes how to manage an Oracle CEP server application library, including:

For more information, see Section 24.1.3, "Application Libraries".

24.3.1 How to Define the Application Library Directory Using Oracle CEP IDE for Eclipse

Before you can use the Oracle CEP server application library, you must update your Oracle CEP IDE for Eclipse design time configuration with the location of the application library directory.

For information on default application library configuration, see:

For more information, see Section 24.3, "Managing Application Libraries".

To define an application library directory using Oracle CEP IDE for Eclipse:

  1. Launch the Oracle CEP IDE for Eclipse.

  2. Right-click the project and select Properties.

    The Preferences dialog appears as shown in Figure 24-2.

    Figure 24-2 Preferences Dialog: Application Library Path

    Description of Figure 24-2 follows

  3. Select Oracle CEP Application Library Path.

  4. Specify the application library path as Table 24-1 describes.

    Table 24-1 Oracle CEP Application LIbrary Path

    OptionDescription

    Use an absolute path

    Select this option to specify an absolute file path to the application library directory.

    See Section 24.3.1.1, "How to Configure an Absolute Path".

    Extend a path variable

    Select this option to specify an application library path based on a path variable.

    See Section 24.3.1.2, "How to Extend a Path Variable".


24.3.1.1 How to Configure an Absolute Path

You can specify the application library path as an absolute file path. It may be more convenient in a team environment to specify the application library path based on a path variable as Section 24.3.1.2, "How to Extend a Path Variable" describes.

To configure an absolute path:

  1. Click the Browse button to open a file system browser.

  2. Use the file system browser to choose a directory.


    Note:

    The directory must reside within an Oracle CEP server domain. For more information, see Section 5.2, "Creating Oracle CEP Servers".


  3. Click OK.

  4. Click Apply.

  5. Click OK.

24.3.1.2 How to Extend a Path Variable

You can specify the application library path by extending a path variable. This is the most flexible approach and is appropriate for team environments. Alternatively, you can specify the application library with an absolute path as Section 24.3.1.1, "How to Configure an Absolute Path" describes.

To extend a path variable:

  1. Click the Variable button.

    The Select Path Variable dialog appears as Figure 24-3 shows.

    Figure 24-3 Select Path Variable Dialog

    Description of Figure 24-3 follows

  2. Click New.

    The New Variable dialog appears as Figure 24-4 shows.

    Figure 24-4 New Variable Dialog

    Description of Figure 24-4 follows

  3. Configure the New Variable dialog as Table 24-2 describes.

    Table 24-2 Oracle CEP Application LIbrary Path Variable

    OptionDescription

    Name

    Enter a name for the variable.

    Location

    Click the Folder button to open a file system browser and choose the root directory to use as the application library directory.

    NOTE: The directory must reside within an Oracle CEP server domain. For more information, see Section 5.2, "Creating Oracle CEP Servers"


  4. Click OK.

    The new variable appears in the Select Path Variable dialog as Figure 24-5 shows.

    Figure 24-5 Select Path Variable: With Variable

    Description of Figure 24-5 follows

  5. Optionally, select the variable and click Extend.

    The Variable Extension dialog appears as Figure 24-6 shows. This dialog shows any directories below the root directory you specified for this variable.

    Figure 24-6 Variable Extension Dialog

    Description of Figure 24-6 follows

  6. Select a sub-directory and click OK.

    The application library path is specified relative to the path variable you defined as Figure 24-7 shows.

    Figure 24-7 Preferences Dialog: Application Library Path With Path Variable

    Description of Figure 24-7 follows

  7. Click Apply.

  8. Click OK.

24.3.2 How to Create an Application Library Using bundler.sh

This procedure describes how to create an OSGi bundle using the bundler utility.

This is the preferred method. If you wish to manually configure the activator implementation, see Section 24.3.3, "How to Create an Application Library Using Oracle CEP IDE for Eclipse".

If you are creating an application library for a new JDBC driver, see "How to Access a Database Driver Using an Application Library Built With bundler.sh" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

For more information, see Section 24.1.3.3, "Creating Application Libraries".

To create an application library using bundler.sh:

  1. Set up your environment as described in "Setting Your Development Environment" in the Oracle Fusion Middleware Getting Started Guide for Oracle Complex Event Processing.

  2. Execute the bundler.sh script to create an OSGi bundle containing your driver.

    The bundler.sh script is located in the ORACLE_CEP_HOME/ocep_11.1/bin directory, where ORACLE_CEP_HOME is the directory in which you installed the Oracle CEP server.

    Example 24-1 lists the bundler.sh command line options and Table 24-3 describes them.

    Example 24-1 bundler.sh Command Line Options

    bundler -source JAR -name NAME -version VERSION
    [-factory CLASS+] [-service INTERFACE+] [-fragmenthost HOST]
    [-stagedir PATH] [-targetdir PATH]
    [+import PACKAGE|REGEX+] [-imods REGEX;MODS+] [-import PACKAGE+]
    [+export PACKAGE|REGEX+] [-emods REGEX;MODS+]
    [-dimport PACKAGE+] [-explode] [-verbose]
    

    Table 24-3 bundler.sh Command Line Options

    ArgumentDescription

    -source JAR

    The path of the source JAR file to be bundled.

    -name NAME

    The symbolic name of the bundle. The root of the target JAR file name is derived from the name value.

    -version VERSION

    The bundle version number. All exported packages are qualified with a version attribute with this value. The target JAR file name contains the version number.

    -factory CLASS+

    An optional argument that specifies a space-delimited list of one or more factory classes that are to be instantiated and registered as OSGi services. Each service is registered with the OSGi service registry with name (-name) and version (-version) properties.

    This argument is incompatible with the -fragmenthost argument.

    -service INTERFACE+

    An optional argument that specifies a space-delimited list of one or more Java interfaces that are used as the object class of each factory object service registration. If no interface names are specified, or the number of interfaces specified does not match the number of factory classes, then each factory object will be registered under the factory class name.

    -fragmenthost HOST

    An optional argument indicating that the resultant bundle is a fragment bundle and specifies the symbolic name of the host bundle.

    This argument is incompatible with the -factory argument.

    -stagedir PATH

    An optional argument that specifies where to write temporary files when creating the target JAR file.

    Default: ./bundler.tmp

    -targetdir PATH

    An optional argument that specifies the location of the generated bundle JAR file.

    Default: current working directory (.).

    +import PACKAGE|REGEX+

    A space-delimited list of one or more packages or regular expressions that select the packages to exclude from the manifest Import-Package attribute.

    By default, all dependent packages will be imported (except java.*).

    -imods REGEX;MODS+

    The import modifiers will be applied to the packages matching regular expression.

    -import PACKAGE

    Additional packages to include on the manifest Import-Package attribute.

    Note that any specified import modifiers will not be applied.

    +export PACKAGE|REGEX+

    A space-delimited list of one or more packages or regular expressions that select the packages to exclude from the manifest Export-Package attribute.

    By default, all bundle packages will be exported.

    -emods REGEX;MODS+

    The export modifiers will be applied to the packages matching regular expression.

    -dimport PACKAGE+

    Packages to include on the manifest DynamicImport-Package attribute.

    -explode

    This optional flag specifies that the content of the source JAR should be exploded into the target JAR file.

    By default, the source JAR is nested within the target JAR file and the generated bundle manifest will contain an appropriate Bundle-Classpath attribute.

    -verbose

    An optional flag to enable verbose output.


    Example 24-2 shows how to use the bundler.sh to create an OSGi bundle for an Oracle JDBC driver.

    Example 24-2 Using the Bundler Utility

    bundler.sh \
        -source C:\drivers\com.oracle.ojdbc14_11.2.0.jar \
        -name oracle11g \
        -version 11.2.0 \
        -factory oracle.jdbc.xa.client.OracleXADataSource oracle.jdbc.OracleDriver \
        -service javax.sql.XADataSource java.sql.Driver \
        -targetdir C:\stage
    

    The source JAR is an Oracle driver located in directory C:\drivers. The name of the generated bundle JAR is the concatenation of the -name and -version arguments (oracle10g_11.2.0.jar) and is created in the C:\stage directory. The bundle JAR contains the files that Example 24-3 shows.

    Example 24-3 Bundle JAR Contents

       1465 Thu Jun 29 17:54:04 EDT 2006 META-INF/MANIFEST.MF
    1540457 Thu May 11 00:37:46 EDT 2006 com.oracle.ojdbc14_11.2.0.jar
       1700 Thu Jun 29 17:54:04 EDT 2006 com/bea/core/tools/bundler/Activator.class
    

    The command line options specify that there are two factory classes that will be instantiated and registered as an OSGi service when the bundle is activated, each under a separate object class as Table 24-4 shows.

    Table 24-4 Factory Class and Service Interfaces

    Factory ClassService Interface

    oracle.jdbc.xa.client.OracleXADataSource

    javax.sql.XADataSource

    oracle.jdbc.OracleDriver

    java.sql.Driver


    Each service registration will be made with a name property set to oracle11g and a version property with a value of 11.2.0. Example 24-4 shows the Oracle CEP server log messages showing the registration of the services.

    Example 24-4 Service Registration Log Messages

    ...
    INFO: [Jun 29, 2006 5:54:18 PM] Service REGISTERED: { version=11.2.0, name=oracle11g, objectClass=[ javax.sql.XADataSource ], service.id=23 }
    INFO: [Jun 29, 2006 5:54:18 PM] Service REGISTERED: { version=11.2.0, name=oracle11g, objectClass=[ java.sql.Driver ], service.id=24 }
    INFO: [Jun 29, 2006 5:54:18 PM] Bundle oracle11g STARTED
    ...
    
  3. Copy the application library JAR to the appropriate Oracle CEP server application library directory:

    1. If your bundle is a driver, you must put it in the library extensions directory.

      See Section 24.1.3.2, "Library Extensions Directory".

    2. If your bundle is not a driver, you may put it in the library directory.

      See Section 24.1.3.1, "Library Directory"

    For more information, see Section 24.1.3, "Application Libraries".

  4. Stop and start the Oracle CEP server.

    See "Starting and Stopping Oracle CEP Servers" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

24.3.3 How to Create an Application Library Using Oracle CEP IDE for Eclipse

This procedure describes how to create an OSGi bundle for your driver using the Oracle CEP IDE for Eclipse and deploy it on the Oracle CEP server.

This is the preferred method. If do not wish to manually configure the activator implementation, see Section 24.3.2, "How to Create an Application Library Using bundler.sh".

If you are creating an application library for a new JDBC driver, see "How to Access a Database Driver Using an Application Library Built With Oracle CEP IDE for Eclipse" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

To create an application library using Oracle CEP IDE for Eclipse:

  1. Using the Oracle CEP IDE for Eclipse, create a new Oracle CEP project.

    For more information, Section 4.2, "Creating Oracle CEP Projects".

  2. Right-click your project folder and select New > Folder.

  3. Enter lib in the Folder name field and click Finish.

  4. Outside of the Oracle CEP IDE for Eclipse, copy your JDBC JAR file into the lib folder.

  5. Inside the Oracle CEP IDE for Eclipse, right-click the lib folder and select Refresh.

    The JAR file appears in the lib folder as Figure 24-8 shows.

    Figure 24-8 Oracle CEP IDE for Eclipse lib Directory

    Description of Figure 24-8 follows

  6. Right-click the src directory and select New > Class.

    The Java Class dialog appears as Figure 24-9 shows.

    Figure 24-9 New Java Class Dialog

    Description of Figure 24-9 follows

  7. Configure the New Java Class dialog as Table 24-5 shows.

    Table 24-5 New Java Class Parameters

    ParameterDescription

    Package

    The package name. For example, com.foo.

    Name

    The name of the class. For example, MyActivator.


    Leave the other parameters at their default values.

  8. Click Finish.

    A new Java class is added to your project.

  9. Edit the Java class to implement it as Example 24-5 shows.

    Be sure to set the NAME and VERSION so that they supersede the existing version of JDBC driver. In this example, the existing version is:

    • oracle10g

    • 10.0.0

    To supersede the existing version, the MyActivator class sets these values to:

    • oracle11g

    • 11.2.0

    Example 24-5 MyActivator Class Implementation

    package com.foo;
     
    import java.util.Dictionary;
    import java.util.Properties;
     
    import javax.sql.XADataSource;
    import java.sql.Driver;
     
    import org.osgi.framework.BundleActivator;
    import org.osgi.framework.BundleContext;
    import org.osgi.framework.ServiceRegistration;
     
    public class MyActivator implements BundleActivator {
      
      private static final String NAME="oracle11g";
      private static final String VERSION="11.2.0";
      
      private String[] factories = {"oracle.jdbc.xa.client.OracleXADataSource","oracle.jdbc.OracleDriver"};
      private String[] interfaces= {"javax.sql.XADataSource","java.sql.Driver"};
      private ServiceRegistration[] serviceRegistrations = new ServiceRegistration[factories.length];
      
      public void start(BundleContext bc) throws Exception {
        Dictionary props = new Properties();
        props.put("name", NAME);
        props.put("version", VERSION);
        for (int i=0; i<factories.length; i++) {
          Object svc = bc.getBundle().loadClass(factories[i]).newInstance();
          serviceRegistrations[i] = bc.registerService(interfaces[i], svc, props);
        }
      }
     
      public void stop(BundleContext bc) throws Exception {
        for (int i=0; i<serviceRegistrations.length; i++) {
          serviceRegistrations[i].unregister();
        }
      }
    }
    
  10. Right-click the META-INF/MANIFEST.MF file and select Open With > Plug-in Manifest Editor.

    The Manifest Editor appears as Figure 24-10 shows.

    Figure 24-10 Manifest Editor: Overview Tab

    Description of Figure 24-10 follows

  11. Click the Runtime tab.

    The Runtime tab appears as Figure 24-11 shows.

    Figure 24-11 Manifest Editor: Runtime Tab

    Description of Figure 24-11 follows

  12. In the Classpath pane, click Add.

    The JAR Selection dialog appears as Figure 24-12 shows.

    Figure 24-12 JAR Selection Dialog

    Description of Figure 24-12 follows

  13. Expand the lib directory and select your database driver JAR file.

  14. Click OK.

  15. Click the Dependencies tab.

    The Dependencies tab appears as Figure 24-13 shows.

    Figure 24-13 Manifest Editor: Dependencies Tab

    Description of Figure 24-13 follows

  16. In the Imported Packages pane, click Add.

    The Package Selection dialog appears as Figure 24-14 shows.

    Figure 24-14 Package Selection Dialog

    Description of Figure 24-14 follows

  17. In the Exported Packages field, enter org.osgi.framework.

    The list box shows all the packages with that prefix as Figure 24-14 shows.

  18. Select org.osgi.framework in the list box and click OK.

  19. Click the MANIFEST.MF tab.

    The MANIFEST.MF tab appears as Figure 24-15 shows.

    Figure 24-15 Manifest Editor

    Description of Figure 24-15 follows

  20. Un-JAR your JAR to a temporary directory as Example 24-6 shows.

    Example 24-6 Un-JAR the Database Driver

    $ pwd
    /tmp
    $ ls com.*
    com.bea.oracle.ojdbc6_1.0.0.0_11-1-0-7.jar
    $ mkdir driver
    $ cd driver
    $ jar -xvf ../com.bea.oracle.ojdbc6_1.0.0.0_11-1-0-7.jar
    $ ls
    META-INF  oracle
    $ cd META-INF
    $ ls
    MANIFEST.MF  services
    
  21. Open your JAR MANIFEST.MF file and copy its Export-Package entry and paste it into the Manifest Editor as Example 24-7 shows.

    Example 24-7 Adding Export-Package to the Manifest Editor

    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: %project.name
    Bundle-SymbolicName: JDBCDriver
    Bundle-Version: 1.0.0
    Bundle-Localization: bundle
    Bundle-Vendor: %project.vendor
    Bundle-RequiredExecutionEnvironment: JavaSE-1.6
    Bundle-ClassPath: .
    Import-Package: com.bea.wlevs.configuration;version="11.1.1.4_0", ...
    Export-Package: oracle.core.lmx;version=1.0.0.0_11-1-0-7,oracle.core.l
     vf;version=1.0.0.0_11-1-0-7,oracle.jdbc;version=1.0.0.0_11-1-0-7,orac
     le.jdbc.aq;version=1.0.0.0_11-1-0-7,oracle.jdbc.connector;version=1.0
     .0.0_11-1-0-7,oracle.jdbc.dcn;version=1.0.0.0_11-1-0-7,oracle.jdbc.dr
     iver;version=1.0.0.0_11-1-0-7,oracle.jdbc.internal;version=1.0.0.0_11
     -1-0-7,oracle.jdbc.oci;version=1.0.0.0_11-1-0-7,oracle.jdbc.oracore;v
     ersion=1.0.0.0_11-1-0-7,oracle.jdbc.pool;version=1.0.0.0_11-1-0-7,ora
     cle.jdbc.rowset;version=1.0.0.0_11-1-0-7,oracle.jdbc.util;version=1.0
     .0.0_11-1-0-7,oracle.jdbc.xa;version=1.0.0.0_11-1-0-7,oracle.jdbc.xa.
     client;version=1.0.0.0_11-1-0-7,oracle.jpub.runtime;version=1.0.0.0_1
     1-1-0-7,oracle.net.ano;version=1.0.0.0_11-1-0-7,oracle.net.aso;versio
     n=1.0.0.0_11-1-0-7,oracle.net.jndi;version=1.0.0.0_11-1-0-7,oracle.ne
     t.ns;version=1.0.0.0_11-1-0-7,oracle.net.nt;version=1.0.0.0_11-1-0-7,
     oracle.net.resolver;version=1.0.0.0_11-1-0-7,oracle.security.o3logon;
     version=1.0.0.0_11-1-0-7,oracle.security.o5logon;version=1.0.0.0_11-1
     -0-7,oracle.sql;version=1.0.0.0_11-1-0-7,oracle.sql.converter;version
     =1.0.0.0_11-1-0-7
    
  22. Add a Bundle-Activator element to the Manifest Editor as Example 24-8 shows.

    The value of the Bundle-Activator is the fully qualified class name of your Activator class.

    Example 24-8 Adding a Bundle-Activator Element to the Manifest Editor

    Manifest-Version: 1.0
    Bundle-Activator: com.foo.MyActivator
    Bundle-ManifestVersion: 2
    Bundle-Name: %project.name
    Bundle-SymbolicName: JDBCDriver
    Bundle-Version: 1.0.0
    Bundle-Localization: bundle
    Bundle-Vendor: %project.vendor
    Bundle-RequiredExecutionEnvironment: JavaSE-1.6
    Bundle-ClassPath: .
    Import-Package: com.bea.wlevs.configuration;version="11.1.1.4_0", ...
    Export-Package: oracle.core.lmx;version=1.0.0.0_11-1-0-7, ...
    ...
    
  23. Add a DynamicImport-Package element to the Manifest Editor as Example 24-9 shows.

    Example 24-9 Adding a DynamicImport-Package Element to the Manifest Editor

    Manifest-Version: 1.0
    Bundle-Activator: com.foo.MyActivator
    Bundle-ManifestVersion: 2
    Bundle-Name: %project.name
    Bundle-SymbolicName: JDBCDriver
    Bundle-Version: 1.0.0
    Bundle-Localization: bundle
    Bundle-Vendor: %project.vendor
    Bundle-RequiredExecutionEnvironment: JavaSE-1.6
    Bundle-ClassPath: .
    DynamicImport-Package: * 
    Import-Package: com.bea.wlevs.configuration;version="11.1.1.4_0", ...
    Export-Package: oracle.core.lmx;version=1.0.0.0_11-1-0-7, ...
    ...
    
  24. Export your Oracle CEP application to a JAR file.

    For more information, see Section 4.5.1, "How to Export an Oracle CEP Project".

  25. Copy the bundler JAR to the appropriate Oracle CEP server application library directory:

    1. If your bundle is a driver, you must put it in the library extensions directory.

      See Section 24.1.3.2, "Library Extensions Directory".

    2. If your bundle is not a driver, you may put it in the library directory.

      See Section 24.1.3.1, "Library Directory"

    For more information, see Section 24.1.3, "Application Libraries".

  26. Stop and start the Oracle CEP server.

    See "Starting and Stopping Oracle CEP Servers" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

24.3.4 How to Update an Application Library Using Oracle CEP IDE for Eclipse

When you add, replace, or remove a JAR file in the application library extension or application library directory or their user-defined subdirectories, you must make this change in two places:

  • On the local Oracle CEP server you used to create a server runtime in the Oracle CEP IDE for Eclipse.

  • On the production Oracle CEP server to which you deploy dependent applications.

These changes need not be performed simultaneously: you must make the change to the local Oracle CEP server before making code changes to projects that depend on the application library change; you must make the change to the production Oracle CEP server before you deploy applications that depend on the application library change.

For more information, see Section 24.3, "Managing Application Libraries".

To update an application library using Oracle CEP IDE for Eclipse:

  1. Add a new or revised bundle to the application library extension or application library directory on the production Oracle CEP server.

    This is the server to which you will deploy applications that depend on this application library.

    To control library deployment order, organize your libraries in appropriately named subdirectories.

    For more information, see:

  2. Stop and start the production Oracle CEP server.

    The Oracle CEP server refreshes itself from the updated application library extension or application library directory.

    For more information, see:

  3. Add the same new or revised bundle to the application library extension or application library directory on your Oracle CEP IDE for Eclipse targeted runtime Oracle CEP server.

  4. Start the Oracle CEP IDE for Eclipse.

  5. Right click a project and select Refresh Targeted Runtimes.

    The Oracle CEP IDE for Eclipse refreshes this project from the updated application library extension or application library directory on your Oracle CEP IDE for Eclipse targeted runtime Oracle CEP server.

  6. If necessary, update your application's dependencies.

    For example, if you added a new bundle or changed the version of an existing bundle.

    For more information, see Section 24.1.2, "Application Dependencies".

  7. Assemble and deploy your application to the production Oracle CEP server.

    For more information, see Section 24.5, "Deploying Oracle CEP Applications".

    The dependencies you defined for this application in the Oracle CEP IDE for Eclipse at development time will be satisfied by the components you installed in the application library of your production Oracle CEP server at run time.

24.3.5 How to View an Application Library Using the Oracle CEP Visualizer

Using the Oracle CEP Visualizer, you can view the application libraries deployed to the Oracle CEP server.

You can view libraries from both the library extensions directory and libraries directory.


Note:

You cannot deploy an application library to an Oracle CEP server using the Oracle CEP Visualizer. You may only deploy Oracle CEP applications to an Oracle CEP server using the Oracle CEP Visualizer.


For more information, see:

24.4 Managing Log Message Catalogs

This section describes how to manage log message catalogs that you can use to localize an Oracle CEP application, including:

For more information, see:

24.4.1 Using Message Catalogs With Oracle CEP Server

A message catalog is a single XML file that contains a collection of text messages, with each message indexed by a unique identifier. You compile these XML files into classes using weblogic.i18ngen during the build process. (See weblogic.i18ngen Utility for more information). The methods of the resulting classes are the objects used to log messages at runtime.

Message catalogs support multiple locales or languages. For a specific message catalog there is exactly one default version, known as the top-level catalog, which contains the English version of the messages. Then there are corresponding locale-specific catalogs, one for each additional supported locale.

The top-level catalog (English version) includes all the information necessary to define the message. The locale-specific catalogs contain only the message ID, the date changed, and the translation of the message for the specific locale.

The message catalog files are defined by one of the following XML document type definition (DTD) files:

  • msgcat.dtd - Describes the syntax of top-level, default catalogs.

  • l10n_msgcat.dtd - Describes the syntax of locale-specific catalogs.

The DTDs are stored in ORACLE_CEP_HOEM/modules/com.bea.core.i18n.generator_1.4.0.0.jar.

You can create a single log message catalog for all logging requirements, or create smaller catalogs based on a subsystem or Java package. Oracle recommends using multiple subsystem catalogs so you can focus on specific portions of the log during viewing.

For simple text catalogs, we recommend creating a single catalog for each utility being internationalized

This section describes:

For more information, see:

24.4.1.1 Message Catalog Hierarchy

All messages must be defined in the default, top-level catalog.

Catalogs that provide different localizations of the base catalogs are defined in msgcat subdirectories named for the locale (for example, msgcat/de for Germany). You might have a top-level catalog named mycat.xml, and a German translation of it called ..de/mycat.xml. Typically the top-level catalog is English. However, English is not required for any catalogs.

Locale designations (for example, de) also have a hierarchy as defined in the java.util.Locale documentation. A locale can include a language, country, and variant. Language is the most common locale designation. Language can be extended with a country code. For instance, en\US, indicates American English. The name of the associated catalog is ..en\US\mycat.xml. Variants are vendor or browser-specific and are used to introduce minor differences (for example, collation sequences) between two or more locales defined by either language or country.

24.4.1.2 Guidelines for Naming Message Catalogs

Because the name of a message catalog file (without the .xml extension) is used to generate runtime class and property names, you should choose the name carefully.

Follow these guidelines for naming message catalogs:

  • Do not choose a message catalog name that conflicts with the names of existing classes in the target package for which you are creating the message catalog.

  • The message catalog name should only contain characters that are allowed in class names.

  • Follow class naming standards.

For example, the resulting class names for a catalog named Xyz.xml are XyzLogLocalizer and XyzLogger.

The following considerations also apply to message catalog files:

  • Message IDs are generally six-character strings with leading zeros. Some interfaces also support integer representations.


    Note:

    This only applies to log message catalogs. Simple text catalogs can have any string value.


  • Java lets you group classes into a collection called a package. Oracle recommends that a package name be consistent with the name of the subsystem in which a particular catalog resides. Consistent naming makes OSGi imports easier to define.

  • The log Localizer "classes" are actually ResourceBundle property files.

24.4.1.3 Using Message Arguments

The message body, message detail, cause, and action sections of a log message can include message arguments, as described by java.text.MessageFormat. Make sure your message contents conform to the patterns specified by java.text.MessageFormat. Only the message body section in a simple text message can include arguments. Arguments are values that can be dynamically set at runtime. These values are passed to routines, such as printing out a message. A message can support up to 10 arguments, numbered 0-9. You can include any subset of these arguments in any text section of the message definition (Message Body, Message Detail, Probable Cause), although the message body must include all of the arguments. You insert message arguments into a message definition during development, and these arguments are replaced by the appropriate message content at runtime when the message is logged.

The following excerpt from an XML log message definition shows how you can use message arguments. The argument number must correspond to one of the arguments specified in the method attribute. Specifically, {0} with the first argument, {1} with the second, and so on. In Example 24-10, {0} represents the file that cannot be opened, while {1} represents the file that will be opened in its place.

Example 24-10 Message Arguments

<messagebody>Unable to open file, {0}. Opening {1}. All arguments must be in body.</messagebody>

    <messagedetail> File, {0} does not exist. The server will restore the file
    contents from {1}, resulting in the use of default values for all future
    requests. </messagedetail>

    <cause>The file was deleted</cause>

    <action>If this error repeats then investigate unauthorized access to the
    file system.</action>

An example of a method attribute is as follows:

-method="logNoFile(String name, String path)"

The message example in Example 24-10 expects two arguments, {0} and {1}:

  • Both are used in the <messagebody>

  • Both are used in the <messagedetail>

  • Neither is used in <cause> or <action>


Note:

A message can support up to 10 arguments, numbered 0-9. You can include any subset of these arguments in any text section of the message definition (message detail, cause, action), although the message body must include all of the arguments


In addition, the arguments are expected to be of String type, or representable as a String type. Numeric data is represented as {n,number}. Dates are supported as {n,date}. You must assign a severity level for log messages. Log messages are generated through the generated Logger methods, as defined by the method attribute.

24.4.1.4 Message Catalog Formats

The catalog format for top-level and locale-specific catalog files is slightly different. The top-level catalogs define the textual messages for the base locale (by default, this is the English language). Locale-specific catalogs (for example, those translated to Spanish) only provide translations of text defined in the top-level version. Log message catalogs are defined differently from simple text catalogs.

24.4.1.4.1 Log Message Catalog

Example 24-11 shows a log message catalog, MyUtilLog.xml, containing one log message. This log message illustrates the usage of the messagebody, messagedetail, cause, and action elements.

Example 24-11 Log Message Catalog

<?xml version="1.0"?>
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" 
"http://www.bea.com/servers/wls90/dtd/msgcat.dtd">
<message_catalog 
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0"
  baseid="600000"
  endid="600100"
  <log_message
    messageid="600001"
    severity="warning"
    method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)"
    <messagebody>
      Could not open file, {0} on {1,date} after {2,number} attempts.
    </messagebody>
    <messagedetail>
      The configuration for this application will be defaulted to
      factory settings. Custom configuration information resides
      in file, {0}, created on {1,date}, but is not readable.
    </messagedetail>
    <cause>
      The user is not authorized to use custom configurations. Custom
     configuration information resides in file, {0}, created on
     {1,date}, but is not readable.The attempt has been logged to
     the security log.
    </cause>
    <action>
      The user needs to gain approriate authorization or learn to
      live with the default settings.
    </action>
  </log_message>
</message_catalog>

For more information, see Appendix G, "Schema Reference: Message Catalog msgcat.dtd".

24.4.1.4.2 Simple Text Catalog

Example 24-12 shows a simple text catalog, MyUtilLabels.xml, with one simple text definition.

Example 24-12 Simple Text Catalog

<?xml version="1.0"?> 
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd"
    "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> 
<message_catalog>
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0"
  <message>
    messageid="FileMenuTitle"
    <messagebody>
      File
    </messagebody>
  </message>
</message_catalog>

For more information, see Appendix G, "Schema Reference: Message Catalog msgcat.dtd".

24.4.1.4.3 Locale-Specific Catalog

Example 24-13 shows a French translation of a message that is available in ..\msgcat\fr\MyUtilLabels.xml.

Example 24-13 Locale-Specific Catalog

<?xml version="1.0"?>
<!DOCTYPE message_catalog PUBLIC 
   "weblogic-locale-message-catalog-dtd"
   "http://www.bea.com/servers/wls90/dtd/l10n_msgcat.dtd">
<locale_message_catalog 
  l10n_package="programs.utils"
  subsystem="MYUTIL" 
  version="1.0">
  <message>
    <messageid="FileMenuTitle">
    <messagebody> Fichier </messagebody>
  </message>
</locale_message_catalog>

When entering text in the messagebody, messagedetail, cause, and action elements, you must use a tool that generates valid Unicode Transformation Format-8 (UTF-8) characters, and have appropriate keyboard mappings installed. UTF-8 is an efficient encoding of Unicode character-strings that optimizes the encoding ASCII characters. Message catalogs always use UTF-8 encoding.

For more information, see Appendix H, "Schema Reference: Locale Message Catalog l10n_msgcat.dtd".

24.4.1.5 Message Catalog Localization

Catalog subdirectories are named after lowercase, two-letter ISO 639 language codes (for example, ja for Japanese and fr for French). You can find supported language codes in the java.util.Locale Javadoc.

Variations to language codes are achievable through the use of uppercase, two-letter ISO 3166 country codes and variants, each of which are subordinate to the language code. The generic syntax is lang\country\variant.

For example, zh is the language code for Chinese. CN is a country code for simplified Chinese, whereas TW is the country code for traditional Chinese. Therefore zh\CN and zh\TW are two distinct locales for Chinese.

Variants are of use when, for instance, there is a functional difference in platform vendor handling of specific locales. Examples of vendor variants are WIN, MAC, and POSIX. There may be two variants used to further qualify the locale. In this case, the variants are separated with an underscore (for example, Traditional_Mac as opposed to Modern_MAC).


Note:

Language, country, and variants are all case sensitive.


A fully-qualified locale would look like zh\TW\WIN, identifying traditional Chinese on a Win32 platform.

Message catalogs to support the above locale would involve the following files:

  • \*.xml - default catalogs

  • \zh\*.xml - Chinese localizations

  • \zh\TW\*.xml - Traditional Chinese localizations

  • \zh\TW\WIN\*.xml - Traditional Chinese localizations for Win32 code sets

Specific localizations do not need to cover all messages defined in parent localizations.

24.4.2 How to Parse a Message Catalog to Generate Logger and TextFormatter Classes for Localization

After you create your message catalog XML file, you can use the weblogic.i18ngen utility to create Logger and TextFormatter classes.

use the weblogic.i18ngen utility to parse message catalogs (XML files) to produce Logger and TextFormatter classes used for localizing the text in log messages. The utility creates or updates the i18n_user.properties properties file, which is used to load the message ID lookup class hashtable weblogic.i18n.L10nLookup.

Any errors, warnings, or informational messages are sent to stderr.

In order for user catalogs to be recognized, the i18n_user.properties file must reside in a directory identified in the Oracle CEP server classpath.

Oracle recommends that the i18n_user.properties file reside in the Oracle CEP server classpath. If the i18n_user.properties file is in targetdirectory, then targetdirectory should be in the Oracle CEP server classpath.

To parse a message catalog to generate Logger and TextFormatter classes:

  1. Create your message catalog XML file.

    See Section 24.4.1, "Using Message Catalogs With Oracle CEP Server".

  2. Set up your development environment.

    See "Setting Your Development Environment" in the Oracle Fusion Middleware Getting Started Guide for Oracle Complex Event Processing.

  3. Execute the weblogic.i18ngen utility using the following syntax:

    java weblogic.i18ngen [options] [filelist]
    

    Where:

    • options: see Table 24-6.

    • filelist: Process the files and directories in this list of files. If directories are listed, the command processes all XML files in the listed directories. The names of all files must include an XML suffix. All files must conform to the msgcat.dtd syntax. weblogic.i18ngen prints the fully-qualified list of names (Java source) to stdout for those files actually generated.

    Table 24-6 weblogic.i18ngen Utility Options

    OptionDescription

    -build

    Generates all necessary files and compiles them.

    The -build option combines the -i18n, -l10n, -keepgenerated, and -compile options.

    -d targetdirectory

    Specifies the root directory to which generated Java source files are targeted. User catalog properties are placed in i18n_user.properties, relative to the designated targetdirectory. Files are placed in appropriate directories based on the i18n_package and l10n_package values in the corresponding message catalog. The default target directory is the current directory. This directory is created as necessary.

    If this argument is omitted, all classes are generated in the current directory, without regard to any class hierarchy described in the message catalog.

    -n

    Parse and validate, but do not generate classes.

    -keepgenerated

    Keep generated Java source (located in the same directory as the class files).

    -ignore

    Ignore errors.

    -i18n

    Generates internationalizers (for example, Loggers and TextFormatters).

    -l10n

    Generates localizers (for example, LogLocalizers and TextLocalizers).

    -compile

    Compiles generated Java files using the current CLASSPATH. The resulting classes are placed in the directory identified by the -d option. The resulting classes are placed in the same directory as the source.

    Errors detected during compilation generally result in no class files or properties file being created. i18ngen exits with a bad exit status.

    -nobuild

    Parse and validate only.

    -debug

    Debugging mode.

    -dates

    Causes weblogic.i18ngen to update message timestamps in the catalog. If the catalog is writable and timestamps have been updated, the catalog is rewritten.



    Note:

    Utilities can be run from any directory, but if files are listed on the command line, then their path is relative to the current directory.


  4. Translate your log messages and generate the required localized resource bundles.

  5. Ensure that the i18n_user.properties file is in the Oracle CEP server classpath.

  6. Import the following packages in your Oracle CEP application:

    • weblogic.i18n.logging

    • weblogic.logging

  7. Assemble and deploy your application, including your log message resource bundles.

24.5 Deploying Oracle CEP Applications

After you assemble your Oracle CEP application, you deploy it to an Oracle CEP server domain.

This section describes:

For more information, see:

24.5.1 How to Deploy an Oracle CEP Application Using Oracle CEP IDE for Eclipse

You can deploy an Oracle CEP application using Oracle CEP IDE for Eclipse.

Using the Oracle CEP IDE for Eclipse, you can deploy an application to either a stand-alone or multi-server domain.


Note:

If you are using foreign stages, beware of the rules governing deployment and redeployment of dependent stages as Section 24.2.3, "Assembling Applications With Foreign Stages" describes.


To deploy an Oracle CEP application using Oracle CEP IDE for Eclipse:

  1. Assemble your Oracle CEP application.

    See Section 24.2, "Assembling an Oracle CEP Application."

  2. Use the Oracle CEP IDE for Eclipse to deploy your application.

    See Section 5.3.6, "How to Deploy an Application to an Oracle CEP Server".

24.5.2 How to Deploy an Oracle CEP Application Using Oracle CEP Visualizer

The simplest way to deploy an Oracle CEP application to an Oracle CEP server domain is to use the Oracle CEP Visualizer.

Using the Oracle CEP Visualizer, you can deploy an application to either a stand-alone or multi-server domain.


Note:

If you are using foreign stages, beware of the rules governing deployment and redeployment of dependent stages as Section 24.2.3, "Assembling Applications With Foreign Stages" describes.


To deploy an Oracle CEP application using Oracle CEP Visualizer:

  1. Assemble your Oracle CEP application.

    See Section 24.2, "Assembling an Oracle CEP Application."

  2. Start the Oracle CEP Visualizer.

    See Section 5.3.9, "How to Start the Oracle CEP Visualizer from Oracle CEP IDE for Eclipse".

  3. Use the Oracle CEP Visualizer to deploy your application.

    See "Deploying an Application" in the Oracle Fusion Middleware Visualizer User's Guide for Oracle Complex Event Processing.

24.5.3 How to Deploy an Oracle CEP Application Using the Deployer Utility

The following procedure describes how to deploy an application to Oracle CEP using the Deployer command-line utility.

Using the Deployer, you can deploy an application to either a stand-alone or multi-server domain.

For more information, see "Deployer Command-Line Reference" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.


Note:

If you are using foreign stages, beware of the rules governing deployment and redeployment of dependent stages as Section 24.2.3, "Assembling Applications With Foreign Stages" describes.


To deploy an Oracle CEP application using the Deployer utility:

  1. Assemble your Oracle CEP application.

    See Section 24.2, "Assembling an Oracle CEP Application."

  2. Open a command window and set your environment as described in "Setting Your Development Environment" in the Oracle Fusion Middleware Getting Started Guide for Oracle Complex Event Processing.

  3. Update your CLASSPATH variable to include the wlevsdeploy.jar JAR file, located in the ORACLE_CEP_HOME/ocep_11.1/bin directory where, ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as /oracle_cep.


    Note:

    If you are running the Deployer on a remote computer, see "Running the Deployer Utility Remotely" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.


  4. Be sure you have configured Jetty for the Oracle CEP instance to which you are deploying your application.

    For more information, see "Configuring Jetty for Oracle CEP" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

  5. In the command window, run the Deployer utility using the following syntax to install your application (in practice, the command should be on one line):

    prompt> java -jar wlevsdeploy.jar -url http://host:port/wlevsdeployer 
        -user user -password password -install application_jar_file
    

    where

    • host refers to the hostname of the computer on which Oracle CEP is running.

    • port refers to the port number to which Oracle CEP listens; default value is 9002.

      This port is specified in the DOMAIN_DIR/config/config.xml file that describes your Oracle CEP domain, where DOMAIN_DIR refers to your domain directory.

      The port number is the value of the <Port> child element of the <Netio> element:

      <Netio>
          <Name>NetIO</Name>
          <Port>9002</Port>
      </Netio>
      
    • user refers to the username of the Oracle CEP administrator.

    • password refers to the password of the Oracle CEP administrator.

    • application_jar_file refers to your application JAR file, assembled into an OSGi bundle as described in Section 24.2, "Assembling an Oracle CEP Application." This file must be located on the same computer from which you execute the Deployer utility.

      For example, if Oracle CEP is running on host ariel, listening on port 9002, username and password of the administrator is wlevs/wlevs, and your application JAR file is called myapp_1.0.0.0.jar and is located in the /applications directory, then the command is (in practice, the command should be on one line):

      prompt> java -jar wlevsdeploy.jar -url http://ariel:9002/wlevsdeployer 
          -user wlevs -password wlevs -install /applications/myapp_1.0.0.0.jar
      

    After the application JAR file has been successfully installed and all initialization tasks completed, Oracle CEP automatically starts the application and the adapter components immediately start listening for incoming events.

    The Deployer utility provides additional options to resume, suspend, update, and uninstall an application JAR file, as well as deploy an application to a specified group of a multi-server domain. For more information, see "Deployer Command-Line Reference" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.


    Note:

    You may only deploy to a group if the server is part of a multi-server domain (that is, if clustering is enabled). You may not deploy to a group if the server is part of a standalone-server domain (that is, if clustering is disabled). For more information, see "Overview of Oracle CEP Multi-Server Domain Administration" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.


    Oracle CEP uses the deployments.xml file to internally maintain its list of deployed application OSGi bundles. This file is located in the DOMAIN_DIR/servername directory, where DOMAIN_DIR refers to the main domain directory corresponding to the server instance to which you are deploying your application and servername refers to the actual server. See Appendix B, "Deployment Schema deployment.xsd" for information about this file. This information is provided for your information only; Oracle does not recommend updating the deployments.xml file manually.

PK='PKz\EOEBPS/store.htm Configuring Event Record and Playback

13 Configuring Event Record and Playback

This chapter describes how to configure event recording and playback for debugging Oracle Complex Event Processing (Oracle CEP) event processing networks, including how to specify an event persistence store and query the store.

13.1 Overview of Configuring Event Record and Playback

Oracle CEP event repository feature allows you to persist the events that flow out of a component of the event processing network (EPN) to a store, such as a database table, and then play them back at a later stage or explicitly query the events from a component such as an event bean.

A typical use case of this feature is the ability to debug a problem with a currently running application. If you have been recording the events at a node in the EPN when the problem occurred, you can later playback the same list of events to recreate the problem scenario for debugging purposes.

The following graphic shows the EPN of the Event Record and Playback example and demonstrates at what point events are recorded and where they are played back. The simpleEventSource adapter has been configured to record events; as indicated, the record happens as events flow out of the adapter. The eventStream channel has been configured to playback events; as indicated, the playback happens at the point where events flow into the channel.

Figure 13-1 Configuring Record and Playback in an EPN

Description of Figure 13-1 follows

This section describes:

13.1.1 Storing Events in the Persistent Event Store

When you record events, Oracle CEP server stores them in a persistent event store. You can use the persistent event store that Oracle CEP server provides or define your own:

13.1.1.1 Default Persistent Event Store

By default, Oracle CEP uses a Berkeley DB instance bundled with the Oracle CEP server to store recorded events.

Berkeley DB is a fast, scalable, transactional database engine with industrial grade reliability and availability. For more information, see:

By default, Oracle CEP server creates the Berkeley DB instance in:

ORACLE_CEP_HOME/user_projects/domains/domainname/servername/bdb

Where ORACLE_CEP_HOME refers to the directory in which you installed Oracle CEP (such as /oracle_home), domainname refers to the name of your domain, and servername refers to the name of your server (For example, /oracle_cep/user_projects/domains/mydomain/myserver).

You can change this default by configuring the bdb-config element db-env-path child element as Section 13.2.1, "Configuring an Event Store for Oracle CEP Server" describes.

13.1.1.2 Custom Persistent Event Store

Optionally, you can create a custom persistent event store provider to store recorded events. For example, you could specify a Relational Database Management System such as Oracle Database or Derby as your persistent event store.

For more information, see Section 13.3, "Creating a Custom Event Store Provider."

13.1.1.3 Persistent Event Store Schema

You do not create the actual database schema used to store the recorded events. Oracle CEP server automatically does this for you after you deploy an application that uses the record and playback feature and recording begins.

For more information, see Section 13.2.5, "Description of the Berkeley Database Schema".

13.1.2 Recording Events

You can configure recording for any component in the event processing network (EPN) that produces events: processors, adapters, streams, and event beans. Processors and streams always produce events; adapters and event beans must implement the EventSource interface. Additionally, you can configure that events from different components in the EPN be stored in different persistent stores, or that all events go to the same store. Note that only events that are outputted by the component are recorded.

You enable the recording of events for a component by updating its configuration file and adding the record-parameters element. Using the child elements of record-parameters, you specify the event store to which the events are recorded, an initial time period when recording should take place, the list of event types you want to store, and so on.

After you deploy the application and events start flowing through the network, recording begins either automatically because you configured it to start at a certain time or because you dynamically start it using administration tools. For each component you have configured for recording, Oracle CEP stores the events that flow out of it to the appropriate store along with a timestamp of the time it was recorded.

13.1.3 Playing Back Events

You can configure playback for any component in the event processing network (EPN): processors, adapters, streams, and event beans. Typically the playback component is a node later in the network than the node that recorded the events.

You enable the playback of events for a component by updating its configuration file and adding the playback-parameters element. Using the child elements of playback-parameters, you specify the event store from which the events are played back, the list event types you want to play back (by default all are played back), the time range of the recorded events you want to play back, and so on. By default, Oracle CEP plays back the events in a time accurate manner; however, you can also configure that the events get played back either faster or slower than they originally flowed out of the component from which they were recorded.

After you deploy the application and events start flowing through the network, you must start the playback by using the administration tools (Oracle CEP Visualizer or wlevs.Admin). Oracle CEP reads the events from the appropriate persistent store and inserts them into the appropriate place in the EPN.

It is important to note that when a component gets a playback event, it looks exactly like the original event. Additionally, a component later in the network has been configured to record events, then Oracle CEP records the playback events as well as the "real" events.

For more information, see:

13.1.4 Querying Stored Events

You can use the event store API to query a store for past events given a record time range and the component from which the events were recorded. The actual query you use depends on the event repository provider; for example, you would use Oracle CQL or EPL for the default persistent event store provider included with Oracle CEP. You can also use these APIs to delete old events from the event store.

13.1.5 Record and Playback Example

The sample code in this section is taken from the event record and playback example, located in the ORACLE_CEP_HOME\ocep_11.1\samples\source\applications\recplay directory, where ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as d:\oracle_cep.

For details about running and building the example, see "Event Record and Playback Example" in the Oracle Fusion Middleware Getting Started Guide for Oracle Complex Event Processing.

13.2 Configuring Event Record and Playback in Your Application

Depending on how you are going to use the event repository, there are different tasks that you must perform, as described in the following procedure that in turn point to sections with additional details.


Note:

It is assumed in this section that you have already created an Oracle CEP application along with its component configuration file(s) and that you want to update the application so that components record or playback events. If you have not, refer to Chapter 1, "Overview of Creating Oracle CEP Applications," for details.


To configure record and playback of events in your application:

  1. Optionally configure the Berkeley database event store for your Oracle CEP server instance.

    You may use the default Berkeley database configuration as is. You only need to make configuration changes to customize the location of the Berkeley database instance or to tune performance.

    See Section 13.2.1, "Configuring an Event Store for Oracle CEP Server."

  2. Configure a component in your EPN to record events by updating the component's configuration file.

    The component can be a processor, adapter, channel, or event bean. Only events flowing out of the component are recorded.

    See Section 13.2.2, "Configuring a Component to Record Events."

  3. Configure a component in your EPN to playback events by updating the component's configuration file.

    The component can be a processor, adapter, channel, or event bean. Only components that are also event sinks can playback events; events are played to the input side of the component.

    See Section 13.2.3, "Configuring a Component to Playback Events."

  4. Redeploy your application for the changes to take effect.

  5. If you have not specified an explicit start and end time for recording events, you must use Oracle CEP Visualizer or wlevs.Admin to start recording. You must always use these administration tools to start and end the playback of events.

    See Section 13.2.4, "Starting and Stopping the Record and Playback of Events."

13.2.1 Configuring an Event Store for Oracle CEP Server

You may use the default Berkeley database configuration as is. You only need to make configuration changes to customize the location of the Berkeley database instance or to tune performance.

For more information, see Section 13.3, "Creating a Custom Event Store Provider".

To configure an event store for Oracle CEP server:

  1. Stop your Oracle CEP server instance, if it is running.

  2. Using your favorite XML editor, open the server's config.xml file for edit.

    The config.xml file is located in the DOMAIN_DIR/servername/config directory of your server, where DOMAIN_DIR refers to the domain directory, such as /oracle_cep/user_projects/domains/myDomain and servername refers to the name of your server, such as defaultserver.

  3. Edit the bdb-config element to the config.xml file.

    Example 13-1 shows a fully configured bdb-config element.

    Example 13-1 bdb-config Element

    <bdb-config>
        <db-env-path>bdb</db-env-path>
        <cache-size>1000</cache-size>
    </bdb-config>
    

    Table 13-1 lists the child elements of bdb-config that you can specify.

    Table 13-1 Child Elements of bdb-config

    Child ElementDescription

    db-env-path

    Specifies the subdirectory in which Oracle CEP server creates Berkeley database instances relative to the DOMAIN_DIR/servername/config directory of your server, where DOMAIN_DIR refers to the domain directory, such as /oracle_cep/user_projects/domains/myDomain and servername refers to the name of your server, such as defaultserver.

    Default: bdb

    cache-size

    Specifies the amount of memory, in bytes, available for Berkeley database cache entries. You can adjust the cache size to tune Berkeley database performance.

    For more information, see:

    Default: je.maxMemoryPercent * JVM maximum memory


  4. Restart your Oracle CEP server instance.

13.2.2 Configuring a Component to Record Events

You can configure any processor, adapter, channel, or event bean in your application to record events. As with all other component configuration, you specify that a component records events by updating its configuration file. For general information about these configuration files, see Section 1.1.5, "Component Configuration Files."

This section describes the main steps to configure a component to record events. For simplicity, it is assumed in the procedure that you are configuring an adapter to record events and that you have already created its component configuration file.

See Section B.2, "Component Configuration Schema wlevs_application_config.xsd" for the complete XSD Schema that describes the event recording configuration file elements.

Using your favorite XML editor, open the component configuration XML file and add a record-parameters child element to the component you want to configure to record events. For example, to configure an adapter called simpleEventSource:

<?xml version="1.0" encoding="UTF-8"?>
  <n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <adapter>
        <name>simpleEventSource</name>
        <record-parameters>
          ...
       </record-parameters>
        ...
    </adapter>
    ...
</n1:config>

Add child elements to record-parameters to specify the name of the event store provider, the events that are stored, the start and stop time for recording, and so on. For example:

<adapter>
      <name>simpleEventSource</name>
      <record-parameters>
        <dataset-name>recplay_sample</dataset-name>
        <event-type-list>
            <event-type>SimpleEvent</event-type>
        </event-type-list>
        <batch-size>1</batch-size>
        <batch-time-out>10</batch-time-out>
      </record-parameters>
</adapter>

Table 13-2 lists the child elements of record-parameters that you can specify. Only dataset-name is required.

Table 13-2 Child Elements of record-parameters

Child ElementDescription

dataset-name

Specifies the group of data that the user wants to group together.

In the case of BDB provider, the dataset name will be used as the database environment in Berkeley database.

In the case of the Oracle RDBMS-based provider, it specifies the database area, or schema, in which the tables that store the recorded events are created.

When configuring the Oracle RDBMS-based provider, you are required to specify this element.

event-type-list

Specifies the event types that are recorded to the event store. If this element is not specified, then Oracle CEP records all event types that flow out of the component.

Use the event-type child component to list one or more events, such as:

  <event-type-list>
      <event-type>EventOne</event-type>
      <event-type>EventTwo</event-type>
  </event-type-list>

When configuring the Oracle RDBMS-based provider, you are required to specify this element.

time-range

Specifies the time period during which recording should take place using a start and end time.

The time period is configured by using a start child element to specify a start time and an end child element to specify the end time.

Express the start and end time as XML Schema dateTime values of the form:

yyyy-mm-ddThh:mm:ss

For example, to specify that recording should start on January 20, 2010, at 5:00am and end on January 20, 2010, at 6:00 pm, enter the following:

  <time-range>
    <start>2010-01-20T05:00:00</start>
    <end>2010-01-20T18:00:00</end>
  </time-range>

For complete details of the XML Schema dateTime format, see http://www.w3.org/TR/xmlschema-2/#dateTime-lexical-representation.

If you do not specify a time period, then no events are recorded when the application is deployed and recording will only happen after you explicitly start it using Oracle CEP Visualizer or wlevs.Admin.

You can specify time-range or time-range-offset, but not both.

time-range-offset

Specifies the time period during which recording should take place, using a start time and a duration.

The time period is configured by using a start child element to specify a start time and duration child element to specify the amount of time after the start time that recording should stop.

Express the start time as an XML Schema dateTime value of the form:

yyyy-mm-ddThh:mm:ss

Express the duration in the form:

hh:mm:ss

For example, to specify that recording should start on January 20, 2010, at 5:00am and continue for 3 hours, enter the following

  <time-range-offset>
    <start>2010-01-20T05:00:00</start>
    <duration>03:00:00</duration>
  </time-range-offset>

For complete details of the XML Schema dateTime format, see http://www.w3.org/TR/xmlschema-2/#dateTime-lexical-representation.

If you do not specify a time period, then no events are recorded when the application is deployed and recording will only happen after you explicitly start it using Oracle CEP Visualizer or wlevs.Admin.

You can specify time-range or time-range-offset, but not both.

batch-size

Specifies the number of events that Oracle CEP picks up in a single batch from the event buffer to write the event store.

Default value is 1000.

batch-time-out

Specifies the number of seconds that Oracle CEP waits for the event buffer window to fill up with the batch-size number of events before writing to the event store.

Default value is 60

max-size

If specified, Oracle CEP uses a stream when writing to the event store, and this element specifies the size of the stream, with non-zero values indicating asynchronous writes.

Default value is 1024.

max-threads

If specified, Oracle CEP uses a stream when writing to the event store, and this element specifies the maximum number of threads that will be used to process events for this stream. Setting this value has no effect when max-size is 0.

The default value is 1.


13.2.3 Configuring a Component to Playback Events

You can configure any processor, adapter, channel, or event bean in your application to playback events, although the component must be a node downstream of the recording component so that the playback component will actually receive the events and play them back. As with all other component configuration, you specify that a component plays back events by updating its configuration file. For general information about these configuration files, see Section 1.1.5, "Component Configuration Files."

This section describes the main steps to configure a component to play back events. For simplicity, it is assumed in the procedure that you are configuring a channel to playback events from a node upstream in the EPN that has recorded events, and that you have already created the channel's configuration file.

See for the complete XSD Schema that describes the event playback configuration file elements.

Using your favorite XML editor, open the component configuration XML file and add a playback-parameters child element to the component you want to configure to playback events. For example, to configure a channel called eventStream:

<?xml version="1.0" encoding="UTF-8"?>
  <n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <channel>
      <name>eventStream</name>
      <playback-parameters>
      ;_  ...
      </playback-parameters>
    </channel>
    ...
</n1:config>

Add child elements to playback-parameters to specify the name of the event store provider, the events that are played back, and so on. For example:

    <channel>
      <name>eventStream</name>
      <playback-parameters>
          <dataset-name>recplay_sample</dataset-name>
          <event-type-list>
              <event-type>SimpleEvent</event-type>
          </event-type-list>
      </playback-parameters>
    </channel>

Table 13-3 lists the child elements of playback-parameters that you can specify. Only dataset-name is required.

Table 13-3 Child Elements of playback-parameters

Child ElementDescription

dataset-name

Specifies the group of data that the user wants to group together.

In the case of BDB provider, the dataset name will be used as the database environment in Berkeley database.

In the case of the Oracle RDBMS-based provider, it specifies the database area, or schema, in which the tables that store the recorded events are queried for the playback events.

When configuring the Oracle RDBMS-based provider, you are required to specify this element.

event-type-list

Specifies the event types that are played back from the event store. If this element is not specified, then Oracle CEP plays back all event types.

Use the event-type child component to list one or more events, such as:

  <event-type-list>
      <event-type>EventOne</event-type>
      <event-type>EventTwo</event-type>
  </event-type-list>

When configuring the Oracle RDBMS-based provider, you are required to specify this element.

time-range

Specifies the time period during which play back should take place using a start and end time.

The time period is configured by using a start child element to specify a start time and an end child element to specify the end time.

Express the start and end time as XML Schema dateTime values of the form:

yyyy-mm-ddThh:mm:ss

For example, to specify that play back should start on January 20, 2010, at 5:00am and end on January 20, 2010, at 6:00 pm, enter the following:

  <time-range>
    <start>2010-01-20T05:00:00</start>
    <end>2010-01-20T18:00:00</end>
  </time-range>

For complete details of the XML Schema dateTime format, see http://www.w3.org/TR/xmlschema-2/#dateTime-lexical-representation.

If you do not specify a time period, then no events are played back when the application is deployed and play back will only happen after you explicitly start it using Oracle CEP Visualizer or wlevs.Admin.

You can specify time-range or time-range-offset, but not both.

time-range-offset

Specifies the time period during which play back should take place, using a start time and a duration.

The time period is configured by using a start child element to specify a start time and duration child element to specify the amount of time after the start time that play back should stop.

Express the start time as an XML Schema dateTime value of the form:

yyyy-mm-ddThh:mm:ss

Express the duration in the form:

hh:mm:ss

For example, to specify that play back should start on January 20, 2010, at 5:00am and continue for 3 hours, enter the following

  <time-range-offset>
    <start>2010-01-20T05:00:00</start>
    <duration>03:00:00</duration>
  </time-range-offset>

For complete details of the XML Schema dateTime format, see http://www.w3.org/TR/xmlschema-2/#dateTime-lexical-representation.

If you do not specify a time period, then no events are played back when the application is deployed and play back will only happen after you explicitly start it using Oracle CEP Visualizer or wlevs.Admin.

You can specify time-range or time-range-offset, but not both.

playback-speed

Specifies the playback speed as a positive float.

The default value is 1, which corresponds to normal speed. A value of 2 means that events will be played back 2 times faster than the original record speed. Similarly, a value of 0.5 means that events will be played back at half the speed.

repeat

Specifies whether to playback events again after the playback of the specified time interval is over.

Valid values are true and false. Default value is false. A value of true means that the repeat of playback continues an infinite number of times until it is deliberately stopped. False means that events will be played back only once.

max-size

If specified, Oracle CEP uses a stream when playing back events from the event store, and this element specifies the size of the stream, with non-zero values indicating asynchronous writes.

Default value is 1024.

max-threads

If specified, Oracle CEP uses a stream when playing back events from the event store, and this element specifies the maximum number of threads that will be used to process events for this stream. Setting this value has no effect when max-size is 0.

The default value is 1.


13.2.4 Starting and Stopping the Record and Playback of Events

After you configure the record and playback functionality for the components of an application, and you deploy the application to Oracle CEP, the server starts to record events only if you specified an explicit start/stop time in the initial configuration.

For example, if you included the following element in a component configuration:

<time-range>
    <start>2010-01-20T05:00:00</start>
    <end>2010-01-20T18:00:00</end>
</time-range>

then recording will automatically start on January 20, 2010 at 5:00 am.

The only way to start the playback of events, however, is by using Oracle CEP Visualizer or wlevs.Admin. You also use these tools to dynamically start and stop the recording of events.

For more information, see:

Visualizer and wlevs.Admin use managed beans (MBeans) to dynamically start and stop event recording and playback, as well as manage the event store configuration. A managed bean is a Java bean that provides a Java Management Extensions (JMX) interface. JMX is the Java EE solution for monitoring and managing resources on a network. You can create your own administration tool and use JMX to manage event store functionality by using the com.bea.wlevs.management.configuration.StageMBean.

For more information, see:

13.2.5 Description of the Berkeley Database Schema

When you configure a stage for event record and playback, you specify a dataset-name to identify the recorded data.

Oracle CEP server creates a subdirectory with this name below the db-env-path you specify in your bdb-config element.

For example, consider the bdb-config element is as Example 13-2 shows.

Example 13-2 Default bdb-config Element

<bdb-config>
    <db-env-path>bdb</db-env-path>
</bdb-config>

If your dataset-name is test1, then Oracle CEP server stores recorded data in directory:

ORACLE_CEP_HOME/user_projects/domains/domainname/servername/bdb/test1

Where ORACLE_CEP_HOME refers to the directory in which you installed Oracle CEP (such as /oracle_home), domainname refers to the name of your domain, and servername refers to the name of your server (For example, /oracle_cep/user_projects/domains/mydomain/myserver).

Within the data-set subdirectory, Oracle CEP creates a Berkeley database environment that contains a separate database for each event type you record. The database name is the same as the event type name as specified in the event type repository.

The database key is record time plus sequence number.

13.3 Creating a Custom Event Store Provider

Oracle CEP provides an event store API that you can use to create a custom event store provider. Oracle provides an RDBMS-based implementation for storing events in a relational database, or one that supports JDBC connections. If you want to store events in a different kind of database, or for some reason the Oracle RDBMS provider is not adequate for your needs, then you can create your own event store provider using the event store API.

The event store API is in the com.bea.wlevs.eventstore package; the following list describes the most important interfaces:

  • EventStore—Object that represents a single event store. The methods of this interface allow you to persist events to the store and to query the contents of the store using a provider-specific query.

  • EventStoreManager—Manages event stores. Only one instance of the EventStoreManager ever exists on a given Oracle CEP server, and this instance registers itself in the OSGi registry so that event store providers can in turn register themselves with the event store manager. You use this interface to find existing event stores, create new ones, get the provider for a given event store, and register an event provider. The event store manager delegates the actual work to the event store provider.

  • EventStoreProvider—Underlying repository that provides event store services to clients.

For more information, see the Oracle Fusion Middleware Java API Reference for Oracle Complex Event Processing.

PKyF)PKz\EOEBPS/server_tags.htm Schema Reference: Server Configuration wlevs_server_config.xsd

F Schema Reference: Server Configuration wlevs_server_config.xsd

This appendix provides a reference to elements of the welvs_server_config.xsd schema, the schema behind XML you use to configure Oracle CEP server attributes and services such as logging, Oracle Continuous Query Language (CQL), Secure Sockets Layer (SSL), Java Management Extensions (JMX), HTTP Publish-Subscribe, and more.

F.1 Overview of the Oracle CEP Server Configuration Elements

Oracle CEP provides a number of server configuration elements that you use to configure Oracle CEP server-specific attributes and services.

F.1.2 Example of an Oracle CEP Server Configuration File

The following sample Oracle CEP server configuration file from the HelloWorld application shows how to use many of the Oracle CEP elements:

<?xml version="1.0" encoding="UTF-8"?>
<n1:config xsi:schemaLocation="http://www.bea.com/ns/wlevs/config/server wlevs_server_config.xsd"
    xmlns:n1="http://www.bea.com/ns/wlevs/config/server" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <domain>
     <name>WLEventServerDomain</name>
  </domain>
 
  <netio>
    <name>NetIO</name>
    <port>9002</port>
  </netio>
  
  <netio>
    <name>sslNetIo</name>
    <ssl-config-bean-name>sslConfig</ssl-config-bean-name>
    <port>9003</port>
  </netio>
  
  <work-manager>
    <name>JettyWorkManager</name>
    <min-threads-constraint>5</min-threads-constraint>
    <max-threads-constraint>10</max-threads-constraint>
  </work-manager>
  
  <jetty>
    <name>JettyServer</name>
    <network-io-name>NetIO</network-io-name>
    <work-manager-name>JettyWorkManager</work-manager-name>
    <secure-network-io-name>sslNetIo</secure-network-io-name>
  </jetty>
    
  <rmi>
    <name>RMI</name>
    <http-service-name>JettyServer</http-service-name>
  </rmi>
 
  <jndi-context>
    <name>JNDI</name>
  </jndi-context>
 
  <exported-jndi-context>
    <name>exportedJndi</name>
    <rmi-service-name>RMI</rmi-service-name>
  </exported-jndi-context>
 
  <jmx>
    <rmi-service-name>RMI</rmi-service-name>
    <rmi-jrmp-port>9999</rmi-jrmp-port>
    <jndi-service-name>JNDI</jndi-service-name>
    <rmi-registry-port>9004</rmi-registry-port>
  </jmx>
  
  <ssl>
    <name>sslConfig</name>
    <key-store>./ssl/evsidentity.jks</key-store>
    <key-store-pass>
        <password>{Salted-3DES}s4YUEvH4Wl2DAjb45iJnrw==</password>
    </key-store-pass>
    <key-store-alias>evsidentity</key-store-alias>
    <key-manager-algorithm>SunX509</key-manager-algorithm>
    <ssl-protocol>TLS</ssl-protocol>
    <enforce-fips>false</enforce-fips>
    <need-client-auth>false</need-client-auth>
  </ssl>
  
  <http-pubsub>
    <name>pubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
      <server-config>
        <supported-transport>
          <types>
            <element>long-polling</element>
          </types>
        </supported-transport>
        <publish-without-connect-allowed>true</publish-without-connect-allowed>
      </server-config>
    <channels>
        <element>
          <channel-pattern>/evsmonitor</channel-pattern>
        </element>
        <element>
          <channel-pattern>/evsalert</channel-pattern>
        </element>
        <element>
          <channel-pattern>/evsdomainchange</channel-pattern>
        </element>
    </channels>
    </pub-sub-bean>
  </http-pubsub>
 
  <!-- Sample cluster configuration -->
  <!--
  <cluster>
    <server-name>myServer</server-name>
    <multicast-address>239.255.0.1</multicast-address>
    <enabled>coherence</enabled> 
    <security>none</security>
    <groups></groups>
  </cluster>
  -->
 
  <logging-service>
    <name>myLogService</name>    
    <log-file-config>myFileConfig</log-file-config>
    <stdout-config>myStdoutConfig</stdout-config>
    <logger-severity>Notice</logger-severity>
    <!-- logger-severity-properties is used to selectively enable logging for
     individual categories -->
    <!--logger-severity-properties>
      <entry>
        <key>org.springframework.osgi.extender.internal.dependencies.startup</key>
        <value>Debug</value>
      </entry>
    </logger-severity-properties-->
  </logging-service>
  
  <log-file>
    <name>myFileConfig</name>
    <rotation-type>none</rotation-type>
  </log-file>
 
  <log-stdout>
    <name>myStdoutConfig</name>
    <stdout-severity>Debug</stdout-severity>
  </log-stdout>
 
</n1:config>

F.2 auth-constraint

Use this element to configure an authorization constraint for a channel-constraints element.

For more information on channels, see channels.

F.2.1 Child Elements

The auth-constraint server configuration element supports the child elements that Table F-1 lists

Table F-1 Child Elements of: auth-constraint

XML TagTypeDescription

description

string

The description of the role.

role-name

string

A valid role name.

"Users, Groups, and Roles" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing


F.2.2 Attributes

The auth-constraint server configuration element has no attributes.

F.2.3 Example

The following example shows how to use the auth-constraint element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>myPubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
...
        <channel-constraints>
            <element>
...
                <auth-constraint>
                    <description>Administrators</description>
                    <role-name>admin</role-name>
                </auth-constraint>
            </element>
        </channel-constraints>
    </pub-sub-bean>
</http-pubsub>

F.3 bdb-config

Use this element to configure the default event store provider that uses a Berkeley database instance.

Optionally, you may configure Oracle CEP server to use a relational database instance as the event store provider as Section F.32, "rdbms-event-store-provider" describes.

F.3.1 Child Elements

The bdb-config server configuration element supports the child elements that Table F-2 lists

Table F-2 Child Elements of: bdb-config

XML TagTypeDescription

db-env-path

string

Specifies the subdirectory in which Oracle CEP server creates Berkeley database instances relative to the DOMAIN_DIR/servername/config directory of your server, where DOMAIN_DIR refers to the domain directory, such as /oracle_cep/user_projects/domains/myDomain and servername refers to the name of your server, such as defaultserver.

Default: bdb

cache-size

long

Specifies the amount of memory, in bytes, available for Berkeley database cache entries. You can adjust the cache size to tune Berkeley database performance.

For more information, see:

Default: je.maxMemoryPercent * JVM maximum memory


F.3.2 Attributes

The bdb-config server configuration element has no attributes.

F.3.3 Example

The following example shows how to use the bdb-config element in the Oracle CEP server configuration file:

<bdb-config>
    <db-env-path>bdb</db-env-path>
    <cache-size>1000</cache-size>
</bdb-config>

F.4 channels

Use this element to configure one or more channels for a pubsub-bean element.

Channel patterns always begin with a forward slash (/). Clients subscribe to these channels to either publish or receive messages

F.4.1 Child Elements

The channels server configuration element contains one or more element child elements that each contain a channel-pattern child element and zero or more message-filters child elements. Each message-filters child element contains an element child element with the string value of a message-filter-name that corresponds to a message-filters element.

F.4.2 Attributes

The channels server configuration element has no attributes.

F.4.3 Example

The following example shows how to use the channels element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>myPubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
        <server-config>
            <supported-transport>
                <types>
                    <element>long-polling</element>
                </types>
            </supported-transport>
            <publish-without-connect-allowed>
                true
            </publish-without-connect-allowed>
        </server-config>
        <channels>
            <element>
                <channel-pattern>/evsmonitor</channel-pattern>
            </element>
            <element>
                <channel-pattern>/evsalert</channel-pattern>
            </element>
            <element>
                <channel-pattern>/evsdomainchange</channel-pattern>
            </element>
        </channels>
    </pub-sub-bean>
</http-pubsub>

F.5 channel-constraints

Use this element to configure one or more channel constraints for a pubsub-bean element.

For more information on channels, see channels.

F.5.1 Child Elements

The channel-constraints server configuration element contains one or more element child element that each support the following child elements:

F.5.2 Attributes

The channel-constraints server configuration element has no attributes.

F.5.3 Example

The following example shows how to use the channel-constraints element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>myPubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
...
        <channel-constraints>
            <element>
                <channel-resource-collection>
                    <element>
                        <channel-resource-name>Foo</channel-resource-name>
                        <descriptions>
                            <element>Foo</element>
                        </descriptions>
                        <channel-patterns>
                            <element>Foo</element>
                        </channel-patterns>
                        <channel-operations>
                            <element>Foo</element>
                        </channel-operations>
                    </element>
                </channel-resource-collection>
                <auth-constraint>
                    <description>Foo</description>
                    <role-name>Foo</role-name>
                </auth-constraint>
            </element>
        </channel-constraints>
    </pub-sub-bean>
</http-pubsub>

F.6 channel-resource-collection

Use this element to configure one or more channel resource collections for a channel-constraints element.

For more information on channels, see channels.

F.6.1 Child Elements

The channel-resource-collection server configuration element contains zero or more element child elements that support the child elements that Table F-3 lists

Table F-3 Child Elements of: channel-resource-collection

XML TagTypeDescription

channel-resource-name

string

The name of this channel resource.

descriptions

string

Description of this channel resource collection.

This element contains an element child element with a string value.

channel-patterns

string

Specifies a channel pattern.

This element contains an element child element with a string value.

channel-operations

string

Specifies the operation to channel, validate values include:

  • create

  • delete

  • subscribe

  • publish

This element contains an element child element with a string value.


F.6.2 Attributes

The channel-resource-collection server configuration element has no attributes.

F.6.3 Example

The following example shows how to use the channel-resource-collection element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>myPubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
...
        <channel-constraints>
            <element>
                <channel-resource-collection>
                    <element>
                        <channel-resource-name>Foo</channel-resource-name>
                        <descriptions>
                            <element>Foo</element>
                        </descriptions>
                        <channel-patterns>
                            <element>Foo</element>
                        </channel-patterns>
                        <channel-operations>
                            <element>Foo</element>
                        </channel-operations>
                    </element>
                </channel-resource-collection>
                <auth-constraint>
                    <description>Foo</description>
                    <role-name>Foo</role-name>
                </auth-constraint>
            </element>
        </channel-constraints>
    </pub-sub-bean>
</http-pubsub>

F.7 cluster

Use this element to configure a cluster component in the Oracle CEP server.

For more information, see "Administrating Multi-Server Domains With Oracle CEP Native Clustering" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

F.7.1 Child Elements

The cluster server configuration element supports the child elements that Table F-4 lists.

Table F-4 Child Elements of: cluster

string

XML TagTypeDescription

name

string

The name of this cluster. For more information, see name.

server-name

string

Specifies a unique name for the server. Oracle CEP Visualizer uses the value of this element when it displays the server in its console.

Default value:

  • Oracle CEP native clustering: WLEvServer-identity where identity is the value of the identity element.

  • Oracle Coherence: WLEvServer-identity where identity is the member ID as determined by Oracle Coherence.

server-host-name

string

Specifies the host address or IP used for point-to-point HTTP multi-server communication. Default value is the IP address associated with the default NIC for the machine.

multicast-address

This child element is required unless all servers of the multi-server domain are hosted on the same computer; in that case you can omit the multicast-address element and Oracle CEP automatically assigns a multicast address to the multi-server domain based on the computer's IP address.

If, however, the servers are hosted on different computers, then you must provide an appropriate domain-local address. Oracle recommends you use an address of the form 239.255.X.X, which is what the auto-assigned multicast address is based on.

All the Oracle CEP servers using this multicast-address must be on the same subnet.

Using Oracle Coherence, there is also an extension: if you use a unicast address then Oracle Coherence will be configured in Well Known Address (WKA) mode. This is necessary in environments that do not support multicast.

multicast-interface

string

The name of the interface that the multicast address should be bound to. This can be one of:

  • Simple name, such as eth0.

  • IP address to which the NIC is bound, such as 192.168.1.2.

  • IP address and network mask to which the NIC is bound separated by a /, such as 192.68.1.2/255.255.255.0.

multicast-port

int

Specifies the port used for multicast traffic. Default value is 9100.

identity

string

Applicable only to Oracle CEP native clustering: specifies the server's identity and must be an integer between 1 and INT_MAX. Oracle CEP numerically compares the server identities during multi-server operations; the server with the lowest identity becomes the domain coordinator. Be sure that each server in the multi-server domain has a different identity; if servers have the same identity, the results of multi-server operations are unpredictable.

Not applicable to Oracle Coherence.

enabled

See Description

Specifies whether or not the cluster is enabled. Valid values:

  • coherence

  • evs4j

  • true: cluster is enabled (Oracle Coherence mode)

  • false: cluster is not enabled (default).

security

See Description

Specifies the type of security for this cluster. Valid values:

  • none—Default value. Specifies that no security is configured for the multi-server domain.

  • encrypt—Specifies that multi-server messages should be encrypted.

groups

string

Specifies a comma-separated list of the names of the groups this cluster belongs to. For more information, see "Groups" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

operation-timeout

int

Specifies, in milliseconds, the timeout for point-to-point HTTP multi-server requests. Default value is 30000.


F.7.2 Attributes

The cluster server configuration element has no attributes.

F.7.3 Example

The following example shows how to use the cluster element in the Oracle CEP server configuration file:

<cluster>
    <name>MyCluster</name>
    <server-name>myServer1</server-name>
    <multicast-address>239.255.0.1</multicast-address>
    <identity>1</identity> 
    <enabled>true</enabled>
</cluster> 

In the example, the cluster element's unique identifier is MyCluster.

F.8 connection-pool-params

Use this element to specify connection pool-related data-source parameters.

F.8.1 Child Elements

The connection-pool-params server configuration element supports the child elements that Table F-5 lists.

Table F-5 Child Elements of: connection-pool-params

XML TagTypeDescription

statement-timeout

int

The time after which a statement currently being executed will time out. statement-timeout relies on underlying JDBC driver support. The server passes the time specified to the JDBC driver using the java.sql.Statement.setQueryTimeout method. If your JDBC driver does not support this method, it may throw an exception and the timeout value is ignored. A value of -1 disables this feature. A value of 0 means that statements will not time out.

Default: -1.

profile-harvest-frequency-seconds

int

The number of seconds between diagnostic profile harvest operations.

Default: 300.

inactive-connection-timeout-seconds

int

The number of inactive seconds on a reserved connection before the connection is reclaimed and released back into the connection pool.

Default: 0.

shrink-frequency-seconds

int

The number of seconds to wait before shrinking a connection pool that has incrementally increased to meet demand.

Default: 900.

driver-interceptor

string

Specifies the absolute name of the application class used to intercept method calls to the JDBC driver. The application specified must implement the weblogic.jdbc.extensions.DriverInterceptor interface.

seconds-to-trust-an-idle-pool-connection

int

The number of seconds within a connection use that the server trusts that the connection is still viable and will skip the connection test, either before delivering it to an application or during the periodic connection testing process.

Default: 10.

pinned-to-thread

boolean

This option can improve performance by enabling execute threads to keep a pooled database connection even after the application closes the logical connection.

Default: false.

test-connections-on-reserve

boolean

Test a connection before giving it to a client. Requires that you specify test-table-name.

Default: false.

profile-type

int

Specifies that type of profile data to be collected.

statement-cache-type

string

The algorithm used for maintaining the prepared statements stored in the statement cache. Valid values:

  • LRU - when a new prepared or callable statement is used, the least recently used statement is replaced in the cache

  • FIXED - the first fixed number of prepared and callable statements are cached

Default: LRU.

connection-reserve-timeout-seconds

int

The number of seconds after which a call to reserve a connection from the connection pool will timeout. When set to 0, a call will never timeout. When set to -1, a call will timeout immediately.

Default: -1.

credential-mapping-enabled

boolean

Enables the server to set a light-weight client ID on the database connection based on a map of database IDs when an application requests a database connection.

Default: false.

login-delay-seconds

int

The number of seconds to delay before creating each physical database connection. This delay supports database servers that cannot handle multiple connection requests in rapid succession. The delay takes place both during initial data source creation and during the lifetime of the data source whenever a physical database connection is created.

Default: 0.

test-table-name

string

The name of the database table to use when testing physical database connections. This name is required when you specify test-frequency-seconds and enable test-reserved-connections. The default SQL code used to test a connection is select count(*) from test-table-name where test-table-name is the value of the test-table-name element. Most database servers optimize this SQL to avoid a table scan, but it is still a good idea to set test-table-name to the name of a table that is known to have few rows, or even no rows. If test-table-name begins with SQL, then the rest of then the rest of the string following that leading token will be taken as a literal SQL statement that will be used to test connections instead of the standard query.

statement-cache-size

int

The number of prepared and callable statements stored in the cache between 1 and 1024. This may increase server performance.

Default: 10.

init-sql

string

SQL statement to execute that will initialize newly created physical database connections. Start the statement with SQL followed by a space.

connection-creation-retry-frequency-seconds

int

The number of seconds between attempts to establish connections to the database. If you do not set this value, data source creation fails if the database is unavailable. If set and if the database is unavailable when the data source is created, the server will attempt to create connections in the pool again after the number of seconds you specify, and will continue to attempt to create the connections until it succeeds. When set to 0, connection retry is disabled.

Default: 0.

test-frequency-seconds

int

The number of seconds between when the server tests unused connections. (Requires that you specify a Test Table Name.) Connections that fail the test are closed and reopened to re-establish a valid physical connection. If the test fails again, the connection is closed. In the context of multi data sources, this attribute controls the frequency at which the server checks the health of data sources it had previously marked as unhealthy. When set to 0, the feature is disabled.

Default: 120.

jdbc-xa-debug-level

int

Specifies the JDBC debug level for XA drivers.

Default: 10.

initial-capacity

int

The number of physical connections to create when creating the connection pool in the data source. If unable to create this number of connections, creation of the data source will fail.

Default: 1.

max-capacity

int

The maximum number of physical connections that this connection pool can contain.

Default: 15.

capacity-increment

int

The number of connections created when new connections are added to the connection pool.

Default: 1.

highest-num-waiters

int

The maximum number of connection requests that can concurrently block threads while waiting to reserve a connection from the data source's connection pool.

Default: Integer.MAX_VALUE.


F.8.2 Attributes

The connection-pool-params server configuration element has no attributes.

F.8.3 Example

The following example shows how to use the connection-pool-params element in the Oracle CEP server configuration file:

<data-source>
    <name>orads</name>
    <xa-params>
        <keep-xa-conn-till-tx-complete>true</keep-xa-conn-till-tx-complete>
    </xa-params>
    <driver-params>
        <url>jdbc:oracle:thin:@localhost:1521:ce102</url>
        <driver-name>oracle.jdbc.OracleDriver</driver-name>
        <properties>
            <element>
                <name>user</name>
                <value>wlevs</value>
            </element>
            <element>
                <name>password</name>
                <value>wlevs</value>
            </element>
        </properties>
    </driver-params>
    <connection-pool-params>
        <initial-capacity>5</initial-capacity>
        <max-capacity>10</max-capacity>
        <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
        <test-frequency-seconds>5</test-frequency-seconds>
    </connection-pool-params>
    <data-source-params>
        <jndi-names>
            <element>orads</element>
        </jndi-names>
        <global-transactions-protocol>None</global-transactions-protocol>
    </data-source-params>
</data-source>

F.9 cql

Use this element to configure Oracle CQL-specific options in the Oracle CEP server.

F.9.1 Child Elements

The cql server configuration element supports the following child elements:

F.9.2 Attributes

The cql server configuration element has no attributes.

F.9.3 Example

The following example shows how to use the cql element in the Oracle CEP server configuration file:

<cql>
    <name>myCQL</name>
    <storage>
        <folder>myfolder</folder>
        <metadata-name>myname</metadata-name>
    </storage>
    <scheduler>
        <class-name>myclass</class-name>
        <threads>10</threads>
        <direct-interop>false</direct-interop>
    </scheduler>
</cql>

In the example, the cql element's unique identifier is myCQL.

F.10 data-source

This configuration type defines configuration for a DataSource service.

F.10.1 Child Elements

The data-source server configuration element supports the following child elements:

F.10.2 Attributes

The data-source server configuration element has no attributes.

F.10.3 Example

The following example shows how to use the data-source element in the Oracle CEP server configuration file:

<data-source>
    <name>orads</name>
    <driver-params>
        <url>jdbc:oracle:thin:@localhost:1521:ce102</url>
        <driver-name>oracle.jdbc.OracleDriver</driver-name>
        <properties>
            <element>
                <name>user</name>
                <value>wlevs</value>
            </element>
            <element>
                <name>password</name>
                <value>wlevs</value>
            </element>
        </properties>
    </driver-params>
    <connection-pool-params>
        <initial-capacity>5</initial-capacity>
        <max-capacity>10</max-capacity>
        <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
        <test-frequency-seconds>5</test-frequency-seconds>
    </connection-pool-params>
    <data-source-params>
        <jndi-names>
            <element>orads</element>
        </jndi-names>
        <global-transactions-protocol>None</global-transactions-protocol>
    </data-source-params>
</data-source>

In the example, the data-source element's unique identifier is orads.

F.11 data-source-params

Use this element to specify data source-related data-source parameters.

F.11.1 Child Elements

The data-source-params server configuration element supports the child elements that Table F-6 lists.

Table F-6 Child Elements of: data-source-params

XML TagTypeDescription

algorithm-type

See Description

The algorithm determines the connection request processing for the multi data source. Valid values:

  • Failover

  • Load-Balancing

Default: Failover.

stream-chunk-size

int

Specifies the data chunk size for steaming data types between 1 and 65536.

Default: 256.

row-prefetch

boolean

Specifies whether or not multiple rows to be prefetched (that is, sent from the server to the client) in one server access.

Default: false.

data-source-list

string

The list of data sources to which the multi data source will route connection requests. The order of data sources in the list determines the failover order.

failover-request-if-busy

boolean

For multi data sources with the Failover algorithm, enables the multi data source to failover connection requests to the next data source if all connections in the current data source are in use.

Default: false.

row-prefetch-size

int

If row prefetching is enabled, specifies the number of result set rows to prefetch for a client between 2 and 65536.

Default: 48.

jndi-names

See Description

The JNDI path to where this Data Source is bound. By default, the JNDI name is the name of the data source. This element contains the following child elements:

  • element: contains the string name of a valid data-source element. For more information, see data-source.

  • config-data-source-DataSourceParams-JNDINames.

scope

boolean

Specifies the scoping of the data source. Note that Global is the only scoped supported by MSA.

Default: Global.

connection-pool-failover-callback-handler

string

The name of the application class to handle the callback sent when a multi data source is ready to failover or fail back connection requests to another data source within the multi data source. The name must be the absolute name of an application class that implements the weblogic.jdbc.extensions.ConnectionPoolFailoverCallback interface.

global-transactions-protocol

int

Determines the transaction protocol (global transaction processing behavior) for the data source. Valid values:

  • TwoPhaseCommit - Standard XA transaction processing. Requires an XA driver

  • LoggingLastResource - A performance enhancement for one non-XA resource

  • EmulateTwoPhaseCommit - Enables one non-XA resource to participate in a global transaction, but has some risk to data

  • OnePhaseCommit - One-phase XA transaction processing using a non-XA driver. This is the default setting

  • None - Support for local transactions only

Default: OnePhaseCommit.


F.11.2 Attributes

The data-source-params server configuration element has no attributes.

F.11.3 Example

The following example shows how to use the data-source-params element in the Oracle CEP server configuration file:

<data-source>
    <name>orads</name>
    <xa-params>
        <keep-xa-conn-till-tx-complete>true</keep-xa-conn-till-tx-complete>
    </xa-params>
    <driver-params>
        <url>jdbc:oracle:thin:@localhost:1521:ce102</url>
        <driver-name>oracle.jdbc.OracleDriver</driver-name>
        <properties>
            <element>
                <name>user</name>
                <value>wlevs</value>
            </element>
            <element>
                <name>password</name>
                <value>wlevs</value>
            </element>
        </properties>
    </driver-params>
    <connection-pool-params>
        <initial-capacity>5</initial-capacity>
        <max-capacity>10</max-capacity>
        <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
        <test-frequency-seconds>5</test-frequency-seconds>
    </connection-pool-params>
    <data-source-params>
        <jndi-names>
            <element>orads</element>
        </jndi-names>
        <global-transactions-protocol>None</global-transactions-protocol>
    </data-source-params>
</data-source>

F.12 driver-params

Use this element to specify JDBC driver-related data-source parameters.

F.12.1 Child Elements

The driver-params server configuration element supports the child elements that Table F-7 lists.

Table F-7 Child Elements of: driver-params

XML TagTypeDescription

use-xa-data-source-interface

boolean

Specifies that the server should use the XA interface of the JDBC driver. If the JDBC driver class used to create database connections implements both XA and non-XA versions of a JDBC driver, you can set this attribute to indicate that the server should treat the JDBC driver as an XA driver or as a non-XA driver.

Default: true.

password

string

The password attribute passed to the JDBC driver when creating physical database connections.

driver-name

string

The full package name of JDBC driver class used to create the physical database connections in the connection pool in the data source.

url

string

The URL of the database to connect to. The format of the URL varies by JDBC driver. The URL is passed to the JDBC driver to create the physical database connections.

properties

string

Specifies the list of properties passed to the JDBC driver when creating physical database connections. This element contains one or more element child elements that contain child elements:

  • name: the property name.

  • value: the property value.


F.12.2 Attributes

The driver-params server configuration element has no attributes.

F.12.3 Example

The following example shows how to use the driver-params element in the Oracle CEP server configuration file:

<data-source>
    <name>orads</name>
    <xa-params>
        <keep-xa-conn-till-tx-complete>true</keep-xa-conn-till-tx-complete>
    </xa-params>
    <driver-params>
        <url>jdbc:oracle:thin:@localhost:1521:ce102</url>
        <driver-name>oracle.jdbc.OracleDriver</driver-name>
        <properties>
            <element>
                <name>user</name>
                <value>wlevs</value>
            </element>
            <element>
                <name>password</name>
                <value>wlevs</value>
            </element>
        </properties>
    </driver-params>
    <connection-pool-params>
        <initial-capacity>5</initial-capacity>
        <max-capacity>10</max-capacity>
        <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
        <test-frequency-seconds>5</test-frequency-seconds>
    </connection-pool-params>
    <data-source-params>
        <jndi-names>
            <element>orads</element>
        </jndi-names>
        <global-transactions-protocol>None</global-transactions-protocol>
    </data-source-params>
</data-source>

F.13 domain

Use this element to configure a domain name in the Oracle CEP server.

F.13.1 Child Elements

The domain server configuration element supports the following child elements:

F.13.2 Attributes

The domain server configuration element has no attributes.

F.13.3 Example

The following example shows how to use the domain element in the Oracle CEP server configuration file:

<domain>
    <name>WLEventServerDomain</name>
</domain>

In the example, the domain's unique identifier is WLEventServerDomain.

F.14 debug

Use this element to configure one or more debug properties for the Oracle CEP server.

F.14.1 Child Elements

The debug server configuration element supports the child elements that Table F-8 lists.

Table F-8 Child Elements of: debug

XML TagTypeDescription

name

string

The name of this debug configuration. For more information, see name.

debug-properties

string

One or more child elements formed by taking a debug flag name (without its package name) and specifying a value of true.

For more information including a full list of all debug flags, see "How to Configure Oracle CEP Debugging Options Using a Configuration File" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing


F.14.2 Attributes

The debug server configuration element has no attributes.

F.14.3 Example

The following example shows how to use the debug element to turn on Simple Declarative Services (SDS) debugging using debug flag com.bea.core.debug.DebugSDS in the Oracle CEP server configuration file.

<debug>
    <name>myDebug</name>
    <debug-properties>
        <DebugSDS>true</DebugSDS>
...
    </debug-properties>
</debug>

F.15 event-store

Use this element to configure an event store for the Oracle CEP server.

F.15.1 Child Elements

The event-store server configuration element supports the child elements that Table F-9 lists.

Table F-9 Child Elements of: event-store

XML TagTypeDescription

name

string

The name of this debug configuration. For more information, see name.

provider-order

string

Specifies the name of one or more provider child elements in the order in which the Oracle CEP server should access them.

For more information, see:


F.15.2 Attributes

The event-store server configuration element has no attributes.

F.15.3 Example

The following example shows how to use the event-store element in the Oracle CEP server configuration file:

<config>
    <event-store>
        <name>myEventStore</name>
        <provider-order>
            <provider>provider1</provider>
            <provider>provider2</provider>
        </provider-order>
    </event-store>
</config>

In the example, the adapter's unique identifier is myEventStore.

F.16 exported-jndi-context

This configuration type is used to export a remote JNDI service that may be accessed via clients using RMI. It registers the JNDI context with the RMI service, so that it may be accessed remotely by clients that pass a provider URL parameter when they create their InitialContext object. This service requires that a jndi-context configuration object also be specified. If it is not, then this service will not be able to start.

F.16.1 Child Elements

The exported-jndi-context server configuration element supports the child elements that Table F-10 lists.

Table F-10 Child Elements of: exported-jndi-context

XML TagTypeDescription

name

string

The name of this debug configuration. For more information, see name.

rmi-service-name

string

The name of the RMI service that should be used to serve this JNDI context over the network. It must match an existing RMI object in the configuration. For more information, see rmi.


F.16.2 Attributes

The exported-jndi-context server configuration element has no attributes.

F.16.3 Example

The following example shows how to use the exported-jndi-context element in the Oracle CEP server configuration file:

<rmi>
    <name>myRMI</name>
    <http-service-name>TestJetty</http-service-name>
</rmi>

<exported-jndi-context>
    <name>RemoteJNDI</name>
    <rmi-service-name>myRMI</rmi-service-name>
</exported-jndi-context>

In the example, the adapter's unique identifier is RemoteJNDI.

F.17 http-pubsub

Use this element to configure an HTTP publish-subscribe service.

F.17.1 Child Elements

The http-pubsub server configuration element supports the following child elements:

F.17.2 Attributes

The http-pubsub server configuration element has no attributes.

F.17.3 Example

The following example shows how to use the http-pubsub element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>myPubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
        <server-config>
            <supported-transport>
                <types>
                    <element>long-polling</element>
                </types>
            </supported-transport>
            <publish-without-connect-allowed>
                true
            </publish-without-connect-allowed>
        </server-config>
        <channels>
            <element>
                <channel-pattern>/evsmonitor</channel-pattern>
            </element>
            <element>
                <channel-pattern>/evsalert</channel-pattern>
            </element>
            <element>
                <channel-pattern>/evsdomainchange</channel-pattern>
            </element>
        </channels>
    </pub-sub-bean>
</http-pubsub>

In the example, the http-pubsub element's unique identifier is myPubsub.

F.18 jetty

Use this element to configure an instance of the Jetty HTTP server.

F.18.1 Child Elements

The jetty server configuration element supports the child elements that Table F-11 lists.

Table F-11 Child Elements of: jetty

XML TagTypeDescription

name

string

The name of this jetty element. For more information, see name.

network-io-name

string

The name of the Network I/O service that should be used. This also defines which port the server listens on. This parameter must refer to the name of a valid "netio" configuration object.

work-manager-name

string

The name of the Work Manager that should be used for thread pooling. If this parameter is not specified, then Jetty will use a default work manager. For more information, see work-manager.

scratch-directory

string

The name of a directory where temporary files required for Web applications, JSPs, and other types of Web artifacts are kept. This parameter is overridden by the scratch-directory parameter on the jetty-web-app element. If this directory does not exist, it will be created.

debug-enabled

boolean

Enable debugging in the Jetty code. Specified debug messages are logged the same way as all other Debug level messages in the log service.

listen-port

int

The name of the network port that should be set. This parameter may not be set if the network-io-name parameter is not specified. When this parameter is used instead of network-io-name, a simplified socket I/O subsystem is used that does not require the netio module.

secure-network-io-name

string

The name of the Network I/O service that should be used for secure communications. The specified service must be configured to support SSL encryption. This parameter must refer to the name of a valid netio configuration object.


F.18.2 Attributes

The jetty server configuration element has no attributes.

F.18.3 Example

The following example shows how to use the jetty element in the Oracle CEP server configuration file:

<jetty>
    <name>TestJetty</name>
    <work-manager-name>WM</work-manager-name>
    <network-io-name>Netio</network-io-name>
    <secure-network-io-name>SecureNetio</secure-network-io-name>
    <debug-enabled>false</debug-enabled>
    <scratch-directory>JettyWork</scratch-directory>
</jetty>

In the example, the jetty element's unique identifier is TestJetty.

F.19 jetty-web-app

Use this element to represent a Web application for use by Jetty. Each instance of this object represents a Web application which must be deployed using the Jetty service.

F.19.1 Child Elements

The jetty-web-app server configuration element supports the child elements that Table F-12 lists.

Table F-12 Child Elements of: jetty-web-app

XML TagTypeDescription

name

string

The name of this jetty-web-app element. For more information, see name.

context-path

string

The context path where this web app will be deployed in the web server's name space.

Default:/

scratch-directory

string

The location where Jetty should store temporary files for this web app. This parameter overrides the scratch-directory parameter on the jetty element. If this directory does not exist, it will be created.

path

string

A file name that points to the location of the web app on the server. It may be a directory or a WAR file.

jetty-name

string

The name of the Jetty service where this Web application should be deployed. This name must match the name of an existing jetty configuration object. For more information, see jetty.


F.19.2 Attributes

The jetty-web-app server configuration element has no attributes.

F.19.3 Example

The following example shows how to use the jetty-web-app element in the Oracle CEP server configuration file:

<jetty-web-app>
    <name>financial</name>
    <context-path>/financial</context-path>
    <path>../testws2/financialWS.war</path>
    <jetty-name>TestJetty</jetty-name>
</jetty-web-app> 

In the example, the jetty-web-app element's unique identifier is financial.

F.20 jmx

Use this element to configure Java Management Extension (JMX) properties in the Oracle CEP server.

F.20.1 Child Elements

The jmx server configuration element supports the child elements that Table F-13 lists.

Table F-13 Child Elements of: jmx

XML TagTypeDescription

name

string

The name of this debug configuration. For more information, see name.

rmi-service-name

string

The name of the RMI service that should be used to serve this JNDI context over the network. It must match an existing RMI object in the configuration. For more information, see rmi.

jndi-service-name

string

The name of the JNDI service to which the JMX server will bind its object.


F.20.2 Attributes

The jmx server configuration element has no attributes.

F.20.3 Example

The following example shows how to use the jmx element in the Oracle CEP server configuration file:

<jmx>
    <name>myJMX</name>
    <jndi-service-name>JNDI</jndi-service-name>
    <rmi-service-name>RMI</rmi-service-name>
</jmx>

In the example, the jmx element's unique identifier is myJMX.

F.21 jndi-context

This configuration object is used to configure the JNDI provider. When it is placed in the configuration, the MSA JNDI Context is initialized. One instance of this configuration type must be placed in the configuration if the JNDI service is to be used, either locally, or remotely through the exported-jndi-context configuration type.

F.21.1 Child Elements

The jndi-context server configuration element supports the child elements that Table F-14 lists.

Table F-14 Child Elements of: jndi-context

XML TagTypeDescription

name

string

The name of this debug configuration. For more information, see name.

default-provider

string

This parameter defaults to true. If it is set to false then the provider will not be installed as the default. The provider will be set as the default as long as there is at least one JNDIContextType bean in the configuration with DefaultProvider set to true. If multiple JNDIContextType objects are placed in the configuration, the effect will be the same as if one was started.


F.21.2 Attributes

The jndi-context server configuration element has no attributes.

F.21.3 Example

The following example shows how to use the jndi-context element in the Oracle CEP server configuration file:

<jndi-context>
    <name>myJNDI</name>
    <default-provider>true</default-provider>
</jndi-context>

In the example, the adapter's unique identifier is myJNDI.

F.22 log-file

Use this element to configure logging to a file on the Oracle CEP server.

F.22.1 Child Elements

The log-file server configuration element supports the child elements that Table F-15 lists.

Table F-15 Child Elements of: log-file

XML TagTypeDescription

name

string

The name of this work-manager element. For more information, see name.

number-of-files-limited

boolean

Determines whether old rotated files need to be kept around forever.

Default: false.

rotation-type

string

Determines how the log file rotation will be performed based on size, time or not at all. Valid values:

  • bySize

  • byTime

  • none

Default: bySize.

rotation-time

string

The time in k:mm format when the first rotation happens where k is the hour specified in 24-hour notation and mm is the minutes.

Default: 00:00.

rotated-file-count

int

If old rotated files are to be deleted, this parameter determines how many of the last files to always keep.

Default: 7.

rotation-size

int

The size threshold at which the log file is rotated in KB.

Default: 500.

rotation-time-span-factor

long

The factor that is applied to the timespan to arrive at the number of milliseconds that will be the frequency of time based log rotations.

Default: (long)(3600 * 1000).

rotation-time-span

int

The interval for every time based log rotation.

Default: 24.

base-log-file-name

string

Log file name.

Default: server.log

rotate-log-on-startup-enabled

boolean

Specifies whether the log file will be rotated on startup.

Default: true.

log-file-severity

string

Specifies the threshold importance of the messages that are propagated to the handlers. The default is Info so that to see Debug and Trace messages you need to ensure that the severity is set to either Debug or Trace. Valid values:

  • Emergency

  • Alert

  • Critical

  • Error

  • Warning

  • Notice

  • Info

  • Debug

  • Trace

Default: Notice.

log-file-rotation-dir

string

The directory where the old rotated files are stored. If not set, the old files are stored in the same directory as the base log file.


F.22.2 Attributes

The log-file server configuration element has no attributes.

F.22.3 Example

The following example shows how to use the log-file element in the Oracle CEP server configuration file:

<log-file>
    <name>logFile</name>
    <number-of-files-limited>true</number-of-files-limited>
    <rotated-file-count>4</rotated-file-count>
    <rotate-log-on-startup-enabled>true</rotate-log-on-startup-enabled>
</log-file>

In the example, the log-file element's unique identifier is logFile.

F.23 log-stdout

Use this element to configure logging to standard out (console) on the Oracle CEP server.

F.23.1 Child Elements

The log-stdout server configuration element supports the child elements that Table F-16 lists.

Table F-16 Child Elements of: log-stdout

XML TagTypeDescription

name

string

The name of this work-manager element. For more information, see name.

stack-trace-depth

int

Determines the number of stack trace frames to display on standard out. All frames are displayed in the log file. A value of -1 means all frames are displayed.

Default: -1.

stack-trace-enabled

boolean

Specifies whether to dump stack traces to the console when included in a logged message.

Default: true.

stdout-severity

string

Defines the threshold importance of the messages that are propagated to the handlers. The default is Info so that to see Debug and Trace messages you need to ensure that the severity is set to either Debug or Trace. Valid values:

  • Emergency

  • Alert

  • Critical

  • Error

  • Warning

  • Notice

  • Info

  • Debug

  • Trace

Default: Notice.


F.23.2 Attributes

The log-stdout server configuration element has no attributes.

F.23.3 Example

The following example shows how to use the log-stdout element in the Oracle CEP server configuration file:

<log-stdout>
    <name>logStdout</name>
    <stdout-severity>Debug</stdout-severity>
</log-stdout>

In the example, the log-stdout element's unique identifier is logStdout.

F.24 logging-service

Use this element to configure a logging service on the Oracle CEP server.

F.24.1 Child Elements

The logging-service server configuration element supports the child elements that Table F-17 lists.

Table F-17 Child Elements of: logging-service

XML TagTypeDescription

name

string

The name of this work-manager element. For more information, see name.

log-file-config

string

The configuration of the log file and its rotation policies.

stdout-config

string

The configuration of the stdout output.

logger-severity

string

Defines the threshold importance of the messages that are propagated to the handlers. The default is Info so that to see Debug and Trace messages you need to ensure that the severity is set to either Debug or Trace. Valid values:

  • Emergency

  • Alert

  • Critical

  • Error

  • Warning

  • Notice

  • Info

  • Debug

  • Trace

Default: Info.

logger-severity-properties

See Description

The Severity values for different nodes in the Logger tree composed of one or more entry child elements each containing a key and value child element.


F.24.2 Attributes

The logging-service server configuration element has no attributes.

F.24.3 Example

The following example shows how to use the logging-service element in the Oracle CEP server configuration file:

<logging-service>
    <name>myLogService</name>
    <stdout-config>myStdoutConfig</stdout-config>
    <logger-severity>Notice</logger-severity>
    <logger-severity-properties>
      <entry>
        <key>FileAdapter</key>
        <value>Debug</value>
      </entry>
      <entry>
        <key>CQLProcessor</key>
        <value>Debug</value>
      </entry>
    </logger-severity-properties>
</logging-service>

In the example, the logging-service element's unique identifier is myLogService.

F.25 message-filters

Use this element to configure one or more message filters for a pubsub-bean element.

F.25.1 Child Elements

The message-filters server configuration element contains one or more element child elements that each contain a message-filter-name and message-filter-class child element.

F.25.2 Attributes

The message-filters server configuration element has no attributes.

F.25.3 Example

The following example shows how to use the message-filters element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>pubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
...
      <message-fitlers>
        <element>
          <message-filter-name>Foo</message-filter-name>
          <message-filter-class>Foo</message-filter-class>
        </element>
        <element>
          <message-filter-name>Foo</message-filter-name>
          <message-filter-class>Foo</message-filter-class>
        </element>
      </message-filters>
...
    </pub-sub-bean>
</http-pubsub>

F.26 name

Use this element to declare a unique identifier for an Oracle CEP server configuration element.

F.26.1 Child Elements

The name server configuration element has no child elements.

F.26.2 Attributes

The name server configuration element has no attributes.

F.26.3 Example

The following example shows how to use the name element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>pubsub</name>
    <path>/pubsub</path>
...
</http-pubsub>

F.27 netio

Use this element to represent a network input/output (IO) service, that may be used by other services to act as the server for network IO.

F.27.1 Child Elements

The netio server configuration element supports the child elements that Table F-18 lists.

Table F-18 Child Elements of: netio

XML TagTypeDescription

name

string

The name of this netio element. For more information, see name.

ssl-config-bean-name

string

The name of the SSL configuration object to use. If not null, then this client will create secure sockets using the specified SSL configuration. If not set, then no SSL will be supported.

provider-type

string

Specify which provider to use for the underlying socket implementation. For a list of the valid provider types, see "Network IO Providers" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

io-threads

int

A hint to the provider as to the number of threads to use for processing sockets. A value of zero will result in the provider choosing based on its own default.Default: 0.

port

int

The port to listen on. The server will immediately start to listen for incoming connections on this port.

listen-address

string

The address on which this instance of Netio should listen for incoming connections. It may be set to a numeric IP address in the a.b.c.d format, or to a host name. If not set, then netio will listen on all network interfaces. Note that the value of this parameter cannot be validated until the server actually starts.


F.27.2 Attributes

The netio server configuration element has no attributes.

F.27.3 Example

The following example shows how to use the netio element in the Oracle CEP server configuration file:

<netio>
    <name>myNetio</name>
    <port>12345</port>
</netio>

In the example, the netio element's unique identifier is myNetio.

F.28 netio-client

Use this element to register a network input/output (IO) service that may be used to perform non-blocking network IO, but which will not act as a server and listen for incoming connections.

F.28.1 Child Elements

The netio-client server configuration element supports the child elements that Table F-19 lists.

Table F-19 Child Elements of: netio-client

XML TagTypeDescription

name

string

The name of this netio element. For more information, see name.

ssl-config-bean-name

string

The name of the SSL configuration object to use. If not null, then this client will create secure sockets using the specified SSL configuration. If not set, then no SSL will be supported.

provider-type

string

Specify which provider to use for the underlying socket implementation. For a list of the valid provider types, see "Network IO Providers" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.


F.28.2 Attributes

The netio-client server configuration element has no attributes.

F.28.3 Example

The following example shows how to use the netio-client element in the Oracle CEP server configuration file:

<netio-client>
    <name>netiossl</name>
    <ssl-config-bean-name>sslConfig</ssl-config-bean-name>
    <provider-type>NIO</provider-type>
</netio-client>

In the example, the netio-client element's unique identifier is netiossl.

F.29 partition-order-capacity

Use this element to define the maximum capacity of a query partition when the ordering-constraint attribute is set to PARTITION_ORDERED. Set this on a cql component. Consider setting this element's value when you've configured a query processor for parallel execution, and when the query's ordering-constraint attribute is set to PARTITION_ORDERED.

The element's default value is 4.

For more information, including best practices and information on the locations where this value can be set (including their precedence), see "Using partition-order-capacity with Partitioning Queries" in Chapter 10, "Configuring Oracle CQL Processors".

F.29.1 Child Elements

The partition-order-capacity element has no child elements.

F.29.2 Attributes

The partition-order-capacity element has no attributes.

F.29.3 Example

The following example shows how to use the partition-order-capacity element in the Oracle CEP server configuration file:

<cql>
    <name>myCQL</name>
    <partition-order-capacity>20</partition-order-capacity>
</cql>

F.30 path

Use this element to configure the path for an http-pubsub element.

F.30.1 Child Elements

The path element has no child elements.

F.30.2 Attributes

The path element has no attributes.

F.30.3 Example

The following example shows how to use the path element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>myPubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
        <server-config>
            <supported-transport>
                <types>
                    <element>long-polling</element>
                </types>
            </supported-transport>
            <publish-without-connect-allowed>
                true
            </publish-without-connect-allowed>
        </server-config>
        <channels>
            <element>
                <channel-pattern>/evsmonitor</channel-pattern>
            </element>
            <element>
                <channel-pattern>/evsalert</channel-pattern>
            </element>
            <element>
                <channel-pattern>/evsdomainchange</channel-pattern>
            </element>
        </channels>
    </pub-sub-bean>
</http-pubsub>

F.31 pubsub-bean

Use this element to configure a publish-subscribe bean for an http-pubsub element.

F.31.1 Child Elements

The pubsub-bean server configuration element supports the following child elements:

F.31.2 Attributes

The pubsub-bean server configuration element has no attributes.

F.31.3 Example

The following example shows how to use the pubsub-bean element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>myPubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
        <server-config>
            <supported-transport>
                <types>
                    <element>long-polling</element>
                </types>
            </supported-transport>
            <publish-without-connect-allowed>
                true
            </publish-without-connect-allowed>
        </server-config>
        <channels>
            <element>
                <channel-pattern>/evsmonitor</channel-pattern>
            </element>
            <element>
                <channel-pattern>/evsalert</channel-pattern>
            </element>
            <element>
                <channel-pattern>/evsdomainchange</channel-pattern>
            </element>
        </channels>
    </pub-sub-bean>
</http-pubsub>

F.32 rdbms-event-store-provider

Use this element to configure an event store provider that uses a relational database management system in the Oracle CEP server.

By default, Oracle CEP server uses a Berkeley database instance as the event store provider as Section F.3, "bdb-config" describes.

F.32.1 Child Elements

The rdbms-event-store-provider server configuration element supports the child elements that Table F-20 lists.

Table F-20 Child Elements of: rdbms-event-store-provider

XML TagTypeDescription

name

string

The name of this debug configuration. For more information, see name.

init-timeout

int

The maximum time (in milliseconds) that the Oracle CEP server will wait for this provider to initialize.

Default: 10000 ms.

data-source-name

string

The name of a data source element. For more information, see data-source.

user-policy-attributes

See Description

One or more entry child elements that each contain a key and value child element that you use to specify additional data source properties.


F.32.2 Attributes

The rdbms-event-store-provider server configuration element has no attributes.

F.32.3 Example

The following example shows how to use the rdbms-event-store-provider element in the Oracle CEP server configuration file:

<rdbms-event-store-provider>
    <name>test-rdbms-provider</name>
    <init-timeout>10000</init-timeout>
    <data-source-name>derby1</data-source-name>
    <user-policy-attributes>
        <entry>
            <key>key1</key>
            <value>value1</value>
        </entry>
            <key>key1</key>
            <value>value1</value>
        <entry>
        </entry>
    </user-policy-attributes>
</rdbms-event-store-provider>

In the example, the rdbms-event-store-provider element's unique identifier is test-rdbms-provider.

F.33 rmi

Use this element to configure an RMI service, which allows server- side objects to be exported to remote clients.

F.33.1 Child Elements

The rmi server configuration element supports the child elements that Table F-21 lists.

Table F-21 Child Elements of: rmi

XML TagTypeDescription

name

string

The name of this rmi element. For more information, see name.

heartbeat-period

int

The number of failed heartbeat attempts before triggering disconnect notifications to all registered listeners.Default-Value: 4.

http-service-name

string

The name of the HTTP service that this service should use to register remote objects. The service may be provided by a Jetty or Tomcat instance of the same name.

heartbeat-interval

int

The time in milliseconds between heartbeats. Once the number of unsuccessful heartbeat attempts has reached the value specified by the HeartbeatPeriod attribute, all registered DisconnectListener instances will be notified.

Default-Value: 5000.


F.33.2 Attributes

The rmi server configuration element has no attributes.

F.33.3 Example

The following example shows how to use the rmi element in the Oracle CEP server configuration file:

<rmi>
    <name>myRMI</name>
    <http-service-name>TestJetty</http-service-name>
</rmi>

In the example, the rmi element's unique identifier is myRMI.

F.34 scheduler

Use this element to configure cql scheduler options in the Oracle CEP server.

F.34.1 Child Elements

The scheduler server configuration element supports the child elements that Table F-22 lists.

Table F-22 Child Elements of: scheduler

XML TagTypeDescription

class-name

string

Specify the value for one of the sched_name scheduling option as the fully qualified package name of Java class that implements the Oracle CEP Service Engine scheduling algorithm. This class determines in what order the Oracle CEP Service Engine scheduler executes Oracle CQL queries. Valid values:

  • oracle.cep.execution.scheduler.RoundRobinScheduler: This algorithm assigns time slices to each Oracle CQL query in equal portion and in order, handling all processes without priority. This option is appropriate if the number of Oracle CQL queries is not prone to large variations.

  • oracle.cep.execution.scheduler.FIFOScheduler: This algorithm assigns time slices to each Oracle CQL query in the order that they were created. This algorithm is appropriate if the number of Oracle CQL queries is prone to large variations.

Default: oracle.cep.execution.scheduler.RoundRobinScheduler

runtime

long

Total number of seconds that the Oracle CEP Service Engine scheduler will run.

Default: 1000000 ms.

time-slice

int

The frequency at which the Oracle CEP Service Engine scheduler executes Oracle CQL queries.

Default: 1000 ms

schedule-on-new-thread

boolean

Whether or not the Oracle CEP Service Engine scheduler will use a separate thread. Options are:

  • true: the scheduler runs in a separate thread.

  • false: the scheduler runs in the same thread as the Oracle CEP Service Engine (Default).


F.34.2 Attributes

The scheduler server configuration element has no attributes.

F.34.3 Example

The following example shows how to use the scheduler element in the Oracle CEP server configuration file:

<cql>
    <name>myCQL</name>
    <scheduler>
        <class-name>oracle.cep.execution.scheduler.FIFOScheduler</class-name>
    </scheduler>
</cql>

F.35 server-config

Use this element to configure the server-specific properties of a pubsub-bean element.

F.35.1 Child Elements

The server-config server configuration element supports the child elements that Table F-23 lists.

Table F-23 Child Elements of: server-config

XML TagTypeDescription

name

string

The name of this server-config element. For more information, see name.

supported-transport

See Description

This element contains one or more types child elements, one for each supported transport. Each types child element contains an element child element with the transport name as a string value. Valid values:

  • long-polling: Using this transport, the client requests information from Oracle CEP server and if Oracle CEP server does not have information available, it does not reply until it has. When the Oracle CEP server replies, the client typically sends another request immediately.

  • callback-polling: Use this transport for HTTP publish-subscribe applications using a cross domain configuration in which the browser downloads the page from one Web server (including the JavaScript code) and connects to another server as an HTTP publish-subscribe client. This is required by the Bayeux protocol. For more information on the Bayeux protocol, see http://svn.xantus.org/shortbus/trunk/bayeux/bayeux.html.

For more information, see "How the HTTP Pub-Sub Server Works" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

client-timeout-secs

int

Specifies the number of seconds after which the HTTP pub-sub server disconnects a client if the client does has not sent back a connect/reconnect message.

Default: 60.

persistent-client-timeout-secs

int

Specifies the number of seconds after which persistent clients are disconnected and deleted by the pub-sub server, if during that time the persistent client does not send a connect or re-connect message. This value must be larger than client-timeout-secs. If the persistent client reconnects before the persistent timeout is reached, the client receives all messages that have been published to the persistent channel during that time; if the client reconnects after the timeout, then it does not get the messages.

Default: 600 seconds.

interval-millisecs

int

Specifies how long (in milliseconds) the client can delay subsequent requests to the /meta/connect channel.

Default: 500 ms.

work-manager

string

Specifies the name of the work manager that delivers messages to clients. The value of this element corresponds to the value of the name child element of the work-manager you want to assign.

For more information, see work-manager.

publish-without-connect-allowed

boolean

Specifies whether clients can publish messages without having explicitly connected to the HTTP pub-sub server. Valid values:

  • true

  • false


F.35.2 Attributes

The server-config server configuration element has no attributes.

F.35.3 Example

The following example shows how to use the server-config element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>pubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
      <server-config>
        <name>/pubsub</name>
        <supported-transport>
          <types>
            <element>long-polling</element>
          </types>
        </supported-transport>
        <publish-without-connect-allowed>true</publish-without-connect-allowed>
      </server-config>
    <channels>
        <element>
          <channel-pattern>/evsmonitor</channel-pattern>
        </element>
        <element>
          <channel-pattern>/evsalert</channel-pattern>
        </element>
        <element>
          <channel-pattern>/evsdomainchange</channel-pattern>
        </element>
      </channels>
    </pub-sub-bean>
</http-pubsub>

F.36 services

Use this element to configure the service properties of a pubsub-bean element.

F.36.1 Child Elements

The services server configuration element contains one or more element child elements that each support the child elements that Table F-24 lists.

Table F-24 Child Elements of: services

XML TagTypeDescription

service-channel

string

Specifies a service channel, for example: /service/echo.

service-class

string

Specifies the class to service this service, for example: EchoService.

service-method

string

Define a service method in the service class. The service method must have only one payload parameter of type Object. For example: Object echo(Object payload).


F.36.2 Attributes

The services server configuration element has no attributes.

F.36.3 Example

The following example shows how to use the services element in the Oracle CEP server configuration file:

<http-pubsub>
    <name>pubsub</name>
    <path>/pubsub</path>
    <pub-sub-bean>
      <server-config>
        <name>/pubsub</name>
        <supported-transport>
          <types>
            <element>long-polling</element>
          </types>
        </supported-transport>
        <publish-without-connect-allowed>true</publish-without-connect-allowed>
      </server-config>
    <channels>
        <element>
          <channel-pattern>/evsmonitor</channel-pattern>
        </element>
        <element>
          <channel-pattern>/evsalert</channel-pattern>
        </element>
        <element>
          <channel-pattern>/evsdomainchange</channel-pattern>
        </element>
      </channels>
      <services>
          <element>
              <service-channel>Foo</service-channel>
              <service-class>Foo</service-class>
              <service-method>Foo</service-method>
          </element>
      </services>
    </pub-sub-bean>
</http-pubsub>

F.37 show-detail-error-message

Use this element to configure whether or not the Oracle CEP server uses secure connections.

F.37.1 Child Elements

The show-detail-error-message server configuration element supports the child elements that Table F-25 lists.

Table F-25 Child Elements of: show-detail-error-message

XML TagTypeDescription

name

string

The name of this show-detail-error-message element. For more information, see name.

value

boolean

Whether or not to show detailed error messages. Valid values:

  • true: the Oracle CEP server shows detailed error messages.

  • false: the Oracle CEP server shows abbreviated error messages (default).


F.37.2 Attributes

The show-detail-error-message server configuration element has no attributes.

F.37.3 Example

The following example shows how to use the show-detail-error-message element in the Oracle CEP server configuration file:

<show-detail-error-message>
    <name>myShowDetail</name>
    <value>true</value>
</show-detail-error-message>

In the example, the show-detail-error-message element's unique identifier is myShowDetail.

F.38 ssl

Use this element to configure Secure Sockets Layer-specific properties on the Oracle CEP server.

F.38.1 Child Elements

The ssl server configuration element supports the child elements that Table F-26 lists.

Table F-26 Child Elements of: ssl

XML TagTypeDescription

name

string

The name of this cluster. For more information, see name.

key-store

string

Specifies the file path to the key store such as ./ssl/evsidentity.jks.

key-store-pass

See Description

This element contains a password child element with a string value that specifies the password used to access the key store.

key-store-alias

string

Specifies the alias for the key store.

key-manager-algorithm

string

Specifies the key manager algorithm such as SunX509.

ssl-protocol

string

Specifies the SSL protocol such as TLS.

trust-store

string

Specifies the file path to the trust store such as ./ssl/evstrust.jks.

trust-store-pass

See Description

This element contains a password child element with a string value that specifies the password used to access the trust store.

trust-store-alias

string

Specifies the alias for the trust store.

trust-store-type

string

Specifies the trust store type such as JKS.

trust-manager-algorithm

string

Specifies the trust manager algorithm such as SunX509.

enforce-fips

boolean

Specifies whether or not Oracle CEP server uses a Federal Information Processing Standards (FIPS)-certified pseudo-random number generator.

For more information, see "FIPS" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

need-client-auth

boolean

Specifies whether or not client certificate authentication is required.

ciphers

See Description

This element contains one or more cipher child elements, each with a string value that specifies the ciphers that are required.

secure-random-algorithm

string

When enforce-fips is set to true, specify the secure random algorithm to use. Valid values:

  • FIPS186PRNG

secure-random-provider

string

When enforce-fips is set to true, specify the secure random provider to use. Valid values:

  • JsafeJCE


F.38.2 Attributes

The ssl server configuration element has no attributes.

F.38.3 Example

The following example shows how to use the ssl element in the Oracle CEP server configuration file:

<ssl>
    <name>sslConfig</name>
    <key-store>./ssl/evsidentity.jks</key-store>
    <key-store-pass>
        <password>{Salted-3DES}s4YUEvH4Wl2DAjb45iJnrw==</password>
    </key-store-pass>
    <key-store-alias>evsidentity</key-store-alias>
    <key-manager-algorithm>SunX509</key-manager-algorithm>
    <ssl-protocol>TLS</ssl-protocol>
    <enforce-fips>false</enforce-fips>
    <need-client-auth>false</need-client-auth>
</ssl>

In the example, the ssl element's unique identifier is sslConfig.

F.39 timeout-seconds

Use this element to configure weblogic-jta-gateway default transaction timeout in seconds in the Oracle CEP server.

Default: 60.

F.39.1 Child Elements

The timeout-seconds server configuration element has no attributes.

F.39.2 Attributes

The timeout-seconds server configuration element has no attributes.

F.39.3 Example

The following example shows how to use the timeout-seconds element in the Oracle CEP server configuration file:

<weblogic-jta-gateway>
    <name>myJTAGateway</name>
    <timeout-seconds>90</timeout-seconds>
    <weblogic-instances>
        <weblogic-instance>
            <domain-name>ocep_domain</domain-name>
            <server-name>fxserver</server-name>
            <protocol>t3</protocol>
            <host-address>ariel</host-address>
            <port>9002</port>
        </weblogic-instance>
    </weblogic-instances>
</weblogic-jta-gateway>

F.40 transaction-manager

Use this element to configure transaction manager properties in the Oracle CEP server.

F.40.1 Child Elements

The transaction-manager server configuration element supports the child elements that Table F-27 lists.

Table F-27 Child Elements of: transaction-manager

XML TagTypeDescription

name

string

The name of this transaction-manager element. For more information, see name.

max-resource-requests-on-server

int

Maximum number of concurrent requests to resources allowed for each server.

Default: 50.

max-resource-unavailable-millis

long

Maximum duration in milliseconds that a resource is declared dead. After the duration, the resource will be declared available again, even if the resource provider does not explicitly re-register the resource.Default: 1800000.

security-interop-mode

string

Specifies the security mode of the communication channel used for XA calls between servers that participate in a global transaction. All server instances in a domain must have the same security mode setting. Valid values:

  • default: The transaction coordinator makes calls using the kernel identity over an admin channel if it is enabled, and anonymous otherwise. Man-in-the-middle attacks are possible if the admin channel is not enabled.

  • Performance: The transaction coordinator makes calls using anonymous at all times. This implies a security risk since a malicious third party could then try to affect the outcome of transactions using a man-in-the-middle attack.

  • Compatibility: The transaction coordinator makes calls as the kernel identity over an insecure channel. This is a high security risk because a successful man-in-the-middle attack would allow the attacker to gain administrative control over both domains. This setting should only be used when strong network security is in place.

Default: default.

parallel-xa-enabled

boolean

Execute XA calls in parallel if there are available threads.

Default: true.

tlog-location

string

The location of the file store that contains the transaction log. This attribute can be either an absolute or relative path in the filesystem.

max-xa-call-millis

long

Maximum allowed duration of XA calls to resources. If a particular XA call to a resource exceeds the limit, the resource is declared unavailable.

Default: 120000.

timeout-seconds

int

The default transaction timeout in seconds.

Default: 30.

checkpoint-interval-seconds

int

The interval at which the transaction manager performs transaction log checkpoint operations.

Default: 300.

forget-heuristics

boolean

Specifies whether the transaction manager will automatically perform an XAResource forget operation for heuristic transaction completions. When enabled, the transaction manager automatically performs an XA Resource forget operation for all resources as soon as the transaction learns of a heuristic outcome. Disable this feature only if you know what to do with the resource when it reports a heuristic decision.

Default: true.

before-completion-iteration-limit

int

The maximum number of cycles that the transaction manager will perform the before completion synchronization callback processing.

Default: 10.

abandon-timeout-seconds

int

The transaction abandon timeout seconds for transactions in the second phase of the two-phase commit (prepared and later). During the second phase of the two-phase commit process, the transaction manager will continue to try to complete the transaction until all resource managers indicate that the transaction is completed. Using this timeout, you can set the maximum time that a transaction manager will persist in attempting to complete a transaction during the second phase of the transaction. After the abandon transaction timer expires, no further attempt is made to resolve the transaction. If the transaction is in a prepared state before being abandoned, the transaction manager will roll back the transaction to release any locks held on behalf of the abandoned transaction.

Default: 86400.

serialize-enlistments-gc-interval-millis

long

The interval at which internal objects used to serialize resource enlistment are cleaned up.

Default: 30000.

unregister-resource-grace-period

int

The grace period (number of seconds) that the transaction manager waits for transactions involving the resource to complete before unregistering a resource. The grace period can help minimize the risk of abandoned transactions because of an unregistered resource, such as a JDBC data source module packaged with an application. During the specified grace period, the unregisterResource call will block until the call can return, and no new transactions are started for the associated resource. If the number of outstanding transactions for the resource goes to 0, the unregisterResource call returns immediately. At the end of the grace period, if there are still outstanding transactions associated with the resource, the unregisterResource call returns and a log message is written on the server on which the resource was previously registered.

Default: 30.

rmi-service-name

string

The name of the RMI service that is used for distributed transaction coordination.

For more information, see rmi.

max-unique-name-statistics

int

The maximum number of unique transaction names for which statistics will be maintained.

Default: 1000.

purge-resource-from-checkpoint-interval-seconds

int

The interval that a particular resource must be accessed within for it to be included in the checkpoint record.

Default: 86400.

max-transactions

int

The maximum number of simultaneous in-progress transactions allowed on this server.

Default: 10000.

migration-checkpoint-interval-seconds

int

The interval that the checkpoint is done for the migrated transaction logs (TLOGs).

Default: 60.

recovery-threshold-millis

long

The interval that recovery is attempted until the resource becomes available.

Default: 300000.

max-transactions-health-interval-millis

long

The interval for which the transaction map must be full for the JTA subsystem to declare its health as CRITICAL.

Default: 60000.

parallel-xa-dispatch-policy

string

The dispatch policy to use when performing XA operations in parallel. By default the policy of the thread coordinating the transaction is used.


F.40.2 Attributes

The transaction-manager server configuration element has no attributes.

F.40.3 Example

The following example shows how to use the transaction-manager element in the Oracle CEP server configuration file:

<transaction-manager>
    <name>My_tm</name>
    <timeout-seconds>30</timeout-seconds>
    <abandon-timeout-seconds>86400</abandon-timeout-seconds>
    <forget-heuristics>true</forget-heuristics>
    <before-completion-iteration-limit>12</before-completion-iteration-limit>
    <max-transactions>10100</max-transactions>
    <max-unique-name-statistics>500</max-unique-name-statistics>
    <max-resource-requests-on-server>50</max-resource-requests-on-server>
    <max-resource-unavailable-millis>1800000</max-resource-unavailable-millis>
    <recovery-threshold-millis>300000</recovery-threshold-millis>
    <max-transactions-health-interval-millis>
        60000
    </max-transactions-health-interval-millis>
    <purge-resource-from-checkpoint-interval-seconds>
        86400
    </purge-resource-from-checkpoint-interval-seconds>
    <checkpoint-interval-seconds>300</checkpoint-interval-seconds>
    <parallel-xa-enabled>true</parallel-xa-enabled>
    <unregister-resource-grace-period>30</unregister-resource-grace-period>
    <security-interop-mode>default</security-interop-mode>
    <rmi-service-name>RMI_ce1</rmi-service-name>
  </transaction-manager>

In the example, the transaction-manager element's unique identifier is My_tm.

F.41 use-secure-connections

Use this element to configure whether or not the Oracle CEP server uses secure connections.

For more information, see "How to Configure SSL in a Multi-Server Domain for Oracle CEP Visualizer" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

F.41.1 Child Elements

The use-secure-connections server configuration element supports the child elements that Table F-28 lists.

Table F-28 Child Elements of: use-secure-connections

XML TagTypeDescription

name

string

The name of this use-secure-connections element. For more information, see name.

value

boolean

Whether or not to use secure connections. Valid values:

  • true: the Oracle CEP server uses only secure connections.

  • false: the Oracle CEP server accepts connections that are not secure.


F.41.2 Attributes

The use-secure-connections server configuration element has no attributes.

F.41.3 Example

The following example shows how to use the use-secure-connections element in the Oracle CEP server configuration file:

<use-secure-connections>
    <name>myUseSecConn</name>
    <value>true</value>
</use-secure-connections>

In the example, the use-secure-connections element's unique identifier is myUseSecConn.

F.42 weblogic-instances

Use this element to configure Oracle CEP server instances for a weblogic-jta-gateway element.

F.42.1 Child Elements

The weblogic-instances server configuration element supports zero or more weblogic-instance child elements that each contain the child elements that Table F-29 lists.

Table F-29 Child Elements of: weblogic-instances

XML TagTypeDescription

domain-name

string

Specifies the name of the domain of the Oracle CEP server.

server-name

string

Specifies the name of the Oracle CEP server.

protocol

string

Specifies the JTA protocol.

Default: t3.

host-address

string

The host name or IP address of the Oracle CEP server.

port

int

The netio port for the Oracle CEP server.


F.42.2 Attributes

The weblogic-instances server configuration element has no attributes.

F.42.3 Example

The following example shows how to use the weblogic-instances element in the Oracle CEP server configuration file:

<weblogic-jta-gateway>
    <name>myJTAGateway</name>
    <timeout-seconds>90</timeout-seconds>
    <weblogic-instances>
        <weblogic-instance>
            <domain-name>ocep_domain</domain-name>
            <server-name>fxserver</server-name>
            <protocol>t3</protocol>
            <host-address>ariel</host-address>
            <port>9002</port>
        </weblogic-instance>
    </weblogic-instances>
</weblogic-jta-gateway>

F.43 weblogic-jta-gateway

Use this element to configure the attributes for the singleton Oracle CEP server client JTA gateway service.

F.43.1 Child Elements

The weblogic-jta-gateway server configuration element supports the following child elements:

F.43.2 Attributes

The weblogic-jta-gateway server configuration element has no attributes.

F.43.3 Example

The following example shows how to use the weblogic-jta-gateway element in the Oracle CEP server configuration file:

<weblogic-jta-gateway>
    <name>myJTAGateway</name>
    <timeout-seconds>90</timeout-seconds>
    <weblogic-instances>
        <weblogic-instance>
            <domain-name>ocep_domain</domain-name>
            <server-name>fxserver</server-name>
            <protocol>t3</protocol>
            <host-address>ariel</host-address>
            <port>9002</port>
        </weblogic-instance>
    </weblogic-instances>
</weblogic-jta-gateway>

In the example, the weblogic-jta-gateway element's unique identifier is myJTAGateway.

F.44 weblogic-rmi-client

Use this element to configure the attributes for the singleton Oracle CEP server RMI client.

F.44.1 Child Elements

The weblogic-rmi-client server configuration element supports the child elements that Table F-30 lists.

Table F-30 Child Elements of: weblogic-rmi-client

XML TagTypeDescription

name

string

The name of this weblogic-rmi-client element. For more information, see name.

netio-name

string

Specifies the name of the netio-client element to use. For more information, see netio-client.

secure-netio-name

string

Specifies the name of the netio-client element configured for SSL. For more information, see netio-client.


F.44.2 Attributes

The weblogic-rmi-client server configuration element has no attributes.

F.44.3 Example

The following example shows how to use the weblogic-rmi-client element in the Oracle CEP server configuration file:

<netio-client>
    <name>netio</name>
    <provider-type>NIO</provider-type>
</netio-client>
 
<netio-client>
    <name>netiossl</name>
    <provider-type>NIO</provider-type>
    <ssl-config-bean-name>sslConfig</ssl-config-bean-name>
</netio-client>
 
<weblogic-rmi-client>
    <name>wlclient</name>
    <netio-name>netio</netio-name>
    <secure-netio-name>netiossl</secure-netio-name>
</weblogic-rmi-client>

In the example, the weblogic-rmi-client element's unique identifier is wlclient.

F.45 work-manager

Use this element to configure a work manager on the Oracle CEP server.

F.45.1 Child Elements

The work-manager server configuration element supports the child elements that Table F-31 lists.

Table F-31 Child Elements of: work-manager

XML TagTypeDescription

name

string

The name of this work-manager element. For more information, see name.

min-threads-constraint

int

The minimum threads constraint this work manager should useDefault: -1.

fairshare

int

The fairshare value this work manager should use

Default: -1.

max-threads-constraint

int

The maximum threads constraint this work manager should use

Default: -1.


F.45.2 Attributes

The work-manager server configuration element has no attributes.

F.45.3 Example

The following example shows how to use the work-manager element in the Oracle CEP server configuration file:

<work-manager>
    <name>WM</name>
    <fairshare>5</fairshare>
    <min-threads-constraint>1</min-threads-constraint>
    <max-threads-constraint>4</max-threads-constraint>
</work-manager>

In the example, the work-manager element's unique identifier is WM.

F.46 xa-params

Use this element to specify distributed transaction-related data-source parameters.

F.46.1 Child Elements

The xa-params server configuration element supports the child elements that Table F-32 lists.

Table F-32 Child Elements of: xa-params

XML TagTypeDescription

keep-xa-conn-till-tx-complete

boolean

Enables the server to associate the same XA database connection from the connection pool with a global transaction until the transaction completes. Only applies to connection pools that use an XA driver. Use this setting to work around specific problems with JDBC XA drivers.

Default: true.

xa-transaction-timeout

int

The number of seconds to set as the transaction branch timeout. If set, this value is passed as the transaction timeout value in the XAResource.setTransactionTimeout call on the XA resource manager, typically the JDBC driver. When this value is set to 0, the Transaction Manager passes the global server transaction timeout in seconds in the method. If set, this value should be greater than or equal to the global server transaction timeout. Note: You must enable xa-set-transaction-timeout to enable setting the transaction branch timeout.

Defb#ault: 0.

rollback-local-tx-upon-conn-close

boolean

Enables the server to call rollback on the connection before returning the connection to the connection pool. Enabling this attribute will have a performance impact as the rollback call requires communication with the database server.

Default: false.

xa-retry-duration-seconds

int

Determines the duration in seconds for which the transaction manager will perform recover operations on the resource. A value of zero indicates that no retries will be performed.

Default: 60.

xa-set-transaction-timeout

boolean

Enables the server to set a transaction branch timeout based on the value for xa-transaction-timeout. When enabled, the Transaction Manager calls XAResource.setTransactionTimeout before calling XAResource.start, and passes either the XA Transaction Timeout value or the global transaction timeout. You may want to set a transaction branch timeout if you have long-running transactions that exceed the default timeout value on the XA resource.

Default: false.

keep-logical-conn-open-on-release

boolean

Enables the server to keep the logical JDBC connection open for a global transaction when the physical XA connection is returned to the connection pool. Select this option if the XA driver used to create database connections or the DBMS requires that a logical JDBC connection be kept open while transaction processing continues (although the physical XA connection can be returned to the connection pool). Only applies to data sources that use an XA driver. Use this setting to work around specific problems with JDBC XA drivers.

Default: false.

resource-health-monitoring

boolean

Enables JTA resource health monitoring for an XA data source. When enabled, if an XA resource fails to respond to an XA call within the period specified in MaxXACallMillis, the server marks the data source as unhealthy and blocks any further calls to the resource. This property applies to XA data sources only, and is ignored for data sources that use a non-XA driver.

Default: true.

new-xa-conn-for-commit