[infinispan-issues] [JBoss JIRA] Created: (ISPN-245) Core module to delegate lifecycle events to sub-modules

Manik Surtani (JIRA) jira-events at lists.jboss.org
Fri Oct 30 10:01:05 EDT 2009


Core module to delegate lifecycle events to sub-modules
-------------------------------------------------------

                 Key: ISPN-245
                 URL: https://jira.jboss.org/jira/browse/ISPN-245
             Project: Infinispan
          Issue Type: Feature Request
          Components: Core API
            Reporter: Manik Surtani
            Assignee: Manik Surtani
             Fix For: 4.1.0.BETA1, 4.1.0.GA


Follow a 'service registry' style approach to delegating lifecycle events so that modules can register for hooks.  The purpose behind this is that some modules need to perform some setup.  E.g., the 'tree' module needs to register specific types with the Marshaller.  The 'query' module needs to register an interceptor with the Cache if the Cache has enabled querying.  Etc.

The approach is to use a JDK service registry style approach. The Core module defines a ModuleLifecycle interface:

interface ModuleLifecycle {
  void cacheManagerStarting(GlobalComponentRegistry gcr);
  void cacheManagerStarted(GlobalComponentRegistry gcr);
  void cacheManagerStopping(GlobalComponentRegistry gcr);
  void cacheManagerStopped(GlobalComponentRegistry gcr);

  void cacheStarting(ComponentRegistry cr, String cacheName); 
  void cacheStarted(ComponentRegistry cr, String cacheName);
  void cacheStopping(ComponentRegistry cr, String cacheName); 
  void cacheStopped(ComponentRegistry cr, String cacheName);
}

each module would implement this interface.

"Registration" is performed by each module maintaining a infinispan-module-info.properties file in its classpath, containing:
infinispan.module.lifecycle=<ModuleLifecycle impl>

The DefaultCacheManager, when starting up, scans its classpath for "infinispan-module-info.properties" and registers all listeners.  Everytime the cache manager starts, stops, or caches start or stop, the appropriate callbacks are invoked.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list