Is this enough as there are several places copies are being introduced: - AbstractMBeanInvoker.preRegister + This calls initAttributeContexts(info.getAttributes());, which makes a copy of the MBeanAttributeInfo[] - ModelMBeanInvoker.initAttributeContexts + This calls ctx.setDescriptor(info.getDescriptor()); which passes in a copy of Descriptor from the copy of the MBeanAttributeInfo obtained from the MBeanInfo.
Therefore, all attribute sets are operating on copies of the MBeanAttributeInfo. Is adding info.setDescriptor(...) to the AbstractMBeanInvoker.setAttribute(Attribute) finally going to be enough? It looks like this might, I'll test it out. There seem to be an excessive number of copies being made tough, and the same descriptor synchronization is also required on operations. Is there a way to reduce the number of copies being created? xxxxxxxxxxxxxxxxxxxxxxxx Scott Stark Chief Technology Officer JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxx -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Juha Lindfors Sent: Tuesday, January 20, 2004 1:25 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-dev] Too many copies of model mbean info objects If I follow what you're trying to do correctly, the reason for the bug is that the context map descriptors are updated but the info reference we return from getMBeanInfo is not, in AbstractMBeanInvoker, for setters there's a finally block at the end that updates the context maps on the return of the invocation: // TODO: should be fixed by adding invocation return value object finally { ctx.setDescriptor(invocation.getDescriptor()); TCLStack.pop(); } getMBeanInfo() returns the metadata through invoker.getMetaData() call which returns the 'info' reference from AbstractMBeanInvoker /** * The metadata describing this MBean. */ protected MBeanInfo info = null; Which has not been updated with the change. So, is this what needs to be done: finally { ctx.setDescriptor(invocation.getDescriptor()); info.setDescriptor(invocation.getDescriptor(), "attribute"); TCLStack.pop(); } Or did I lose track of what you're trying to do? -- Juha ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
