Hi
I have been looking at the code and have a possible solution.
Assumptions
- All mBean registration and unregistration is done via the
ManagementContext class.
Fix
- When we register a bean we create a wrapper object to hold the bean (as
is done now) and the 'real name'and this is placed in the beanmap
ObjectInstance registeredBean =
mbeanServerContext.getMBeanServer().registerMBean(mbean, name);
beanMap.put(name, new
RegesteredBean(registeredBean.getObjectName(), resource));
- We adjust the unregister/shutdown methods to the the ObjectName from the
RegesteredBean object.
RegesteredBean rb = (RegesteredBean)beanMap.get(objName);
ComponentMBeanImpl mbean = (ComponentMBeanImpl) rb.bean;
- We remove the method unregisterMBean from MBeanServerContext [this is to
enforce the assumption]
This should not break any existing code.
Any comments?
I am not sure is the listener approach will work. For example
ComponentMBeanImpl
Has 2 mBean name stored and it unregister them in the method
unregisterMbeans(). I am not sure if these fields would be updated by a
listener.
(Have I missed something here - I am still a relative newbe with mBeans)
David
yhofri wrote:
>
> ...
> In terms of logics, Mbean Registration shouldn't fall into the Mbean
> flow itself, as with registering endpoints, it should be called from the
> AsyncBaseLifecycle...
>
>
>
> -----Original Message-----
> From: Grant M [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 17, 2007 3:56 AM
> To: [EMAIL PROTECTED]
> Cc: [email protected]
> Subject: Fwd: Websphere 6.1 and MBean registration issue
>
> Hey David,
>
> I was wondering if you already had a workable solution for the MBean
> registration issue? I was thinking instead of putting the code in the
> AsyncBaseLifecycle it should instead go in the base MBean code. I'll
> raise a JIRA issue and we can continue discussion of it.
>
> Grant
>
> ---------- Forwarded message ----------
> From: Guillaume Nodet <[EMAIL PROTECTED]>
> Date: Mar 17, 2007 9:40 AM
> Subject: Re: Websphere 6.1 and MBean registration issue
> To: [email protected]
>
>
> On 3/16/07, Grant M <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> I've been out of touch for a while with swapping to a new job and all
>> and I was wondering whether David Potter had forwarded a solution to
>> the MBean registration issue in Websphere? If not I'd like to open the
>
>> floor to discussions on a possible fix.
>
>
> I don't think so, but you should ping him and cc this list to see if he
> has worked on it already.
>
> I think the possible use of querynames could be fraught with issues
>> especially in clustered environments. Would it be possible to change
>> the base MBean itself so that upon registration it updated the
>> objectName? That way changes would be propagated correctly? I
>> noticed in the code there is references to property change listeners
>> and was wondering whether this meant it was already implemented?
>
>
> Yeah, it should be possible to retrieve the new value of the Objectname
> and use it instead of the one ServiceMix generates. I think this is the
> only change to make, but i may miss something: where do you want to
> propagate the change ?
> Anyway, property change listeners should generate jmx notifications,
> provided that the setter call the needed method of course.
>
> Cheers,
>>
>> Grant M
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Architect, LogicBlaze (http://www.logicblaze.com/)
> Blog: http://gnodet.blogspot.com/
>
>
--
View this message in context:
http://www.nabble.com/Websphere-6.1-and-MBean-registration-issue-tf3417186s12049.html#a9604697
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.