alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

ActiveMQ example source code file (BrokerFacade.java)

This example ActiveMQ source code file (BrokerFacade.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - ActiveMQ tags/keywords

brokerfacade, brokerviewmbean, collection, collection, connectionviewmbean, connectorviewmbean, connectorviewmbean, exception, exception, jobschedulerviewmbean, queueviewmbean, string, string, topicviewmbean, util

The ActiveMQ BrokerFacade.java source code

/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.activemq.web;

import java.util.Collection;

import org.apache.activemq.broker.jmx.*;
import org.apache.activemq.command.ActiveMQDestination;

/**
 * A facade for either a local in JVM broker or a remote broker over JMX
 *
 * 
 * 
 */
public interface BrokerFacade {

	/**
	 * The name of the active broker (f.e. 'localhost' or 'my broker').
	 * 
	 * @return not <code>null
	 * @throws Exception
	 */
	String getBrokerName() throws Exception;

	/**
	 * Admin view of the broker.
	 * 
	 * @return not <code>null
	 * @throws Exception
	 */
	BrokerViewMBean getBrokerAdmin() throws Exception;

	/**
	 * All queues known to the broker.
	 * 
	 * @return not <code>null
	 * @throws Exception
	 */
	Collection<QueueViewMBean> getQueues() throws Exception;

	/**
	 * All topics known to the broker.
	 * 
	 * @return not <code>null
	 * @throws Exception
	 */
	Collection<TopicViewMBean> getTopics() throws Exception;

	/**
	 * All active consumers of a queue.
	 * 
	 * @param queueName
	 *            the name of the queue, not <code>null
	 * @return not <code>null
	 * @throws Exception
	 */
	Collection<SubscriptionViewMBean> getQueueConsumers(String queueName)
			throws Exception;

	/**
	 * Active durable subscribers to topics of the broker.
	 * 
	 * @return not <code>null
	 * @throws Exception
	 */
	Collection<DurableSubscriptionViewMBean> getDurableTopicSubscribers()
			throws Exception;


	/**
	 * Inactive durable subscribers to topics of the broker.
	 *
	 * @return not <code>null
	 * @throws Exception
	 */
	Collection<DurableSubscriptionViewMBean> getInactiveDurableTopicSubscribers()
			throws Exception;

	/**
	 * The names of all transport connectors of the broker (f.e. openwire, ssl)
	 * 
	 * @return not <code>null
	 * @throws Exception
	 */
	Collection<String> getConnectors() throws Exception;

	/**
	 * A transport connectors.
	 * 
	 * @param name
	 *            name of the connector (f.e. openwire)
	 * @return <code>null if not found
	 * @throws Exception
	 */
	ConnectorViewMBean getConnector(String name) throws Exception;

	/**
	 * All connections to all transport connectors of the broker.
	 * 
	 * @return not <code>null
	 * @throws Exception
	 */
	Collection<ConnectionViewMBean> getConnections() throws Exception;

	/**
	 * The names of all connections to a specific transport connectors of the
	 * broker.
	 * 
	 * @see #getConnection(String)
	 * @param connectorName
	 *            not <code>null
	 * @return not <code>null
	 * @throws Exception
	 */
	Collection<String> getConnections(String connectorName) throws Exception;

	/**
	 * A specific connection to the broker.
	 * 
	 * @param connectionName
	 *            the name of the connection, not <code>null
	 * @return not <code>null
	 * @throws Exception
	 */
	ConnectionViewMBean getConnection(String connectionName) throws Exception;
	/**
	 * Returns all consumers of a connection.
	 * 
	 * @param connectionName
	 *            the name of the connection, not <code>null
	 * @return not <code>null
	 * @throws Exception
	 */
	Collection<SubscriptionViewMBean> getConsumersOnConnection(
			String connectionName) throws Exception;
	/**
	 * The brokers network connectors.
	 * 
	 * @return not <code>null
	 * @throws Exception
	 */
	Collection<NetworkConnectorViewMBean> getNetworkConnectors()
			throws Exception;


	/**
	 * The brokers network bridges.
	 *
	 * @return not <code>null
	 * @throws Exception
	 */
    Collection<NetworkBridgeViewMBean> getNetworkBridges()
            throws Exception;

    /**
	 * Purges the given destination
	 * 
	 * @param destination
	 * @throws Exception
	 */
	void purgeQueue(ActiveMQDestination destination) throws Exception;
	/**
	 * Get the view of the queue with the specified name.
	 * 
	 * @param name
	 *            not <code>null
	 * @return <code>null if no queue with this name exists
	 * @throws Exception
	 */
	QueueViewMBean getQueue(String name) throws Exception;
	/**
	 * Get the view of the topic with the specified name.
	 * 
	 * @param name
	 *            not <code>null
	 * @return <code>null if no topic with this name exists
	 * @throws Exception
	 */
	TopicViewMBean getTopic(String name) throws Exception;
	
	/**
	 * Get the JobScheduler MBean
	 * @return the jobScheduler or null if not configured
	 * @throws Exception
	 */
	JobSchedulerViewMBean getJobScheduler() throws Exception;
	
	/**
     * Get the JobScheduler MBean
     * @return the jobScheduler or null if not configured
     * @throws Exception
     */
    Collection<JobFacade> getScheduledJobs() throws Exception;

    boolean isJobSchedulerStarted();

}

Other ActiveMQ examples (source code examples)

Here is a short list of links related to this ActiveMQ BrokerFacade.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.