Package javax.management.openmbean

Examples of javax.management.openmbean.OpenMBeanOperationInfoSupport


             * in the Descriptor in either case.
             */
            final OpenMBeanParameterInfo[] oparams =
                new OpenMBeanParameterInfo[params.length];
            System.arraycopy(params, 0, oparams, 0, params.length);
            oi = new OpenMBeanOperationInfoSupport(operationName,
                                                   description,
                                                   oparams,
                                                   returnType,
                                                   impact,
                                                   descriptor);
View Full Code Here


            return oi;
        if (oi instanceof OpenMBeanOperationInfo) {
            OpenMBeanOperationInfo ooi = (OpenMBeanOperationInfo) oi;
            OpenMBeanParameterInfo[] oparams =
                paramsToOpenParams(signature);
            return new OpenMBeanOperationInfoSupport(oi.getName(),
                                                     description,
                                                     oparams,
                                                     ooi.getReturnOpenType(),
                                                     impact,
                                                     oi.getDescriptor());
View Full Code Here

             * in the Descriptor in either case.
             */
            final OpenMBeanParameterInfo[] oparams =
                new OpenMBeanParameterInfo[params.length];
            System.arraycopy(params, 0, oparams, 0, params.length);
            oi = new OpenMBeanOperationInfoSupport(operationName,
                                                   description,
                                                   oparams,
                                                   returnType,
                                                   impact,
                                                   descriptor);
View Full Code Here

   public void testCtorNullReturnOpenType() throws Exception
   {
      try
      {
         OpenMBeanOperationInfoSupport info =
                 new OpenMBeanOperationInfoSupport("exchangeRate",
                                                   "compute the exchange rate for two currencies",
                                                   signature,
                                                   null,
                                                   MBeanOperationInfo.INFO);
         fail("Expecting IllegalArgumentException");
View Full Code Here

   public void testCtorBogusImpact() throws Exception
   {
      try
      {
         OpenMBeanOperationInfoSupport info =
                 new OpenMBeanOperationInfoSupport("exchangeRate",
                                                   "compute the exchange rate for two currencies",
                                                   signature,
                                                   SimpleType.FLOAT,
                                                   42);
         fail("Expecting IllegalArgumentException");
View Full Code Here

   }

   public void testEquals() throws Exception
   {

      OpenMBeanOperationInfoSupport o1 =
              new OpenMBeanOperationInfoSupport("hello", "Say Hello", params, SimpleType.STRING, 1);
      OpenMBeanOperationInfoSupport o2 =
              new OpenMBeanOperationInfoSupport("hello", "Say Hello", params, SimpleType.STRING, 1);
      OpenMBeanOperationInfoSupport o3 =
              new OpenMBeanOperationInfoSupport("hello", "Say Hello", params, SimpleType.STRING, 0);
      OpenMBeanOperationInfoSupport o4 =
              new OpenMBeanOperationInfoSupport("goAway", "Go Away", params, SimpleType.STRING, 1);
      OpenMBeanOperationInfoSupport o5 =
              new OpenMBeanOperationInfoSupport("goAway", "Hey There", params, SimpleType.STRING, 1);
      OpenMBeanOperationInfoSupport o6 =
              new OpenMBeanOperationInfoSupport("goAway", "Hey There", params, SimpleType.INTEGER, 1);



      //test
      assertTrue(!o1.equals(null));
View Full Code Here

   }

   public void testHashCode() throws Exception
   {
      OpenMBeanOperationInfoSupport infoone =
              new OpenMBeanOperationInfoSupport("convertPrice",
                                                "converts the price from one currency to another",
                                                signature,
                                                SimpleType.FLOAT,
                                                MBeanOperationInfo.ACTION);
      assertTrue("Unexpected hash code", infoone.hashCode() == hashCode(infoone));

      OpenMBeanOperationInfoSupport infotwo =
              new OpenMBeanOperationInfoSupport("convertPrice",
                                                "multiply Currency by exchange rate to get TargetCurrency price",
                                                signature,
                                                SimpleType.FLOAT,
                                                MBeanOperationInfo.ACTION);
      assertTrue("Unexpected hash code", infotwo.hashCode() == hashCode(infoone));
   }
View Full Code Here

                                                   "currency to convert to",
                                                   SimpleType.STRING)};

      OpenMBeanOperationInfo[] testops =
              new OpenMBeanOperationInfoSupport[]{
                 new OpenMBeanOperationInfoSupport("exchangeRate",
                                                   "compute the exchange rate for two currencies",
                                                   ratesig,
                                                   SimpleType.FLOAT,
                                                   MBeanOperationInfo.INFO),
                 new OpenMBeanOperationInfoSupport("exchange",
                                                   "compute the exchange rate for two currencies",
                                                   exsig,
                                                   SimpleType.FLOAT,
                                                   MBeanOperationInfo.INFO)};
View Full Code Here

                                                   "amount of currency to convert",
                                                   SimpleType.FLOAT)};

      ops =
      new OpenMBeanOperationInfoSupport[]{
         new OpenMBeanOperationInfoSupport("exchangeRate",
                                           "compute the exchange rate for two currencies",
                                           ratesig,
                                           SimpleType.FLOAT,
                                           MBeanOperationInfo.INFO),
         new OpenMBeanOperationInfoSupport("exchange",
                                           "compute the exchange rate for two currencies",
                                           exsig,
                                           SimpleType.FLOAT,
                                           MBeanOperationInfo.INFO)};
View Full Code Here

      super.tearDown();
   }

   public void testCtor() throws Exception
   {
      OpenMBeanOperationInfoSupport info =
              new OpenMBeanOperationInfoSupport("exchangeRate",
                                                "compute the exchange rate for two currencies",
                                                signature,
                                                SimpleType.FLOAT,
                                                MBeanOperationInfo.INFO);
      assertTrue("Null info constructed", info != null);
      assertTrue("Unexpected name",
                 info.getName().compareTo("exchangeRate") == 0);
      assertTrue("Unexpected description",
                 info.getDescription().compareTo("compute the exchange rate for two currencies")
                 == 0);
      assertTrue("Unexpected return open type",
                 info.getReturnOpenType().equals(SimpleType.FLOAT));
      assertTrue("Unexpected signature",
                 Arrays.equals(info.getSignature(), signature));
      assertTrue("Unexpected impact",
                 info.getImpact() == MBeanOperationInfo.INFO);
   }
View Full Code Here

TOP

Related Classes of javax.management.openmbean.OpenMBeanOperationInfoSupport

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.