[infinispan-dev] Module configuration proposal

Vladimir Blagojevic vblagoje at redhat.com
Tue Nov 3 13:24:57 EST 2009


On 09-11-03 12:59 PM, Galder Zamarreno wrote:
>
> On 11/03/2009 04:52 PM, 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
>>      
> I think configClassName should simply be 'class' as per the rest of
> situations where we're configuring FQCNs.
>    

Ok, makes sense!
>    
>> c) Module's XML content can be arbitrary
>>      
> So,<indexing enabled="true" indexLocalOnly="true"/>  is the XML from the
> query module that the query module can read itself?
>
>    
Yes, exactly. And it is read into object graph rooted in class specified 
by configClassName.
XML unmarshalling into object graph is done by JAXB, just as we do it 
elsewhere!


>> 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!
>>      
> Nice work!
>
>    
>>
>> [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
>>      
>    




More information about the infinispan-dev mailing list