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

Manik Surtani (JIRA) jira-events at lists.jboss.org
Thu Jan 7 06:43:30 EST 2010


    [ https://jira.jboss.org/jira/browse/ISPN-245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12502686#action_12502686 ] 

Manik Surtani commented on ISPN-245:
------------------------------------

See Javadocs on org.infinispan.lifecycle.ModuleLifecycle for information on how to use this.

> 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: Vladimir Blagojevic
>             Fix For: 4.0.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