-
1. Re: Use of NotificationListenerProxy
adrian.brock Aug 22, 2002 7:16 AM (in response to tom.elrod)The spec requires that any NotificationListener
registered with the MBeanServer receives the MBean's
ObjectName as the "source" in the notification.
In fact, it discourages direct registration with
the broadcaster.
The actual NotificationBroadcaster doesn't necessarily
set the object name as the source, so we intercept the
notification and replace it.
You could add a getUnderlyingListener() method?
How would a real proxy help when using instanceof?
The MBeanServer would probably only care about the
NotificationListener interface when generating the
proxy?
Regards,
Adrian -
2. Re: Use of NotificationListenerProxy
juha Aug 22, 2002 12:40 PM (in response to tom.elrod)> The actual NotificationBroadcaster doesn't
> necessarily
> set the object name as the source
In fact, it rarely does, the resource doesn't usually need to know its own object name, so it just uses 'this' reference as its source for notifications
(which we then need to intercept and replace with the actual object name as Adrian explained)
You can only rely on the declared interface in the resource implementation (this is good design anyway).
However you can pass any custom object as part of handback when you register the listener. This is guaranteed by the spec to be immutable object as far as the server is concerned. -
3. Re: Use of NotificationListenerProxy
tom.elrod Aug 23, 2002 4:08 PM (in response to tom.elrod)I updated the code to the NotificationListenerProxy so that it will maintain the interface heirarchy of the original NotificationListener object passed when setting it within the NotificationBroadcaster. The only hitch is that it uses a dynamic proxy (java.lang.reflect.Proxy & java.lang.reflect.InvocationHandler), which is JDK 1.3+ specific and wasn't sure what the jdk compatibility requirements are for jboss-mx?
-
4. Re: Use of NotificationListenerProxy
tom.elrod Aug 23, 2002 4:09 PM (in response to tom.elrod)I updated the code to the NotificationListenerProxy so that it will maintain the interface heirarchy of the original NotificationListener object passed when setting it within the NotificationBroadcaster. The only hitch is that it uses a dynamic proxy (java.lang.reflect.Proxy & java.lang.reflect.InvocationHandler), which is JDK 1.3+ specific and wasn't sure what the jdk compatibility requirements are for jboss-mx?
-
5. Re: Use of NotificationListenerProxy
tom.elrod Aug 23, 2002 4:12 PM (in response to tom.elrod)I updated the code to the NotificationListenerProxy so that it will maintain the interface heirarchy of the original NotificationListener object passed when setting it within the NotificationBroadcaster. The only hitch is that it uses a dynamic proxy (java.lang.reflect.Proxy & java.lang.reflect.InvocationHandler), which is JDK 1.3+ specific and wasn't sure what the jdk compatibility requirements are for jboss-mx?
-
6. Re: Use of NotificationListenerProxy
tom.elrod Aug 23, 2002 4:15 PM (in response to tom.elrod)I updated the code to the NotificationListenerProxy so that it will maintain the interface heirarchy of the original NotificationListener object passed when setting it within the NotificationBroadcaster. The only hitch is that it uses a dynamic proxy (java.lang.reflect.Proxy & java.lang.reflect.InvocationHandler), which is JDK 1.3+ specific and wasn't sure what the jdk compatibility requirements are for jboss-mx?
-
7. Re: Use of NotificationListenerProxy
tom.elrod Aug 23, 2002 4:17 PM (in response to tom.elrod)I updated the code to the NotificationListenerProxy so that it will maintain the interface heirarchy of the original NotificationListener object passed when setting it within the NotificationBroadcaster. The only hitch is that it uses a dynamic proxy (java.lang.reflect.Proxy & java.lang.reflect.InvocationHandler), which is JDK 1.3+ specific and wasn't sure what the jdk compatibility requirements are for jboss-mx?
-
8. Re: Use of NotificationListenerProxy
tom.elrod Aug 23, 2002 4:25 PM (in response to tom.elrod)I updated the code to the NotificationListenerProxy so that it will maintain the interface heirarchy of the original NotificationListener object passed when setting it within the NotificationBroadcaster. The only hitch is that it uses a dynamic proxy (java.lang.reflect.Proxy & java.lang.reflect.InvocationHandler), which is JDK 1.3+ specific and wasn't sure what the jdk compatibility requirements are for jboss-mx?
-
9. Re: Use of NotificationListenerProxy
tom.elrod Aug 23, 2002 9:35 PM (in response to tom.elrod)Sorry about so many replies. Posted, but did not see the posting, so repeated. Once again, sorry.
-
10. Re: Use of NotificationListenerProxy
adrian.brock Aug 23, 2002 10:02 PM (in response to tom.elrod)Jives caching sucks :-)
JBoss requires java 1.3 for ejb2.0
Show the code?
Regards,
Adrian -
11. Re: Use of NotificationListenerProxy
tom.elrod Aug 24, 2002 1:33 AM (in response to tom.elrod)Cool. Sent code via e-mail instead of posting. Please let me know if you did not get it.