[infinispan-dev] Configuration visitor - Re: [JBoss JIRA] Commented: (ISPN-145) No transport and singleton store enabled should not be allowed

Galder Zamarreno galder.zamarreno at redhat.com
Thu Sep 10 04:11:29 EDT 2009


Hi Vladimir,

I had a look at the implementation and I'm not sure I understand the 
need for the reflection visit calls in AbstractConfigurationBeanVisitor. 
Using reflection makes harder to follow code and it's slower than typed 
calls and I'm not sure of the reason to use it here.

Also, I don't see the need for a standard ConfigurationValidatingVisitor 
that does such validation. Instead, the way I see it working is 
SingletonStoreConfig having some kind of callback method being called, 
i.e. the traversalCompleted() call and within it, SingletonStoreConfig 
can, using the ComponentRegistry, retrieve the Transport component and 
see if it's set or not. Or alternatively, SingletonStoreConfig could use 
the passed InfinispanConfiguration to do its validation.

To sum up, I think each AbstractNamedCacheConfigurationBean 
implementation should, if it requires to, have the ability to validate 
the configuration via some kind of callback. Such callback should 
probably is possibliy traversalCompleted() itself.

WDYT?

On 09/09/2009 08:21 PM, Vladimir Blagojevic wrote:
> Hi,
>
> Galder and I talked about this offline. Time to involve you guys!
>
> I just completed visitor pattern for our configuration objects. Visitor
> is passed from root of configuration - InfinispanConfiguration object.
> InfinispanConfiguration class has a new method:
>
> public void accept(ConfigurationBeanVisitor v)
>
> How do we want to integrate this visitor into existing structure?
>
> 1) We add a new factory method to InfinispanConfiguration with
> additional ConfigurationBeanVisitor parameter
>
> 2) We leave everything as is and if there is a need to pass some visitor
> we pass it to InfinispanConfiguration instance directly (from
> DefaultCacheManager)
>
> DefaultCacheManager will pass ValidationVisitor to
> InfinispanConfiguration that will verify configuration semantically.
>
> Regards,
> Vladimir
>
> On 09-09-09 10:19 AM, Galder Zamarreno wrote:
>> Good idea :)
>>
>> On 09/09/2009 04:13 PM, Vladimir Blagojevic wrote:
>>> Yeah,
>>>
>>> I was thinking that we can make a visitor for configuration tree and
>>> then you can do verification of any node and other things as well. Use
>>> cases will come up in the future for sure.
>>>
>>> Cheers
>>>
>>>
>>>
>>> On 09-09-09 3:29 AM, Galder Zamarreno (JIRA) wrote:
>>>> [
>>>> https://jira.jboss.org/jira/browse/ISPN-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12484894#action_12484894
>>>>
>>>> ]
>>>>
>>>> Galder Zamarreno commented on ISPN-145:
>>>> ---------------------------------------
>>>>
>>>> Not sure I understand what you mean by generic though. You mean any
>>>> component to have a validation step of some sort?
>>>>
>>>> Thanks for taking this on :)
>>>>
>>>>> No transport and singleton store enabled should not be allowed
>>>>> --------------------------------------------------------------
>>>>>
>>>>> Key: ISPN-145
>>>>> URL: https://jira.jboss.org/jira/browse/ISPN-145
>>>>> Project: Infinispan
>>>>> Issue Type: Bug
>>>>> Components: Loaders and Stores
>>>>> Affects Versions: 4.0.0.ALPHA6
>>>>> Reporter: Galder Zamarreno
>>>>> Assignee: Vladimir Blagojevic
>>>>> Priority: Minor
>>>>> Fix For: 4.0.0.CR1
>>>>>
>>>>>
>>>>> Throw configuration exception if singleton store configured without
>>>>> transport having been configured.
>>>>> It makes no sense to have singleton store enabled when there's no
>>>>> transport.
>>>
>>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

-- 
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache



More information about the infinispan-dev mailing list