yes, I would also go for a strongly typed visitor for the same reasons.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.
I would go for the later approach, to do the validation in the start method, to keep the logic where the data is.
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. Visitoris 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 withadditional ConfigurationBeanVisitor parameter2) We leave everything as is and if there is a need to pass some visitorwe pass it to InfinispanConfiguration instance directly (fromDefaultCacheManager)DefaultCacheManager will pass ValidationVisitor toInfinispanConfiguration that will verify configuration semantically.Regards,VladimirOn 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 andthen you can do verification of any node and other things as well. Usecases will come up in the future for sure.CheersOn 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 anycomponent 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-145URL: https://jira.jboss.org/jira/browse/ISPN-145Project: InfinispanIssue Type: BugComponents: Loaders and StoresAffects Versions: 4.0.0.ALPHA6Reporter: Galder ZamarrenoAssignee: Vladimir BlagojevicPriority: MinorFix For: 4.0.0.CR1Throw configuration exception if singleton store configured withouttransport having been configured.It makes no sense to have singleton store enabled when there's notransport._______________________________________________infinispan-dev mailing listinfinispan-dev@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Galder Zamarreņo
Sr. Software Engineer
Infinispan, JBoss Cache
_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev