Package org.apache.activemq.broker.jmx

Examples of org.apache.activemq.broker.jmx.ManagementContext


        broker.setBrokerName("localhost");
        broker.setUseJmx(true);
        broker.setDeleteAllMessagesOnStartup(deleteAllMessagesOnStartup);
        broker.addConnector("tcp://localhost:0");

        ManagementContext ctx = new ManagementContext();
        //if createConnector == true everything is fine
        ctx.setCreateConnector(false);
        broker.setManagementContext(ctx);

        broker.start();
        broker.waitUntilStarted();
View Full Code Here


        params.put("BrokerName", broker.getBrokerName());
        params.put("Type", "Queue");
        params.put("Destination", queueName);
        ObjectName queueObjectName = ObjectName.getInstance(amqDomain, params);
       
        ManagementContext mgmtCtx = broker.getManagementContext();
        QueueViewMBean queueView = (QueueViewMBean)mgmtCtx.newProxyInstance(queueObjectName, QueueViewMBean.class, true);
       
        Object[] messages = (Object[]) queueView.browse();
       
    LOG.info("+Browsed with JMX: " + messages.length);
       
View Full Code Here

            // URI(brokerURI));
            BrokerService broker = new BrokerService();
            broker.setPersistent(false);

            // for running on Java 5 without mx4j
            ManagementContext managementContext = broker.getManagementContext();
            managementContext.setFindTigerMbeanServer(true);
            managementContext.setUseMBeanServer(true);
            managementContext.setCreateConnector(false);

            broker.setUseJmx(true);
            // broker.setPlugins(new BrokerPlugin[] { new
            // ConnectionDotFilePlugin(), new UDPTraceBrokerPlugin() });
            broker.addConnector("tcp://localhost:61616");
View Full Code Here

        protected BrokerService createBroker() throws Exception {
        BrokerService answer = new BrokerService();
        answer.setPersistent(isPersistent());
        answer.addConnector(bindAddress);
        ManagementContext context = new ManagementContext();
        context.setConnectorPort(1199);
        answer.setManagementContext(context);
        return answer;
    }
View Full Code Here

        params.put("BrokerName", broker.getBrokerName());
        params.put("Type", "Queue");
        params.put("Destination", queueName);
        ObjectName queueObjectName = ObjectName.getInstance(amqDomain, params);
       
        ManagementContext mgmtCtx = broker.getManagementContext();
        QueueViewMBean queueView = (QueueViewMBean)mgmtCtx.newProxyInstance(queueObjectName, QueueViewMBean.class, true);
       
        Object[] messages = (Object[]) queueView.browse();
       
    LOG.info("+Browsed with JMX: " + messages.length);
       
View Full Code Here

        this.brokerObjectName = brokerObjectName;
    }

    public ManagementContext getManagementContext() {
        if (managementContext == null) {
            managementContext = new ManagementContext();
        }
        return managementContext;
    }
View Full Code Here

        params.put("BrokerName", broker.getBrokerName());
        params.put("Type", "Queue");
        params.put("Destination", queueName);
        ObjectName queueObjectName = ObjectName.getInstance(amqDomain, params);
       
        ManagementContext mgmtCtx = broker.getManagementContext();
        QueueViewMBean queueView = (QueueViewMBean)mgmtCtx.newProxyInstance(queueObjectName, QueueViewMBean.class, true);
       
        Object[] messages = (Object[]) queueView.browse();
       
    LOG.info("+Browsed with JMX: " + messages.length);
       
View Full Code Here

        this.brokerObjectName = brokerObjectName;
    }

    public ManagementContext getManagementContext() {
        if (managementContext == null) {
            managementContext = new ManagementContext();
        }
        return managementContext;
    }
View Full Code Here

        this.brokerObjectName = brokerObjectName;
    }

    public ManagementContext getManagementContext() {
        if (managementContext == null) {
            managementContext = new ManagementContext();
        }
        return managementContext;
    }
View Full Code Here

    public ConnectionDotFileInterceptor(Broker next, String file, boolean redrawOnRemove)
            throws MalformedObjectNameException {
        super(next, file);
        this.redrawOnRemove = redrawOnRemove;

        mbeanServer = new ManagementContext().getMBeanServer();
        ObjectName brokerName = new ObjectName(domain + ":Type=Broker,BrokerName=localhost");
        brokerView = (BrokerViewMBean) MBeanServerInvocationHandler.newProxyInstance(mbeanServer, brokerName,
                BrokerViewMBean.class, true);
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.broker.jmx.ManagementContext

Copyright © 2018 www.massapicom. 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.