@Test public void shouldAddMBeanContainerAsEventListener() throws Exception { ArgumentCaptor<MBeanContainer> captor = ArgumentCaptor.forClass(MBeanContainer.class); jetty9Server.configure(); verify(server).addEventListener(captor.capture()); MBeanContainer mBeanContainer = captor.getValue(); assertThat(mBeanContainer.getMBeanServer(), is(not(nullValue()))); }
private void unregister(ObjectName objectName) { try { getMBeanServer().unregisterMBean(objectName); if (LOG.isDebugEnabled()) LOG.debug("Unregistered {}", objectName); } catch (MBeanRegistrationException | InstanceNotFoundException x) { LOG.ignore(x); } catch (Throwable x) { LOG.warn(x); } } }
private void unregister(ObjectName objectName) { try { getMBeanServer().unregisterMBean(objectName); if (LOG.isDebugEnabled()) LOG.debug("Unregistered {}", objectName); } catch (MBeanRegistrationException | InstanceNotFoundException x) { LOG.ignore(x); } catch (Throwable x) { LOG.warn(x); } } }