Configuring an Oracle CEP Local Cache Loader

12-16 Oracle Complex Event Processing Developers Guide The caching system is responsible for creating the cache associated with a particular name and returning a reference to the cache. The resulting cache bean implements the java.util.Map interface. For more information, see Section 12.3.5, Configuring a Shared Oracle Coherence Cache . 4. Configure the caching system and its caches by updating the caching configuration file for the application. See Section 12.3.1, Configuring the Oracle Coherence Caching System and Caches. 5. Optionally, override the default cache configuration by updating the EPN assembly file with one or more additional cache element child elements. ■ Specify that a cache is an event sink by configuring it as a listener to another component in the event processing network. See Section 12.3.1, Configuring the Oracle Coherence Caching System and Caches. ■ Specify that a cache is an event source to which another component in the event processing network listens. See Section 12.3.2, Configuring an Oracle Coherence Cache as an Event Listener. ■ Configure either a wlevs:cache-loader or a wlevs:cache-store child element of the wlevs:cache element in the EPN assembly file, but not both. This is because Oracle Coherence combines the loader and store into a single component. You specify a cache loader when the backing store is read-only and a cache store when the backing store is read-write See Section 12.3.4, Configuring an Oracle Coherence Cache Loader or Store. 6. Access the Oracle Coherence cache: – Optionally reference the Oracle Coherence cache in a query statement. See: Section 12.5, Accessing a Cache From an Oracle CQL Statement Section 12.6, Accessing a Cache From an EPL Statement – Optionally configure and program a custom adapter, business POJO, or Oracle CQL or EPL user-defined function to access the Oracle Coherence cache. The configuration is done in the EPN assembly file and the programming is done in the Java file that implements the adapter, POJO, or user-defined function. See: Section 12.7, Accessing a Cache From an Adapter Section 12.8, Accessing a Cache From a Business POJO Section 12.9, Accessing a Cache From an Oracle CQL User-Defined Function Section 12.10, Accessing a Cache From an EPL User-Defined Function – Optionally, access the Oracle Coherence cache using JMX. Configuring Caching 12-17 See Section 12.11, Accessing a Cache Using JMX . 7. Edit your MANIFEST.MF to import package com.bea.wlevs.cache.spi. For more information, see Section 4.7.5, How to Import a Package . 8. Assemble and deploy your application. For more information, see Chapter 24, Assembling and Deploying Oracle CEP Applications .

12.3.1 Configuring the Oracle Coherence Caching System and Caches

Oracle CEP leverages the native configuration provided by Oracle Coherence. You do this by packaging the following two Oracle Coherence configuration files, with the indicated names, in the application bundle that uses the Oracle Coherence cache: ■ coherence-cache-config.xml—Oracle Coherence cache configuration information. Individual caches are identified with the cache-name element; the value of this element maps to the id attribute of the wlevs:cache element in the EPN assembly file. See Section 12.3.1.1, The coherence-cache-config.xml File for information about this file as well as an example of the mapping. ■ tangosol-coherence-override.xml—Oracle Coherence cluster configuration. See Section 12.3.1.2, The tangosol-coherence-override.xml File for information about this file as well as an example. When assembling your application, consider the following: ■ coherence-cache-config.xml is a per-application configuration file; put this file in the META-INFwlevscoherence directory of the bundle JAR. Note that this directory is different from the directory that stores the component configuration file for the local in-memory Oracle CEP caching provider META-INFwlevs. ■ tangosol-coherence-override.xml is a global per-server file referred to as operational configuration in the Oracle Coherence documentation; put this file in the Oracle CEP server config directory. Update your application configuration file as Example 12–5 shows: Example 12–5 Application Configuration File: Coherence Cache coherence-caching-system namecaching-system-idname coherence-cache-config ..wlevscoherencecoherence-cache-config.xml coherence-cache-config coherence-caching-system When you declare that a caching system uses the Oracle Coherence provider, be sure that all of the caches of this caching system also map to an Oracle Coherence configuration and not an Oracle CEP local configuration, or Oracle CEP throws an exception.

12.3.1.1 The coherence-cache-config.xml File

The coherence-cache-config.xml file is the basic Oracle Coherence configuration file and must conform to the Oracle Coherence DTDs, as is true for any Oracle Coherence application.