@Override public Integer getMBeanCount() { return mbeanServer.getMBeanCount(); }
@Override public Integer getMBeanCount() { return mbeanServer.getMBeanCount(); }
@Override public Integer getMBeanCount() { return mbeanServer.getMBeanCount(); }
@Override public Integer getMBeanCount() { return mbeanServer.getMBeanCount(); }
@Override public Integer getMBeanCount() { return mbs.getMBeanCount(); }
/** {@inheritDoc} */ @Override public Integer getMBeanCount() { return origin.getMBeanCount(); }
private void checkServerConnection(MBeanServer hostedServer) throws IOException, MalformedURLException { // Try to connect using client. JMXServiceURL serviceURL = new JMXServiceURL(ConnectorServerFactoryBean.DEFAULT_SERVICE_URL); JMXConnector connector = JMXConnectorFactory.connect(serviceURL); assertNotNull("Client Connector should not be null", connector); // Get the MBean server connection. MBeanServerConnection connection = connector.getMBeanServerConnection(); assertNotNull("MBeanServerConnection should not be null", connection); // Test for MBean server equality. assertEquals("Registered MBean count should be the same", hostedServer.getMBeanCount(), connection.getMBeanCount()); }
@Test public void shouldConvertAllStandardBeansWithoutError() throws Throwable { // given MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); JmxQueryProcedure procedure = new JmxQueryProcedure( ProcedureSignature.procedureName( "bob" ), jmxServer ); // when RawIterator<Object[],ProcedureException> result = procedure.apply( null, new Object[]{"*:*"}, resourceTracker ); // then we verify that we respond with the expected number of beans without error // .. we don't assert more than this, this is more of a smoke test to ensure // that independent of platform, we never throw exceptions even when converting every // single MBean into Neo4j types, and we always get the correct number of MBeans out. assertThat( asList( result ).size(), equalTo( jmxServer.getMBeanCount() )); }
public int getMBeanCount() { if (mbserver != null) { return mbserver.getMBeanCount(); } else { return 0; } }
/** {@inheritDoc} */ public Integer getMBeanCount() { return delegate.getMBeanCount(); }
@Test public void testTestValidConnection() throws Exception { Assume.group(TestGroup.JMXMP); JMXConnectorServer connectorServer = getConnectorServer(); connectorServer.start(); try { MBeanServerConnectionFactoryBean bean = new MBeanServerConnectionFactoryBean(); bean.setServiceUrl(serviceUrl); bean.afterPropertiesSet(); try { MBeanServerConnection connection = bean.getObject(); assertNotNull("Connection should not be null", connection); // perform simple MBean count test assertEquals("MBean count should be the same", getServer().getMBeanCount(), connection.getMBeanCount()); } finally { bean.destroy(); } } finally { connectorServer.stop(); } }
@Test public void testTestWithLazyConnection() throws Exception { Assume.group(TestGroup.JMXMP); MBeanServerConnectionFactoryBean bean = new MBeanServerConnectionFactoryBean(); bean.setServiceUrl(serviceUrl); bean.setConnectOnStartup(false); bean.afterPropertiesSet(); MBeanServerConnection connection = bean.getObject(); assertTrue(AopUtils.isAopProxy(connection)); JMXConnectorServer connector = null; try { connector = getConnectorServer(); connector.start(); assertEquals("Incorrect MBean count", getServer().getMBeanCount(), connection.getMBeanCount()); } finally { bean.destroy(); if (connector != null) { connector.stop(); } } }
/** * Dump out a list of MBeanServer with some statistics. * * @param servers server to dump * @return statistics as strings */ public static String dump(Set<MBeanServerConnection> servers) { StringBuffer ret = new StringBuffer(); ret.append("Found ").append(servers.size()).append(" MBeanServers\n"); for (MBeanServerConnection c : servers) { MBeanServer s = (MBeanServer) c; ret.append(" ") .append("++ ") .append(s.toString()) .append(": default domain = ") .append(s.getDefaultDomain()) .append(", ") .append(s.getMBeanCount()) .append(" MBeans\n"); ret.append(" Domains:\n"); for (String d : s.getDomains()) { appendDomainInfo(ret, s, d); } } ret.append("\n"); ret.append("Platform MBeanServer: ") .append(ManagementFactory.getPlatformMBeanServer()) .append("\n"); return ret.toString(); }
/** * Retrieve the number of mbeans registered.<p> * * This method is invoked by the MBeanServer for * getMBeanCount(). * * @return the number of mbeans registered. */ public int getSize() { return server.getMBeanCount(); }
@Override public Integer getMBeanCount() { int i = 0; if (delegates.size() > 0) { for (MBeanServerPlugin delegate : delegates) { i += delegate.getMBeanCount(); } } i += rootMBeanServer.getMBeanCount(); return i; }
/** * {@inheritDoc} */ @Override public Integer getMBeanCount() { return getDelegate().getMBeanCount(); }
@Override public void handle(DataInput input, final int correlationId) throws IOException { log.trace("GetMBeanCount"); final Integer count = server.getMBeanServer().getMBeanCount(); writeResponse(count, GET_MBEAN_COUNT, correlationId); log.tracef("[%d] GetMBeanCount - Success Response Sent", correlationId); }
/** * Call <code>checkRead()</code>, then forward this method to the wrapped * object. */ @Override public Integer getMBeanCount() { checkRead(); return getMBeanServer().getMBeanCount(); }
@Test public void testGetMBeanCount() throws Exception { assertEquals(mbeanServerConnection.getMBeanCount(), platformMBeanServer.getMBeanCount()); }
@Test public void testGetMBeanCount() throws Exception { assertEquals(mbeanServerConnection.getMBeanCount(), platformMBeanServer.getMBeanCount()); }