Use Case: Consuming Data From a Cache

Configuring Caching 12-7 ... 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 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. 3. Open your application’s component configuration XML file using your favorite XML editor. 4. Update the config root element to add a caching-system child element; use the name child element to uniquely identify it. This name must match the wlevs:caching-system element id attribute you specified in the EPN assembly file in step 1. This is how Oracle CEP knows to which particular caching system in the EPN assembly file this caching configuration applies. For example, assume your configuration file already contains a processor and an adapter contents removed for simplicity; then the updated file might look like the following ?xml version=1.0 encoding=UTF-8? n1:config xmlns:n1=http:www.bea.comnswlevsconfigapplication xmlns:xsi=http:www.w3.org2001XMLSchema-instance processor ... processor adapter ... adapter caching-system namecaching-system-idname caching-system n1:config 5. For each cache you want to create, update the caching-system element to add a cache child element; use the name child element to uniquely identify it. This name must match the wlevs:cache element id attribute you specified in the EPN assembly file in step 2. This is how Oracle CEP knows to which particular cache in the EPN assembly file this configuration applies. The following example shows two caches in the caching system: caching-system namecaching-system-idname cache namecache-idname ... cache