Configuring an Oracle Coherence Cache as an Event Source

Configuring Caching 12-25 result.putkey, loadkey; } return result; } }

12.3.5 Configuring a Shared Oracle Coherence Cache

When declaring Oracle Coherence caches in the EPN assembly files of one or more applications deployed to the same Oracle CEP server, you should never configure multiple instances of the same cache with a loader or store. You might inadvertently do this by employing multiple applications that each configure the same Oracle Coherence cache with a loader or store in their respective EPN assembly file. If you do this, Oracle CEP throws an exception. If multiple application bundles need to share Oracle Coherence caches, then you should put the EPN assembly file that contains the appropriate wlevs:cache and wlevs:caching-system in a separate bundle and set their advertise attributes to true. To export both the caching system and the cache as an OSGi service, set the advertise attribute to true. wlevs:caching-system id=caching-system-id provider=coherence advertise=true ... wlevs:cache id=cache-id name=alternative-cache-name advertise=true wlevs:caching-system ref=caching-system-id wlevs:cache If the cache is advertised, then a component in the EPN of an application in a separate bundle can then reference it. The following example shows how a processor in one bundle can use as a cache source the cache with ID cache-id located in a separate bundle called cacheprovider: wlevs:processor id=myProcessor2 wlevs:cache-source ref=cacheprovider:cache-id wlevs:processor

12.4 Configuring a Third-Party Caching System and Cache

You can configure your application to use a third-party caching system and cache. To configure a third-party caching system and cache: 1. Create a plug-in to define the third-party caching system as an Oracle CEP caching system provider. This involves: ■ Implementing the com.bea.wlevs.cache.spi.CachingSystem interface ■ Creating a factory that creates caching systems of this type. ■ Registering the factory with an attribute that identifies its provider type. Note: It is assumed in this section that you have already created an Oracle CEP application along with its EPN assembly file and that you want to update the application to use caching. If you have not, refer to Chapter 1, Overview of Creating Oracle CEP Applications for details.