1 /*
   2  * Copyright (c) 2009, 2013, Oracle and/or its affiliates. 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.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 
  27 package com.sun.org.glassfish.external.amx;
  28 
  29 /**
  30     Constants reflecting the AMX specification.
  31     See https://glassfish.dev.java.net/nonav/v3/admin/planning/V3Changes/V3_AMX_SPI.html
  32  */
  33 public final class AMX
  34 {
  35     private AMX()
  36     {
  37         // do not instantiate
  38     }
  39 
  40     /** Attribute yielding the ObjectName of the parent MBean */
  41     public static final String ATTR_PARENT = "Parent";
  42 
  43     /** Attribute yielding the children as an ObjectName[] */
  44     public static final String ATTR_CHILDREN = "Children";
  45 
  46     /** Attribute yielding the name of the MBean,
  47         possibly differing from the name as found in the ObjectName via the
  48         property {@link #NAME_KEY} */
  49     public static final String ATTR_NAME = "Name";
  50 
  51     /** ObjectName property for the type */
  52     public static final String TYPE_KEY = "type";
  53 
  54     /** ObjectName property for the name */
  55     public static final String NAME_KEY = "name";
  56 
  57     /** Implied name for singletons when the name property is not present */
  58     public static final String NO_NAME = "";
  59 
  60     /**
  61     The ObjectName property key denoting the path of the parent MBean.
  62     Serves to disambiguitate the ObjectName from others
  63     that might have the same type and/or name elsewhere in the hierarchy.
  64      */
  65     public static final String PARENT_PATH_KEY = "pp";
  66 
  67     /** Prefix for AMX descriptor fields */
  68     public static final String DESC_PREFIX = "amx.";
  69 
  70     /** Prefix for AMX notification types */
  71     public static final String NOTIFICATION_PREFIX = DESC_PREFIX;
  72 
  73     /**
  74         Descriptor value defined by JMX standard: whether the MBeanInfo is *invariant* (immutable is a misnomer).
  75      */
  76     public static final String DESC_STD_IMMUTABLE_INFO = "immutableInfo";
  77 
  78     /**
  79     Descriptor value defined by JMX standard, the classname of the interface for the MBean.
  80     Mainly advisory, since client code might not have access to the class.
  81      */
  82     public static final String DESC_STD_INTERFACE_NAME = "interfaceName";
  83 
  84     /**
  85     Descriptor value: The generic AMX interface to be used if the class found in {@link #DESC_STD_INTERFACE_NAME}
  86         cannot be loaded.  The class specified here must reside in the amx-core
  87     module eg com.sun.org.glassfish.admin.amx.core eg AMXProxy or AMXConfigProxy.
  88      */
  89     public static final String DESC_GENERIC_INTERFACE_NAME = DESC_PREFIX + "genericInterfaceName";
  90 
  91     /**
  92     Descriptor value: whether the MBean is a singleton, in spite of having a name property in its ObjectName.
  93     This is mainly for compatibility; named singletons are strongly discouraged.
  94      */
  95     public static final String DESC_IS_SINGLETON = DESC_PREFIX + "isSingleton";
  96 
  97     /**
  98     Descriptor value: whether the MBean is a global singleton eg whether in the AMX domain
  99     it can be looked up by its type and is the only MBean of that type.
 100      */
 101     public static final String DESC_IS_GLOBAL_SINGLETON = DESC_PREFIX + "isGlobalSingleton";
 102 
 103     /**
 104     Descriptor value: Arbitrary string denoting the general classification of MBean.
 105     Predefined values include "configuration", "monitoring", "jsr77", "utility", "other".
 106      */
 107     public static final String DESC_GROUP = DESC_PREFIX + "group";
 108 
 109     /**
 110     Descriptor value: whether new children may be added by code other than the implementation responsible for the MBean;
 111     this allows extension points within the hierarchy.
 112     Adding a new child means registering an MBean with an ObjectName that implies parentage via the ancestry type=name pairs.
 113      */
 114     public static final String DESC_SUPPORTS_ADOPTION = DESC_PREFIX + "supportsAdoption";
 115 
 116     /**
 117     Descriptor value: denotes the possible types of MBeans that children might be. If present, SHOULD include all possible and pre-known types.
 118     An empty array indicates that child MBeans might exist, but their types cannot be predicted.
 119      */
 120     public static final String DESC_SUB_TYPES = DESC_PREFIX + "subTypes";
 121 
 122     /**
 123     Group value indicating that the AMX is a configuration MBean.
 124      */
 125     public static final String GROUP_CONFIGURATION = "configuration";
 126     /**
 127     Group value indicating that the AMX represents a monitoring MBean.
 128      */
 129     public static final String GROUP_MONITORING = "monitoring";
 130     /**
 131     Group value indicating that the AMX is a utility MBean.
 132      */
 133     public static final String GROUP_UTILITY = "utility";
 134     /**
 135     Group value indicating that the AMX is a JSR 77 MBean
 136     (J2EE Management) .
 137      */
 138     public static final String GROUP_JSR77 = "jsr77";
 139     /**
 140     Group value indicating that the AMX is not one
 141     of the other types.
 142      */
 143     public static final String GROUP_OTHER = "other";
 144 }