[jboss-dev-forums] [Design of Clustering on JBoss (Clusters/JBoss)] - Re: JBAS-4276 Discussion Thread

bstansberry@jboss.com do-not-reply at jboss.com
Wed Jul 11 14:54:24 EDT 2007


Let's throw an exception and strip out any code that tries to do a lookup.  If the partition isn't available, that means Brian screwed up when he wrote and tested the config file. :)

In general, I want to go with a straight IOC approach -- services assume they have dependencies injected, and don't try looking them up themselves. If the necessary dependencies aren't available, throw an IllegalStateException (let's avoid any NPE).

AIUI, this business of looking stuff up predates the days when the JMX Microkernel could do dependency injection via "depends optional-attribute name". I would have torn it out when I added the "ClusterPartition" attribute, but that was too big a change for a 4.0 point release.

We may need to be a bit more cautious/think about it a wee bit more in the case of things like HAServiceMBeanSupport, where it's expected users will subclass the class.  But for internal services like HASessionState, be ruthless. :)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063156#4063156

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063156



More information about the jboss-dev-forums mailing list