Package javax.management

Examples of javax.management.MBeanParameterInfo


   }

   public void testEquals()
      throws Exception
   {
      MBeanParameterInfo info = new MBeanParameterInfo(
         "name", "type", "description");

      assertTrue("Null should not be equal", info.equals(null) == false);
      assertTrue("Only MBeanParameterInfo should be equal", info.equals(new Object()) == false);

      MBeanParameterInfo info2 = new MBeanParameterInfo(
         "name", "type", "description");

      assertTrue("Different instances of the same data are equal", info.equals(info2));
      assertTrue("Different instances of the same data are equal", info2.equals(info));

      info2 = new MBeanParameterInfo(
         "name", "type", "description2");

      assertTrue("Different instances with different descriptions are not equal", info.equals(info2) == false);
      assertTrue("Different instances with different descritpions are not equal", info2.equals(info) == false);

      info2 = new MBeanParameterInfo(
         "name2", "type", "description");

      assertTrue("Instances with different names are not equal", info.equals(info2) == false);
      assertTrue("Instances with different names are not equal", info2.equals(info) == false);

      info2 = new MBeanParameterInfo(
         "name", "type2", "description");

      assertTrue("Instances with different types are not equal", info.equals(info2) == false);
      assertTrue("Instances with different types are not equal", info2.equals(info) == false);
   }
View Full Code Here


   }

   public void testSerialization()
      throws Exception
   {
      MBeanParameterInfo info = new MBeanParameterInfo(
         "name", "type", "description");

      // Serialize it
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(baos);
View Full Code Here

  
   private void outputParameters(PrintWriter out, MBeanParameterInfo[] params)
   {
      for (int i = 0; i < params.length; i++)
      {
         MBeanParameterInfo paramInfo = params[i];
         out.println("      <parameter>");
         out.println("         <description>" + paramInfo.getDescription() + "</description>");
         out.println("         <name>" + paramInfo.getName() + "</name>");
         out.println("         <type>" + paramInfo.getType() + "</type>");
         out.println("      </parameter>");
      }
   }
View Full Code Here

      this.name = name;
      int count = params != null ? params.length : 0;
      sig = new String[count];
      for(int n = 0; n < count; n ++)
      {
         MBeanParameterInfo p = params[n];
         sig[n] = p.getType();
      }
   }
View Full Code Here

      ModelMBeanOperationInfo setpojoAttributeOperation =
         new ModelMBeanOperationInfo(
            "setpojoAttribute",           // name
            "A simple operation.",        // description
            new MBeanParameterInfo[]      // signature
                  { new MBeanParameterInfo("int", int.class.getName(), "int setter") },
            void.class.getName(),         // return type
            MBeanOperationInfo.ACTION,    // impact
            descr22                       // descriptor
         );
     
View Full Code Here

            final Type originalType = originalParamTypes[i];
            Descriptor descriptor =
                typeDescriptor(openType, originalType);
            descriptor = ImmutableDescriptor.union(descriptor,
                    Introspector.descriptorForAnnotations(annots[i]));
            final MBeanParameterInfo pi;
            if (canUseOpenInfo(originalType)) {
                pi = new OpenMBeanParameterInfoSupport("p" + i,
                                                       paramDescription,
                                                       openType,
                                                       descriptor);
            } else {
                openParameterTypes = false;
                pi = new MBeanParameterInfo(
                    "p" + i,
                    originalTypeString(originalType),
                    paramDescription,
                    descriptor);
            }
View Full Code Here

            final Type originalType = originalParamTypes[i];
            Descriptor descriptor =
                typeDescriptor(openType, originalType);
            descriptor = ImmutableDescriptor.union(descriptor,
                    Introspector.descriptorForAnnotations(annots[i]));
            final MBeanParameterInfo pi;
            if (canUseOpenInfo(originalType)) {
                pi = new OpenMBeanParameterInfoSupport(paramName,
                                                       paramDescription,
                                                       openType,
                                                       descriptor);
            } else {
                openParameterTypes = false;
                pi = new MBeanParameterInfo(
                    paramName,
                    originalTypeString(originalType),
                    paramDescription,
                    descriptor);
            }
View Full Code Here

             true,
             true,
             false));

    MBeanParameterInfo[] params = new MBeanParameterInfo[1];
    params[0] = new MBeanParameterInfo("name", "java.lang.String",
               "Create a logger MBean" );
    dOperations[0] = new MBeanOperationInfo("addLoggerMBean",
            "addLoggerMBean(): add a loggerMBean",
            params ,
            "javax.management.ObjectName",
View Full Code Here

              params,
              "void",
              MBeanOperationInfo.ACTION);

    params = new MBeanParameterInfo[1];
    params[0] = new MBeanParameterInfo("layout class", "java.lang.String",
               "layout class");

    dOperations[1] = new MBeanOperationInfo("setLayout",
              "setLayout(): add a layout",
              params,
View Full Code Here




    MBeanParameterInfo[] params = new MBeanParameterInfo[2];
    params[0] = new MBeanParameterInfo("class name", "java.lang.String",
               "add an appender to this logger");
    params[1] = new MBeanParameterInfo("appender name", "java.lang.String",
               "name of the appender");

    dOperations[0] = new MBeanOperationInfo("addAppender",
              "addAppender(): add an appender",
              params,
View Full Code Here

TOP

Related Classes of javax.management.MBeanParameterInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.