001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.activemq.broker.jmx;
018
019import java.util.List;
020
021import javax.management.openmbean.TabularData;
022
023/**
024 * Returns the status events of the broker to indicate any warnings.
025 */
026public interface HealthViewMBean {
027
028    public TabularData health() throws Exception;
029
030    /**
031     * Warning this method can only be invoked if you have the correct version
032     * of {@link HealthStatus} on your classpath or you use something
033     * like <a href="http://jolokia.org/">jolokia</a> to access JMX.
034     *
035     * If in doubt, please use the {@link #getCurrentStatus()} method instead!
036     *
037     * @return a list of HealthStatus objects that describe the health of the Broker.
038     */
039    @MBeanInfo("List of warnings and errors about the current health of the Broker - empty list is Good!")
040    List<HealthStatus> healthList() throws Exception;
041
042    /**
043     * @return a String representation of current Broker health state.
044     */
045    @MBeanInfo("String representation of current Broker state")
046    String healthStatus() throws Exception;
047
048    /**
049     * Warning, this method only return a value if the health or healthList method has previously
050     * been called.  The value is not updated on its own and requires periodic calls to the health
051     * or healthList methods to refresh its value.
052     *
053     * @return String representation of the current Broker state
054     */
055    @MBeanInfo("String representation of current Broker state")
056    String getCurrentStatus();
057
058}