[Design of JBoss Remoting, Unified Invokers] - Re: Duplicate mbean removal
by ron.sigal@jboss.com
This is related to changes I made for JBREM-747 "org.jboss.remoting.transport.Connector should unregister server invoker from MBeanServer".
Connector.init(), which is called from Connector.create(), used to have the code
| ObjectName objName = new ObjectName(invoker.getMBeanObjectName());
| if (!server.isRegistered(objName))
| {
| server.registerMBean(invoker, objName);
| invoker.setMBeanServer(server);
| }
|
The problem was that when a Connector stops and restarts, it sees that it's already registered, doesn't pass the MBeanServer to the invoker, and the invoker is unable to see other MBeans. So I changed it to
| ObjectName objName = new ObjectName(invoker.getMBeanObjectName());
| if (!server.isRegistered(objName))
| {
| server.registerMBean(invoker, objName);
| }
| else
| {
| log.warn(objName + " is already registered with MBeanServer");
| }
| invoker.setMBeanServer(server);
|
I also added
| if (server != null)
| {
| try
| {
| ObjectName objName = new ObjectName(invoker.getMBeanObjectName());
| server.unregisterMBean(objName);
| }
| catch (Exception e)
| {
| log.error("invalid Object Name", e);
| }
| }
|
to Connector.stop().
I'm confused. Judging from the original code, Connector clearly expects to register itself. And since Connector is registering itself, I thought it should also unregister itself.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098555#4098555
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098555
17 years, 2 months