This discussion is archived
0 Replies Latest reply: Mar 29, 2012 5:42 AM by 694204 RSS

Unable to get NamedCacheLifecycleEvent events fired. Coherence 3.6

694204 Newbie
Currently Being Moderated

I have a namespace content handler (based on an IndexHandler sample I found on the forums). However in my case rather than a NamedCacheStorageRealizedEvent I want to be notified when a Cache is started and then pass in some information from my extensible XML to a scheduler that will schedule at a fixed rate the class specified (in order to pick up new data from a DB and load into the cache). However I seem unable to set the filter correctly. I can pick up NamedCacheStoredRealizedEvents fine but this is not what I want as I get loads of them for all the coherence common/processing pattern caches.

The code in the Element Handler is :-

registerContentHandler("task", new ElementContentHandler()
               public Object onElement(ConfigurationContext configurationContext,
                                             QualifiedName qualifiedName,
                                             XmlElement xmlElement) throws ConfigurationException {
                    EventDispatcher eventDispatcher = configurationContext.getEnvironment().getResource(EventDispatcher.class);
          eventDispatcher.registerEventProcessor(new NamedCacheLifecycleEventFilter("my-cache-name"), new CacheIndexAdder(taskName));
                    return null;

The config of the cache is:-



               <service-name>MarsData (Distributed)</service-name>
               <local-storage system-property="mars.localstorage">true</local-storage>


  • Correct Answers - 10 points
  • Helpful Answers - 5 points