Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-1
-
Component/s: None
-
Labels:None
-
Environment:MX4J 1.1.1
-
Number of attachments :
Description
Every time a JMX-managed component is retrieved from a NanoMXContainer, the NanoMXComponentAdapter tries to register it with JMX. MX4J 1.1.1 expects that this will happen only once.
Here is my proposed fix: Add a new ivar called "registered" to NanoMXComponentAdapter and return from the method before registering with JMX if the "registered" ivar is true. Look for // added by JAC below:
public Object getComponentInstance(
MutablePicoContainer componentRegistry) throws
PicoInitializationException,
PicoIntrospectionException,
AssignabilityRegistrationException,
NotConcreteRegistrationException
{
Object component = super.getComponentInstance(componentRegistry);
if (registered) return component; // added by JAC
try
catch (MalformedObjectNameException e)
{ throw new NanoMXInitializationException(e); } catch (MBeanRegistrationException e) { throw new NanoMXInitializationException(e); }catch (NotCompliantMBeanException e)
{ throw new NanoMXInitializationException(e); } catch (InstanceAlreadyExistsException e) { throw new NanoMXInitializationException(e); } registered = true; // added by JAC
return component;
}
Activity
Field | Original Value | New Value |
---|---|---|
Assignee | Aslak Hellesoy [ rinkrank ] | |
Status | Unassigned [ 1 ] | Assigned [ 2 ] |
Fix Version/s | 1.0-alpha-1 [ 10146 ] | |
Status | Assigned [ 2 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] |
Fixed a while ago - slightly different implementation.