public javax.management.MBeanInfo getMBeanInfo() {
    MBeanAttributeInfo[] attributes = attributeInfo();
    MBeanConstructorInfo[] constructors = constructorInfo();
    MBeanOperationInfo[] operations = operationInfo();
    MBeanNotificationInfo[] notifications = notificationInfo();
    return new MBeanInfo("com.tivoli.jmx.tutorial.managedserver",
                 "Httpd RequestQueue MBean",
                 attributes,
                 constructors,
                 operations,
                 notifications);
  }


  private MBeanAttributeInfo[] attributeInfo() {
    MBeanAttributeInfo[] attributes = new MBeanAttributeInfo[2];
    attributes[0] = new MBeanAttributeInfo("capacity",
                          "java.lang.Integer",
                          "Capacity of the Httpd request queue",
                          true,
                          true,
                          false);
    attributes[1] = new MBeanAttributeInfo("length",
                          "java.lang.Integer",
                          "Number of entries currently in the Httpd request queue",
                          true,
                          false,
                          false);
    return attributes;
  }

  private MBeanConstructorInfo[] constructorInfo() {
    MBeanConstructorInfo[] constructors = new MBeanConstructorInfo[1];
    MBeanParameterInfo[] signature = new MBeanParameterInfo[2];
    signature[0] = new MBeanParameterInfo("requestQueue",
                         "java.util.SortedSet",
                         "The Httpd's request queue");
    signature[1] = new MBeanParameterInfo("capacity",
                         "int",
                         "The request queue capacity");
    constructors[0] = new MBeanConstructorInfo("RequestQueueMBean",
                            "Constructor for Httpd request queue MBeans",
                            signature);
    return constructors;
  }

  private MBeanOperationInfo[] operationInfo() {
    MBeanOperationInfo[] operations = new MBeanOperationInfo[1];
    operations[0] = new MBeanOperationInfo("clear",
                          "Remove all entries from the requeust queue",
                          null,
                          "void",
                          MBeanOperationInfo.ACTION);
    return operations;
  }

  private MBeanNotificationInfo[] notificationInfo() {
    return null;
  }