Package javax.management

Examples of javax.management.MBeanServerConnection.unregisterMBean()


      MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());
      ObjectName name = ObjectName.getInstance("", "test", "invocation");
      ObjectInstance instance = mbsc.createMBean(Support.class.getName(), name, null);
      assertNotNull(instance);

      mbsc.unregisterMBean(name);
      if (mbsc.isRegistered(name)) fail();
   }

   public void testAuthenticatedInvoke() throws Exception
   {
View Full Code Here


      assertNotNull(notification);
      listener.reset();

      cntion.removeNotificationListener(delegateName, listener);

      cntion.unregisterMBean(name);
      sleep(1000);

      notification = (Notification)listener.get();
      assertNull(notification);
View Full Code Here

        // At the time of this writing, HBase didn't unregister the MBean of a replication source
        try {
            MBeanServerConnection connection = java.lang.management.ManagementFactory.getPlatformMBeanServer();
            ObjectName replicationSourceMBean = new ObjectName(MBEAN_NAME + peerId);
            connection.unregisterMBean(replicationSourceMBean);
        } catch (Exception e) {
            throw new RuntimeException("Error removing replication source mean for " + peerId, e);
        }
    }
View Full Code Here

        // At the time of this writing, HBase didn't unregister the MBean of a replication source
        try {
            MBeanServerConnection connection = java.lang.management.ManagementFactory.getPlatformMBeanServer();
            ObjectName query = new ObjectName(MBEAN_NAME + NAME_WILDCARD);
            for (ObjectName name : connection.queryNames(query, null)) {
                connection.unregisterMBean(name);
            }
        } catch (Exception e) {
            throw new RuntimeException("Error removing replication source mbean", e);
        }
    }
View Full Code Here

        }

        try {
            MBeanServerConnection connection = java.lang.management.ManagementFactory.getPlatformMBeanServer();
            ObjectName replicationSourceMBean = new ObjectName("hadoop:service=Replication,name=ReplicationSource for " + peerId);
            connection.unregisterMBean(replicationSourceMBean);
        } catch (Exception e) {
            throw new RuntimeException("Error removing replication source mean for " + peerId, e);
        }
    }
View Full Code Here

                            } else {
                                if(ev.getSource() == unregisterMBeanButton) {
                                    MBeanServerConnection connection =
                                        ((ProxyClient) c).
                                        getMBeanServerConnection();
                                    connection.unregisterMBean(new
                                        ObjectName(HOTSPOT_MBEAN_OBJECTNAME));
                                }
                            }
                            return;
                        } catch(InstanceAlreadyExistsException e) {
View Full Code Here

                 null,
                 null);
            // Unregister SimpleStandard MBean
            //
            System.out.println("Unregister SimpleStandard MBean...");
            mbsc.unregisterMBean(new ObjectName("MBeans:name=SimpleStandard"));
            // Close MBeanServer connection
            //
            jmxc.close();
            System.out.println("Bye! Bye!");
        } catch (Exception e) {
View Full Code Here

                 null,
                 null);
            // Unregister SimpleStandard MBean
            //
            System.out.println("Unregister SimpleStandard MBean...");
            mbsc.unregisterMBean(new ObjectName("MBeans:name=SimpleStandard"));
            // Close MBeanServer connection
            //
            jmxc.close();
            System.out.println("Bye! Bye!");
        } catch (Exception e) {
View Full Code Here

                 null,
                 null);
            // Unregister SimpleStandard MBean
            //
            System.out.println("Unregister SimpleStandard MBean...");
            mbsc.unregisterMBean(new ObjectName("MBeans:type=SimpleStandard"));
        } catch (SecurityException e) {
            if (testResult.equals("ko")) {
                System.out.println("Got expected security exception = " + e);
            } else {
                System.out.println("Got unexpected security exception = " + e);
View Full Code Here

                 null,
                 null);
            // Unregister SimpleStandard MBean
            //
            System.out.println("Unregister SimpleStandard MBean...");
            mbsc.unregisterMBean(new ObjectName("MBeans:type=SimpleStandard"));
        } catch (SecurityException e) {
            if (testResult.equals("ko")) {
                System.out.println("Got expected security exception = " + e);
            } else {
                System.out.println("Got unexpected security exception = " + 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.