001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)StatisticsBase.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.monitoring;
030:
031: import java.util.List;
032:
033: /**
034: * This interface provides the common base for all of the statistics
035: * monitoring interfaces. The methods here provide the infrastucture for
036: * creating an object tree that represents the statistics for the entire JBI
037: * instance. Each instance of a statistics class has a parent and optionally
038: * one or more children. Note that the top object in the tree has no parent.
039: *
040: * @author Sun Microsystems, Inc.
041: */
042: public interface StatisticsBase extends StatisticsMBean {
043: /**
044: * Get the key of this statistics object.
045: * @return the key of this object.
046: */
047: String getKey();
048:
049: /**
050: * Get the parent of this statistics object. The parent of the top object
051: * in the tree is always null.
052: * @return the parent object of this object.
053: */
054: StatisticsBase getParent();
055:
056: /**
057: * Set the parent of this statistics object.
058: * @param parent the parent object of this object.
059: */
060: void setParent(StatisticsBase parent);
061:
062: /**
063: * Add a child statistics object.
064: * @param child the statistics object that is a child of this object.
065: */
066: void addChild(StatisticsBase child);
067:
068: /**
069: * Get a particular child of this statistics object based on a key.
070: * @param key the string containing the key for the child object.
071: * @return the statistics object with the specified key, or null if none
072: * is found.
073: */
074: StatisticsBase getChild(String key);
075:
076: /**
077: * Get a list of all children of this statistics object.
078: * @return a List containing all the children objects. Returns an empty
079: * list if no children exist.
080: */
081: List getChildren();
082:
083: /**
084: * Register an MBean to represent this set of statistics.
085: * @param interfaceClass the interface implemented by the MBean instance.
086: * @param instance the MBean instance to register.
087: * @param mbeanName the JMX ObjectName to use for this MBean.
088: * @throws javax.jbi.JBIException If the MBean creation or registration
089: * fails.
090: */
091: void registerMBean(Class interfaceClass, Object instance,
092: javax.management.ObjectName mbeanName)
093: throws javax.jbi.JBIException;
094:
095: /**
096: * Unregister the MBean for this set of statistics.
097: * @throws javax.jbi.JBIException If the MBean unregistration fails.
098: */
099: void unregisterMBean() throws javax.jbi.JBIException;
100: }
|