jdk/src/share/classes/javax/management/namespace/JMXNamespaceMBean.java
changeset 1156 bbc2d15aaf7a
equal deleted inserted replaced
1155:a9a142fcf1b5 1156:bbc2d15aaf7a
       
     1 /*
       
     2  * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4  *
       
     5  * This code is free software; you can redistribute it and/or modify it
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.  Sun designates this
       
     8  * particular file as subject to the "Classpath" exception as provided
       
     9  * by Sun in the LICENSE file that accompanied this code.
       
    10  *
       
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    14  * version 2 for more details (a copy is included in the LICENSE file that
       
    15  * accompanied this code).
       
    16  *
       
    17  * You should have received a copy of the GNU General Public License version
       
    18  * 2 along with this work; if not, write to the Free Software Foundation,
       
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    20  *
       
    21  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
       
    22  * CA 95054 USA or visit www.sun.com if you need additional information or
       
    23  * have any questions.
       
    24  */
       
    25 
       
    26 package javax.management.namespace;
       
    27 
       
    28 import java.io.IOException;
       
    29 import java.util.UUID;
       
    30 
       
    31 /**
       
    32  * A {@link JMXNamespace} is an MBean that handles a name space in the
       
    33  * MBeanServer hierarchical name space.
       
    34  * @see JMXNamespace
       
    35  * @since 1.7
       
    36  */
       
    37 public interface JMXNamespaceMBean {
       
    38 
       
    39     // Note: since getDomains(), getDefaultDomain(), and getMBeanCount()
       
    40     // don't take any ObjectName parameters, the only efficient way
       
    41     // to get these data is to call the corresponding method on the
       
    42     // JMXNamespaceMBean that handles the name space.
       
    43     //
       
    44     // We need these methods to implement 'cd' (JMXNamespaces.narrowToNamespace)
       
    45     // correctly.
       
    46     //
       
    47 
       
    48     /**
       
    49      * Returns the list of domains currently implemented in the name space
       
    50      * handled by this {@link JMXNamespace}.
       
    51      * @throws IOException if the domain list cannot be obtained due to
       
    52      *         I/O problems (communication failures etc...).
       
    53      * @return the list of domains currently implemented in the name space
       
    54      * handled by this {@link JMXNamespace}.
       
    55      * @see javax.management.MBeanServerConnection#getDomains
       
    56      *      MBeanServerConnection.getDomains
       
    57      **/
       
    58     public String[] getDomains() throws IOException;
       
    59 
       
    60     /**
       
    61      * Returns the default domain for the name space handled by
       
    62      * this {@link JMXNamespace}.
       
    63      * @throws IOException if the default domain cannot be obtained due to
       
    64      *         I/O problems (communication failures etc...).
       
    65      * @return the default domain for the name space handled by
       
    66      * this {@link JMXNamespace}.
       
    67      * @see javax.management.MBeanServerConnection#getDefaultDomain
       
    68      *      MBeanServerConnection.getDefaultDomain
       
    69      **/
       
    70     public String   getDefaultDomain() throws IOException;
       
    71 
       
    72     /**
       
    73      * Returns the number of MBeans registered in the  name space handled by
       
    74      *         this  {@link JMXNamespace}.
       
    75      *
       
    76      * @return the number of MBeans registered in the  name space handled by
       
    77      *         this  {@link JMXNamespace}.
       
    78      *
       
    79      * @throws IOException if the MBean count cannot be obtained due to
       
    80      *         I/O problems (communication failures etc...).
       
    81      * @see javax.management.MBeanServerConnection#getMBeanCount
       
    82      *      MBeanServerConnection.getMBeanCount
       
    83      */
       
    84     public Integer  getMBeanCount() throws IOException;
       
    85 
       
    86     /**
       
    87      * Returns a {@link java.util.UUID UUID string} which uniquely identifies
       
    88      * this {@linkplain JMXNamespace} MBean.
       
    89      * This information can be used to detect loops in the JMX name space graph.
       
    90      * @return A unique ID identifying this MBean.
       
    91      * @throws IOException if the MBean UUID cannot be obtained due to
       
    92      *         I/O problems (communication failures etc...).
       
    93      */
       
    94     public String getUUID() throws IOException;
       
    95 
       
    96 }