jboss-mx guys, more on interceptors - in light of Juha's boo
squirest Feb 26, 2002 8:35 AMOk,
I've got the book and skimmed for the relevant parts to see where Juha's head is at. I've also been thinking about the JSR160 abstract.
Note that I'm not trying to implement JSR160 from the abstract or anything. However, features listed in the abstract *are* being talked about for JBossMX.
Anyhow, I think my head might be in a different place from Juha and the JSR160 guys so I'm looking for some clarification.
looking at the JSR160 abstract it says it will define:
MBean Interceptor interfaces, providing a mean to insert functionality, such as security or monitoring components, into the invocation path between the JMX Agent and MBeans (similar to CORBA pattern).
So interceptors are coming as part of the spec.
Obviously, just which calls pass through the "invocation chain" is not published yet.
Given that they say "interfaces" I think it's unlikely that the interceptors will maintain a reference to its next interceptor.
It also seems likely that a third party may configure the interceptor chain for a given MBean. My best guess is that you'd invoke a setInterceptors(ObjectName name, ObjectName[] interceptornames) style method on an MBean sitting in the JMImplementation domain.
(side to juha, yes I know that causes a problem for XMBean configured interceptors but bear with me)
The biggest issue for me is what calls are interceptable?
On the one hand I think *everything* that is called via the MBeanServer goes through the interceptable invocation chain. This includes DynamicMBean, NotificationBroadcaster and (I think) NotificationListener.
On the other hand this might be dangerous. For example, if getMBeanInfo goes through interceptors then someone could modify the MBeanInfo on the way out.
Other hints in the current spec and in Juhas book indicate that the accepted interpretation of "invocation path" might be *just* the DynamicMBean invoke() method.
The more I code this the more I turn into a bistable multivibrator (flip-flop). Yesterday it was "intercept everything".
Today I *really* like "only intercept DynamicMBean.invoke()". To me, that's the only call which makes sense to have an external entity processing (juha, your strategy for ModelMBeans is a special case).
Ok, that's my opinion. Now, what's the truth?
Trev