Package javax.management

Examples of javax.management.MBeanServer.unregisterMBean()


            MBeanServer server = this.context.getContext().getMBeanServer();
            if (server == null) {
                throw new JBIException("null mBeanServer");
            }
            if (server.isRegistered(this.mbeanName)) {
                server.unregisterMBean(this.mbeanName);
            }
            server.registerMBean(mbean, this.mbeanName);
        }
    }
   
View Full Code Here


            MBeanServer server = this.context.getContext().getMBeanServer();
            if (server == null) {
                throw new JBIException("null mBeanServer");
            }
            if (server.isRegistered(this.mbeanName)) {
                server.unregisterMBean(this.mbeanName);
            }
        }
    }

    /* (non-Javadoc)
 
View Full Code Here

        MBeanServer mbeanServer = getBrokerService().getManagementContext().getMBeanServer();
        if (mbeanServer != null) {
            try {
                ObjectName objectName = createNetworkBridgeObjectName(bridge);
                mbeanServer.unregisterMBean(objectName);
            } catch (Throwable e) {
                LOG.debug("Network bridge could not be unregistered in JMX: " + e.getMessage(), e);
            }
        }
    }
View Full Code Here

            MBeanServer mbeanServer = getManagementContext().getMBeanServer();
            if (mbeanServer != null) {
                for (Iterator<ObjectName> iter = registeredMBeanNames.iterator(); iter.hasNext();) {
                    ObjectName name = iter.next();
                    try {
                        mbeanServer.unregisterMBean(name);
                    } catch (Exception e) {
                        stopper.onException(mbeanServer, e);
                    }
                }
            }
View Full Code Here

            if (mbeanServer != null) {
                try {
                    ObjectName objectName = createConnectorObjectName(connector);

                    if (registeredMBeanNames.remove(objectName)) {
                        mbeanServer.unregisterMBean(objectName);
                    }
                } catch (Throwable e) {
                    throw IOExceptionSupport.create("Transport Connector could not be registered in JMX: " + e.getMessage(), e);
                }
            }
View Full Code Here

            MBeanServer mbeanServer = getManagementContext().getMBeanServer();
            if (mbeanServer != null) {
                try {
                    ObjectName objectName = createNetworkConnectorObjectName(connector);
                    if (registeredMBeanNames.remove(objectName)) {
                        mbeanServer.unregisterMBean(objectName);
                    }
                } catch (Exception e) {
                    LOG.error("Network Connector could not be unregistered from JMX: " + e, e);
                }
            }
View Full Code Here

  static public void unregisterMBean(ObjectName mbeanName) {
    final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    if (mbeanName == null)
        return;
    try {
      mbs.unregisterMBean(mbeanName);
    } catch (InstanceNotFoundException e ) {
      // ignore
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

            // Clean these up ready for the next test
            msg.append(name.toString());
            msg.append(" created via\n");
            msg.append(mbs.getAttribute(name, "CreationStackTrace"));
            msg.append('\n');
            mbs.unregisterMBean(name);
        }
        Assert.assertEquals(msg.toString(), 0, registeredPoolCount);
    }

    /**
 
View Full Code Here

    public void unregisterMBean()
    {
        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
        try
        {
            mbs.unregisterMBean(new ObjectName(mbeanName));
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
View Full Code Here

    }

    public static synchronized void unregisterMBeanFromServer(ObjectName name) {
        try {
            MBeanServer mbs = getMBeanServer();
            mbs.unregisterMBean(name);
        } catch (Exception e) {
            logger.error("Exception unregistering mbean: " + name, e);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.