Examples of MBeanServerExecutor


Examples of org.jolokia.backend.executor.MBeanServerExecutor

        TestDetector.setThrowAddException(true);
        // New setup because detection happens at construction time
        init();
        try {
            ObjectName oName = new ObjectName(handler.getObjectName());
            MBeanServerExecutor servers = handler.getMBeanServerManager();
            final List<Boolean> results = new ArrayList<Boolean>();
            servers.each(oName, new MBeanServerExecutor.MBeanEachCallback() {
                public void callback(MBeanServerConnection pConn, ObjectName pName)
                        throws ReflectionException, InstanceNotFoundException, IOException, MBeanException {
                    results.add(pConn.isRegistered(pName));
                }
            });
View Full Code Here

Examples of org.jolokia.backend.executor.MBeanServerExecutor

        expect(mockServer.queryNames(new ObjectName("amx:type=domain-root,*"),null)).
                andReturn(new HashSet<ObjectName>(Arrays.asList(serverMbean))).anyTimes();
        expect(mockServer.getAttribute(serverMbean,"ApplicationServerFullVersion")).andReturn(" GlassFish v3.1 ");
        replay(mockServer);

        MBeanServerExecutor mbeanServers = getMBeanServerManager(mockServer);
        ServerHandle info = detector.detect(mbeanServers);
        assertEquals(info.getVersion(), "3.1");
        assertEquals(info.getProduct(),"glassfish");
        Map<String,String> extra =
                info.getExtraInfo(mbeanServers);
View Full Code Here

Examples of org.jolokia.backend.executor.MBeanServerExecutor

        ObjectName bootAmxName = new ObjectName("amx-support:type=boot-amx");
        expect(mockServer.isRegistered(bootAmxName)).andStubReturn(true);
        expect(mockServer.invoke(bootAmxName,"bootAMX",null,null)).andReturn(null);
        replay(mockServer);
        Configuration config = new Configuration(ConfigKey.DETECTOR_OPTIONS,opts);
        MBeanServerExecutor servers = getMBeanServerManager(mockServer);
        handle.postDetect(servers, config, null);
        handle.preDispatch(servers,null);
        verify(mockServer);
    }
View Full Code Here

Examples of org.jolokia.backend.executor.MBeanServerExecutor

        expect(mockServer.isRegistered(bootAmxName)).andStubReturn(true);
        expect(mockServer.invoke(bootAmxName, "bootAMX", null, null)).andThrow(exp);
        LogHandler log = createMock(LogHandler.class);
        log.error(matches(regexp),isA(exp.getClass()));
        replay(mockServer,log);
        MBeanServerExecutor servers = getMBeanServerManager(mockServer);
        handle.postDetect(servers,new Configuration(),log);
        handle.preDispatch(servers,null);
        verify(mockServer);
    }
View Full Code Here

Examples of org.jolokia.backend.executor.MBeanServerExecutor

    public void mbeanRegistration() throws JMException, IOException {
        checkMBeans(new ObjectName(handler.getObjectName()));
    }

    private void checkMBeans(ObjectName oName) throws MBeanException, IOException, ReflectionException {
        MBeanServerExecutor servers = handler.getMBeanServerManager();
        final List<Boolean> result = new ArrayList<Boolean>();
        servers.each(oName, new MBeanServerExecutor.MBeanEachCallback() {
            public void callback(MBeanServerConnection pConn, ObjectName pName)
                    throws ReflectionException, InstanceNotFoundException, IOException, MBeanException {
                // Throws an InstanceNotFoundException
                pConn.getObjectInstance(pName);
                result.add(pConn.isRegistered(pName));
View Full Code Here

Examples of org.jolokia.backend.executor.MBeanServerExecutor

        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST)
                .pathParts("bullerbue", "country=sweden")
                .build();
        MBeanServer dummyConn = EasyMock.createMock(MBeanServer.class);

        MBeanServerExecutor servers = getMBeanServerManager(dummyConn, ManagementFactory.getPlatformMBeanServer());

        ObjectName name = new ObjectName("bullerbue:country=sweden");
        expect(dummyConn.getMBeanInfo(name)).andThrow(new InstanceNotFoundException());
        expect(dummyConn.isRegistered(name)).andReturn(false);
        replay(dummyConn);
View Full Code Here

Examples of org.jolokia.backend.executor.MBeanServerExecutor

        JMXConnector connector = getConnector(pJmxReq);
        try {
            MBeanServerConnection connection = connector.getMBeanServerConnection();
            if (handler.handleAllServersAtOnce(pJmxReq)) {
                // There is no way to get remotely all MBeanServers ...
                MBeanServerExecutor manager = new MBeanServerExecutorRemote(connection);
                return handler.handleRequest(manager,pJmxReq);
            } else {
                return handler.handleRequest(connection,pJmxReq);
            }
        } finally {
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.