Embedded Hibernate service question: redeploying SessionFact
ivelin.ivanov Aug 19, 2004 12:13 AM[Steve]
NM, apparently ServiceMBeanSupport itself has those capabilities...
--------------------------------------------------------------------------------
From: Steve Ebersole
Sent: Wed 8/18/2004 10:25 PM
To: Alexey Loubyansky; 'Christian Bauer'; 'Gavin King'
Cc: Ivelin Ivanov
Subject: RE: jboss - hibernate
You mention possibly extending the NotificationBroadcasterSupport base class. The original code already extended a JBoss base class ServiceMBeanSupport. Is there a JBoss-specific abstract class supporting the NotificationEmitter interface?
--------------------------------------------------------------------------------
From: Alexey Loubyansky
Sent: Wed 8/18/2004 11:56 AM
To: Steve Ebersole; 'Christian Bauer'; 'Gavin King'
Cc: Ivelin Ivanov
Subject: RE: jboss - hibernate
Hi Steve,
if you want to emit notifications from an MBean, the MBean should implement javax.management.NotificationBroadcaster or NotificationEmitter (the javadocs says "This interface should be used in preference to NotificationBroadcaster.")
There is also javax.management.NotificationBroadcasterSupport which you can extend or just delegate method calls to.
rebuild operation is needed in fact. Maybe even when you change an attribute this should be reflected on the MBean's status so that you can see that properties changed but the session factory was not rebuilt.
Let me know if you need help coding this stuff.
alex
--------------------------------------------------------------------------------
From: Steve Ebersole
Sent: Wednesday, August 18, 2004 7:14 PM
To: Alexey Loubyansky; 'Christian Bauer'; 'Gavin King'
Cc: Ivelin Ivanov
Subject: RE: jboss - hibernate
Ok, so I am getting ready to expend some more time on this. But I need some help with MBean stuff from those of you more versed in JBoss itself.
First, changes in a lot of the attributes exposed through the MBean would require the SessionFactory to be rebuilt in order to take effect. Currently, the only way to accomplish that rebuilding is to start/stop the service. Is that pretty typical? Should we also add a "rebuild" managed operation? If so, I would guess that that operation should then generate a specific event; does that then go through the normal NotificationListener mechanisms?
In reference to the lifecycle notifications for the MBean, I'll go ahead and code the appropriate listeners. Someone with more experience here might want to double check these after I am done.