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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...