[infinispan-dev] Module configuration proposal

Manik Surtani manik at jboss.org
Wed Nov 4 12:27:21 EST 2009


Nice work!  Is there any way to register the module beans in code so  
they don't appear in XML (which is exposed to users)?  Perhaps  
something like:

In core:
* look thru classpath for all instances of "infinispan-module- 
cfg.properties"
* this file would contain infinispan.module.cfg- 
beans=org.infinispan.query.config.QueryConfigurationBean,  
org.infinispan.query.config.QueryConfigurationBean2,  
org.infinispan.query.config.QueryConfigurationBean3, etc

in any given module:
  * must package a "infinispan-module-cfg.properties" if it wants to  
hook in to the XML cfg parsing system
  * delcare any cfg beans in this file, as infinispan.module.cfg- 
beans=org.infinispan.query.config.QueryConfigurationBean,  
org.infinispan.query.config.QueryConfigurationBean2,  
org.infinispan.query.config.QueryConfigurationBean3, etc

WDYT?


On 3 Nov 2009, at 15:52, Vladimir Blagojevic wrote:

> Hey guys,
>
> I completed module configuration proposal Manik and I agreed upon.  
> It is
> very important to get this one right so I want to run it by you before
> proceeding further!
>
> Have a look at [1] and follow proposed module configuration example  
> below:
>
> <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="urn:infinispan:config:4.0">
> <global>
> <transport clusterName="demoCluster"/>
> </global>
>
> <default>
> <clustering mode="replication">
> </clustering>
> <modules>
> <module name="query"
> configClassName="org.infinispan.query.config.QueryConfigurationBean">
> <indexing enabled="true" indexLocalOnly="true"/>
> </module>
> </modules>
> </default>
> </infinispan>
>
> A few things to notice:
>
> a) Any configuration (including default and namedCache) can have a
> module definition
> b) Instance of configClassName is a rich object structure filled from
> module's child XML content
> c) Module's XML content can be arbitrary
> d) Custom module configuration bean is accessed by module name:
>
>
>       Configuration def = c.parseDefaultConfiguration();
>       ModuleConfigurationBean extensionConfig =
> def.getModuleConfigurationBean("query");
>       QueryConfigurationBean bean = (QueryConfigurationBean)
> extensionConfig.getConfigurationBean();
>       assert bean.isEnabled();
>       assert bean.isIndexLocalOnly();
>
>
> The proposal achieves full flexibility when it comes to having rich
> object configuration structure that modules define themselves.
> Furthermore, core module is completely isolated from module
> configuration extensions. Schema easily accommodates this model and
> there is no adverse effect on performance!
>
>
> [1] https://jira.jboss.org/jira/browse/ISPN-193
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org







More information about the infinispan-dev mailing list