📄 mbeanserver.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.4.2_02) on Thu Nov 13 17:20:51 PST 2003 --><TITLE>MBeanServer (Java 2 Platform Ent. Ed. v1.4)</TITLE><META NAME="keywords" CONTENT="javax.management.MBeanServer interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="MBeanServer (Java 2 Platform Ent. Ed. v1.4)";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Ent. Ed. v1.4</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javax/management/MBeanRegistration.html" title="interface in javax.management"><B>PREV CLASS</B></A> <A HREF="../../javax/management/MBeanServerConnection.html" title="interface in javax.management"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="MBeanServer.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.management</FONT><BR>Interface MBeanServer</H2><DL><DT><B>All Superinterfaces:</B> <DD><A HREF="../../javax/management/MBeanServerConnection.html" title="interface in javax.management">MBeanServerConnection</A></DD></DL><HR><DL><DT>public interface <B>MBeanServer</B><DT>extends <A HREF="../../javax/management/MBeanServerConnection.html" title="interface in javax.management">MBeanServerConnection</A></DL><P><p>This is the interface for MBean manipulation on the agent side. It contains the methods necessary for the creation, registration, and deletion of MBeans as well as the access methods for registered MBeans. This is the core component of the JMX infrastructure.</p> <p>User code does not usually implement this interface. Instead, an object that implements this interface is obtained with one of the methods in the <A HREF="../../javax/management/MBeanServerFactory.html" title="class in javax.management"><CODE>MBeanServerFactory</CODE></A> class.</p> <p>Every MBean which is added to the MBean server becomes manageable: its attributes and operations become remotely accessible through the connectors/adaptors connected to that MBean server. A Java object cannot be registered in the MBean server unless it is a JMX compliant MBean.</p> <p>When an MBean is registered or unregistered in the MBean server a <A HREF="../../javax/management/MBeanServerNotification.html" title="class in javax.management"><CODE>MBeanServerNotification</CODE></A> Notification is emitted. To register an object as listener to MBeanServerNotifications you should call the MBean server method <A HREF="../../javax/management/MBeanServer.html#addNotificationListener(javax.management.ObjectName, javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)"><CODE>addNotificationListener</CODE></A> with <CODE>ObjectName</CODE> the <CODE>ObjectName</CODE> of the <A HREF="../../javax/management/MBeanServerDelegate.html" title="class in javax.management"><CODE>MBeanServerDelegate</CODE></A>. This <CODE>ObjectName</CODE> is: <BR> <CODE>JMImplementation:type=MBeanServerDelegate</CODE>.</p> <p>An object obtained from the <A HREF="../../javax/management/MBeanServerFactory.html#createMBeanServer(java.lang.String)"><CODE>createMBeanServer</CODE></A> or <A HREF="../../javax/management/MBeanServerFactory.html#newMBeanServer(java.lang.String)"><CODE>newMBeanServer</CODE></A> methods of the <A HREF="../../javax/management/MBeanServerFactory.html" title="class in javax.management"><CODE>MBeanServerFactory</CODE></A> class applies security checks to its methods, as follows.</p> <p>First, if there is no security manager (<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/System.html#getSecurityManager()" title="class or interface in java.lang"><CODE>System.getSecurityManager()</CODE></A> is null), then no checks are made.</p> <p>Assuming there is a security manager, the checks are made as detailed below. In what follows, <code>className</code> is the string returned by <A HREF="../../javax/management/MBeanInfo.html#getClassName()"><CODE>MBeanInfo.getClassName()</CODE></A> for the target MBean.</p> <p>If a security check fails, the method throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/SecurityException.html" title="class or interface in java.lang"><CODE>SecurityException</CODE></A>.</p> <p>For methods that can throw <A HREF="../../javax/management/InstanceNotFoundException.html" title="class in javax.management"><CODE>InstanceNotFoundException</CODE></A>, this exception is thrown for a non-existent MBean, regardless of permissions. This is because a non-existent MBean has no <code>className</code>.</p> <ul> <li><p>For the <A HREF="../../javax/management/MBeanServer.html#invoke(javax.management.ObjectName, java.lang.String, java.lang.Object[], java.lang.String[])"><CODE>invoke</CODE></A> method, the caller's permissions must imply <A HREF="../../javax/management/MBeanPermission.html#MBeanPermission(java.lang.String, java.lang.String, javax.management.ObjectName, java.lang.String)"><CODE>MBeanPermission(className, operationName, name, "invoke")</CODE></A>.</p> <li><p>For the <A HREF="../../javax/management/MBeanServer.html#getAttribute(javax.management.ObjectName, java.lang.String)"><CODE>getAttribute</CODE></A> method, the caller's permissions must imply <A HREF="../../javax/management/MBeanPermission.html#MBeanPermission(java.lang.String, java.lang.String, javax.management.ObjectName, java.lang.String)"><CODE>MBeanPermission(className, attribute, name, "getAttribute")</CODE></A>.</p> <li><p>For the <A HREF="../../javax/management/MBeanServer.html#getAttributes(javax.management.ObjectName, java.lang.String[])"><CODE>getAttributes</CODE></A> method, the caller's permissions must imply <A HREF="../../javax/management/MBeanPermission.html#MBeanPermission(java.lang.String, java.lang.String, javax.management.ObjectName, java.lang.String)"><CODE>MBeanPermission(className, null, name, "getAttribute")</CODE></A>. Additionally, for each attribute <em>a</em> in the <A HREF="../../javax/management/AttributeList.html" title="class in javax.management"><CODE>AttributeList</CODE></A>, if the caller's permissions do not imply <A HREF="../../javax/management/MBeanPermission.html#MBeanPermission(java.lang.String, java.lang.String, javax.management.ObjectName, java.lang.String)"><CODE>MBeanPermission(className, <em>a</em>, name, "getAttribute")</CODE></A>, the MBean server will behave as if that attribute had not been in the supplied list.</p> <li><p>For the <A HREF="../../javax/management/MBeanServer.html#setAttribute(javax.management.ObjectName, javax.management.Attribute)"><CODE>setAttribute</CODE></A> method, the caller's permissions must imply <A HREF="../../javax/management/MBeanPermission.html#MBeanPermission(java.lang.String, java.lang.String, javax.management.ObjectName, java.lang.String)"><CODE>MBeanPermission(className, attrName, name, "getAttribute")</CODE></A>, where <code>attrName</code> is <A HREF="../../javax/management/Attribute.html#getName()"><CODE>attribute.getName()</CODE></A>.</p> <li><p>For the <A HREF="../../javax/management/MBeanServer.html#setAttributes(javax.management.ObjectName, javax.management.AttributeList)"><CODE>setAttributes</CODE></A> method, the caller's permissions must imply <A HREF="../../javax/management/MBeanPermission.html#MBeanPermission(java.lang.String, java.lang.String, javax.management.ObjectName, java.lang.String)"><CODE>MBeanPermission(className, null, name, "setAttribute")</CODE></A>. Additionally, for each attribute <em>a</em> in the <A HREF="../../javax/management/AttributeList.html" title="class in javax.management"><CODE>AttributeList</CODE></A>, if the caller's permissions do not imply <A HREF="../../javax/management/MBeanPermission.html#MBeanPermission(java.lang.String, java.lang.String, javax.management.ObjectName, java.lang.String)"><CODE>MBeanPermission(className, <em>a</em>, name, "setAttribute")</CODE></A>, the MBean server will behave as if that attribute had not been in the supplied list.</p> <li><p>For the <code>addNotificationListener</code> methods,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -