User: juhalindfors
Date: 02/01/23 13:33:39
Modified: src/main/javax/management MBeanServerDelegate.java
MBeanServerDelegateMBean.java
Log:
- Added JBoss style.
- Moved server delegate values to ServerConstants interface.
- Server delegate generates agent ID in format
<IP address>/<currentTimeMillis>/<sequence#>
Revision Changes Path
1.2 +62 -36 jmx/src/main/javax/management/MBeanServerDelegate.java
Index: MBeanServerDelegate.java
===================================================================
RCS file: /cvsroot/jboss/jmx/src/main/javax/management/MBeanServerDelegate.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MBeanServerDelegate.java 2001/12/05 14:18:34 1.1
+++ MBeanServerDelegate.java 2002/01/23 21:33:39 1.2
@@ -1,77 +1,103 @@
/*
- * LGPL
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
*/
+
package javax.management;
+
+import org.jboss.mx.server.ServerConstants;
+import org.jboss.mx.util.AgentID;
-public class MBeanServerDelegate implements MBeanServerDelegateMBean,
NotificationBroadcaster {
+/**
+ * Mandatory MBean server delegate MBean implementation.
+ *
+ * @see javax.management.MBeanServerDelegateMBean
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>.
+ * @version $Revision: 1.2 $
+ *
+ */
+public class MBeanServerDelegate
+ implements MBeanServerDelegateMBean, NotificationBroadcaster
+{
+ // Attributes ----------------------------------------------------
private MBeanNotificationInfo notificationInfo = null;
private NotificationBroadcasterSupport notifier = null;
+ private String agentID = AgentID.create();
- public MBeanServerDelegate() {
+ // Constructors --------------------------------------------------
+ public MBeanServerDelegate()
+ {
this.notificationInfo = new MBeanNotificationInfo(
- new String[] {
- MBeanServerNotification.REGISTRATION_NOTIFICATION,
- MBeanServerNotification.UNREGISTRATION_NOTIFICATION
- },
- MBeanServerNotification.class.getName(),
- "Describes the MBean registration and unregistration events in a MBean
Server."
- );
+ new String[] {
+
MBeanServerNotification.REGISTRATION_NOTIFICATION,
+
MBeanServerNotification.UNREGISTRATION_NOTIFICATION
+ },
+ MBeanServerNotification.class.getName(),
+ "Describes the MBean registration and
unregistration events in a MBean Server."
+ );
this.notifier = new NotificationBroadcasterSupport();
}
- public java.lang.String getMBeanServerId() {
- return "BOOM!";
+ // MBeanServerDelegateMBean implementation -----------------------
+ public String getMBeanServerId()
+ {
+ return agentID;
}
- public java.lang.String getSpecificationName() {
- return "Java Management Extensions Instrumentation and Agent Specification";
+ public String getSpecificationName()
+ {
+ return ServerConstants.SPECIFICATION_NAME;
}
-
- public java.lang.String getSpecificationVersion() {
- return "1.0";
+ public String getSpecificationVersion()
+ {
+ return ServerConstants.SPECIFICATION_VERSION;
}
- public java.lang.String getSpecificationVendor() {
- return "Sun Microsystems, Inc.";
+ public String getSpecificationVendor()
+ {
+ return ServerConstants.SPECIFICATION_VENDOR;
}
- public java.lang.String getImplementationName() {
- return "JBossMX";
+ public String getImplementationName()
+ {
+ return ServerConstants.IMPLEMENTATION_NAME;
}
- public java.lang.String getImplementationVersion() {
- return "0.1";
+ public String getImplementationVersion()
+ {
+ return ServerConstants.IMPLEMENTATION_VERSION;
}
- public java.lang.String getImplementationVendor() {
- return "JBoss Organization";
+ public String getImplementationVendor()
+ {
+ return ServerConstants.IMPLEMENTATION_VENDOR;
}
public void addNotificationListener(NotificationListener listener,
- NotificationFilter filter,
- java.lang.Object handback)
- throws java.lang.IllegalArgumentException {
+ NotificationFilter filter, Object handback) throws IllegalArgumentException
+ {
notifier.addNotificationListener(listener, filter, handback);
}
- public void removeNotificationListener(NotificationListener listener)
- throws ListenerNotFoundException {
+ public void removeNotificationListener(NotificationListener listener) throws
ListenerNotFoundException
+ {
notifier.removeNotificationListener(listener);
}
- public MBeanNotificationInfo[] getNotificationInfo() {
+ public MBeanNotificationInfo[] getNotificationInfo()
+ {
return new MBeanNotificationInfo[] { notificationInfo };
}
- public void sendNotification(Notification notification) {
+ public void sendNotification(Notification notification)
+ {
notifier.sendNotification(notification);
}
-
-
-
-
}
1.2 +23 -11 jmx/src/main/javax/management/MBeanServerDelegateMBean.java
Index: MBeanServerDelegateMBean.java
===================================================================
RCS file:
/cvsroot/jboss/jmx/src/main/javax/management/MBeanServerDelegateMBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MBeanServerDelegateMBean.java 2001/12/03 01:42:58 1.1
+++ MBeanServerDelegateMBean.java 2002/01/23 21:33:39 1.2
@@ -1,24 +1,36 @@
/*
- * LGPL
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
*/
-package javax.management;
-
-public interface MBeanServerDelegateMBean {
- public java.lang.String getMBeanServerId();
+package javax.management;
- public java.lang.String getSpecificationName();
+/**
+ * Management interface of the MBean server delegate MBean.
+ *
+ * @see javax.management.MBeanServerDelegate
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>.
+ * @version $Revision: 1.2 $
+ *
+ */
+public interface MBeanServerDelegateMBean
+{
- public java.lang.String getSpecificationVersion();
+ public String getMBeanServerId();
- public java.lang.String getSpecificationVendor();
+ public String getSpecificationName();
- public java.lang.String getImplementationName();
+ public String getSpecificationVersion();
- public java.lang.String getImplementationVersion();
+ public String getSpecificationVendor();
- public java.lang.String getImplementationVendor();
+ public String getImplementationName();
+ public String getImplementationVersion();
+ public String getImplementationVendor();
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development