KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > base > AMX


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 /*
25  * $Header: /cvs/glassfish/admin-core/mbeanapi/src/java/com/sun/appserv/management/base/AMX.java,v 1.8 2005/12/25 03:48:52 tcfujii Exp $
26  * $Revision: 1.8 $
27  * $Date: 2005/12/25 03:48:52 $
28  */

29
30 package com.sun.appserv.management.base;
31
32 import java.util.Map JavaDoc;
33
34 import javax.management.ObjectName JavaDoc;
35 import javax.management.MBeanInfo JavaDoc;
36 import javax.management.NotificationEmitter JavaDoc;
37
38 import com.sun.appserv.management.DomainRoot;
39
40
41 /**
42     Base interface implemented by all available interfaces part
43     of the <b>A</b>pp<b>s</b>erver <b>A</b>pplication <b>P</b>rogramming
44     <b>I</b>nterface (AMX).
45     An AMX is actually a dynamic client-side proxy to a server-side MBean.
46     It provides a strongly typed and convenient interface for accessing
47     the server-side MBeans.
48     <p>
49     Certain conventions are followed when an AMX provides
50     access to other AMX instances; when a single item is returned, the return
51     type is strongly-typed. When a Map or Set is returned,
52     the values found in the Map or Set must be cast appropriately. The context
53     should make it obvious what the appropriate cast is.
54     It is always safe to cast to AMX, since this is base interface.
55     <p>
56     Additional information, such as {@link javax.management.MBeanInfo} for the target MBean,
57     may be obtained via {@link Util#getExtra}
58     <p>
59     All AMX that emit Notifications place a Map within
60     the userData field of a standard {@link javax.management.Notification}
61     which may be obtained via {@link javax.management.Notification#getUserData}.
62     Within the Map are zero or more items, which vary with the Notification type.
63     Each Notification type, and data available within the Notification,
64     is defined in its respective MBean or in an appropriate place.
65     
66     @see Util#getExtra
67     @see com.sun.appserv.management.base.Extra
68     @see com.sun.appserv.management.base.Container
69     @see com.sun.appserv.management.base.StdAttributesAccess
70     @see com.sun.appserv.management.config.PropertiesAccess
71     @see com.sun.appserv.management.monitor.MonitoringStats
72     @see com.sun.appserv.management.j2ee.J2EEDomain
73  */

74 public interface AMX extends NotificationEmitter JavaDoc, AMXMBeanLogging
75 {
76     /**
77         The prefix for all Notification types issued by AMX.
78      */

79     public static final String JavaDoc NOTIFICATION_PREFIX = "com.sun.appserv.management.";
80     
81     /**
82         The JMX domain in which all AMX MBeans are located.
83      */

84     public static final String JavaDoc JMX_DOMAIN = "amx";
85     
86     /**
87         Get the AMX which logically contains this one. All AMX have
88         a Container except for DomainRoot.
89         
90         @return the parent proxy for this one, possibly null.
91         @see AMXAttributes#ATTR_CONTAINER_OBJECT_NAME
92      */

93     public Container getContainer();
94     
95     /**
96         Get the DomainRoot.
97         
98         @return the Domain representing the Appserver Domain to which this belongs
99      */

100     public DomainRoot getDomainRoot();
101     
102     /**
103         The delimiter between parts of a fully-qualified type as returned
104         by {@link #getFullType}.
105      */

106     public static final String JavaDoc FULL_TYPE_DELIM = ".";
107     
108     
109     /**
110         Value from {@link #getGroup} indicating that the AMX is a
111         configuration MBean.
112      */

113     public static final String JavaDoc GROUP_CONFIGURATION = "configuration";
114     
115     /**
116         Value from {@link #getGroup} indicating that the AMX represents a monitoring MBean.
117      */

118     public static final String JavaDoc GROUP_MONITORING = "monitoring";
119     
120     /**
121         Value from {@link #getGroup} indicating that the AMX is a utility MBean.
122      */

123     public static final String JavaDoc GROUP_UTILITY = "utility";
124     
125     /**
126         Value from {@link #getGroup} indicating that the AMX is a JSR 77 MBean
127         (J2EE Management) .
128      */

129     public static final String JavaDoc GROUP_JSR77 = "jsr77";
130     
131     /**
132         Value from {@link #getGroup} indicating that the AMX is not one
133         of the other types.
134      */

135     public static final String JavaDoc GROUP_OTHER = "other";
136     
137     
138     
139     /**
140         The ObjectName property key denoting the type of the MBean.
141      */

142     public final static String JavaDoc J2EE_TYPE_KEY = "j2eeType";
143     
144     /**
145         The ObjectName property key denoting the name of the MBean.
146      */

147     public final static String JavaDoc NAME_KEY = "name";
148     
149     /**
150         The name given to any MBean lacking a "real" name. Certain
151         MBeans are singletons within their scope, and while they have
152         a "name" field within their ObjectName (property {@link #NAME_KEY}),
153         they have no meaningful name.
154      */

155     public final static String JavaDoc NO_NAME = "na";
156     
157     /**
158         The name used when a FullType part refers to a <i>non-existent</i>
159         parent eg a standalone ejb or web module that has a null J2EEApplication.
160      */

161     public final static String JavaDoc NULL_NAME = "null"; // do not change this--it's standard!
162

163     
164     /**
165         Format:<br>
166         <pre>
167             [[[<i>part</i>].]*]<i>j2eeType</i>
168         </pre>
169         Example for j2eeType=Servlet:
170         <pre>
171         type=J2EEServer.J2EEApplication.WebModule.Servlet
172         </pre>
173         @see AMXAttributes#ATTR_FULL_TYPE
174      */

175     public String JavaDoc getFullType();
176     
177     
178     /**
179         Possible values include:
180         <ul>
181         <li>{@link #GROUP_CONFIGURATION}</li>
182         <li>{@link #GROUP_MONITORING}</li>
183         <li>{@link #GROUP_UTILITY}</li>
184         <li>{@link #GROUP_JSR77}</li>
185         <li>{@link #GROUP_OTHER}</li>
186         </ul>
187         @return the group to which this AMX belongs.
188         @see AMXAttributes#ATTR_GROUP
189      */

190     public String JavaDoc getGroup();
191
192
193     
194     /**
195         Get the j2eeType of this item. Same as the value of the 'j2eeType' property
196         within the ObjectName. The ObjectNames of all AMX contain a property whose
197         key is "j2eeType" ({@link #J2EE_TYPE_KEY}) and whose value is specific to the
198         sub-interface the item represents. Equivalent to the J2EE_TYPE field
199         found in each AMX sub-interface.
200         
201         @return String which is the j2eeType
202         @see XTypes
203         @see com.sun.appserv.management.j2ee.J2EETypes
204      */

205     public String JavaDoc getJ2EEType();
206     
207     
208     
209     /**
210         Get the name of this item. Same as the value of the 'name' property
211         within the ObjectName.
212         
213         @return the "name" property value as found inside the ObjectName
214         @see #NAME_KEY
215      */

216     public String JavaDoc getName();
217     
218     /**
219         @return true if this MBean runs natively in DAS, or false if it's a proxy
220         to an MBean outside the DAS.
221      */

222     public boolean isDAS();
223 }
224
225
226
227
Popular Tags