Package javax.management

Examples of javax.management.MBeanOperationInfo


         
        default:
          operationType = MBeanOperationInfo.UNKNOWN;
      }
     
      MBeanOperationInfo operation = new MBeanOperationInfo(methodDetail.getMethod().getName(),
          methodDetail.getDescription(), parameters, methodDetail.getMethod().getReturnType().getName(),
          operationType);

      operations.add(operation);
View Full Code Here


    public MBeanOperationInfoWrapper[] getMBeanOperationInfoWrappers() {
        MBeanOperationInfo[] operations = info.getOperations();
        MBeanOperationInfoWrapper[] opWrappers = new MBeanOperationInfoWrapper[operations.length];
        for (int i = 0; i < operations.length; i++) {
            MBeanOperationInfo opInfo = operations[i];
            opWrappers[i] = new MBeanOperationInfoWrapper(opInfo, this);
        }
        return opWrappers;
    }
View Full Code Here

        for (int i = 0; i < attributes.length; i++) {
            MBeanAttributeInfo attrInfo = attributes[i];
            o[i] = new MBeanAttributeInfoWrapper(attrInfo, this);
        }
        for (int i = 0; i < operations.length; i++) {
            MBeanOperationInfo opInfo = operations[i];
            o[attributes.length + i] = new MBeanOperationInfoWrapper(opInfo,
                    this);
        }
        return o;
    }
View Full Code Here

      try
      {
         Class c = this.getClass();
         Method m = c.getMethod("testConstructorWithMethod", new Class[0]);
        
         MBeanOperationInfo info = new MBeanOperationInfo("This is a description.", m);
        
         assertTrue(info.getDescription().equals("This is a description."));
         assertTrue(info.getName().equals(m.getName()));
         assertTrue(info.getReturnType().equals("void"));
         assertTrue(info.getSignature().length == 0);
         assertTrue(info.getImpact() == MBeanOperationInfo.UNKNOWN);
      }
      catch (AssertionFailedError e)
      {
         throw e;
      }
View Full Code Here

    */
   public void testClone()
   {
      try
      {
         MBeanOperationInfo info = new MBeanOperationInfo(
               "MyOperation",
               "This is a description.",
               new MBeanParameterInfo[] {
                        new MBeanParameterInfo("FooParam", "java.lang.Object", "description"),
                        new MBeanParameterInfo("BarParam", "java.lang.String", "description")
               },
               "java.util.StringBuffer",
               MBeanOperationInfo.ACTION_INFO
         );
        
         MBeanOperationInfo clone = (MBeanOperationInfo)info.clone();
        
         assertTrue(clone.getDescription().equals("This is a description."));
         assertTrue(clone.getName().equals("MyOperation"));
         assertTrue(clone.getReturnType().equals("java.util.StringBuffer"));
         assertTrue(clone.getSignature().length == 2);
         assertTrue(clone.getImpact() == MBeanOperationInfo.ACTION_INFO);
         assertTrue(clone.getSignature() [0].getName().equals("FooParam"));
         assertTrue(clone.getSignature() [1].getName().equals("BarParam"));
         assertTrue(clone.getSignature() [0].getDescription().equals("description"));
         assertTrue(clone.getSignature() [1].getDescription().equals("description"));
         assertTrue(clone.getSignature() [0].getType().equals("java.lang.Object"));
         assertTrue(clone.getSignature() [1].getType().equals("java.lang.String"));
        
      }
      catch (AssertionFailedError e)
      {
         throw e;
View Full Code Here

    */
   public void testGetNameEmpty()
   {
      try
      {
         MBeanOperationInfo info1 = new MBeanOperationInfo(
               "",
               "This is a description.",
               new MBeanParameterInfo[] {
                        new MBeanParameterInfo("FooParam", "java.lang.Object", "description"),
                        new MBeanParameterInfo("BarParam", "java.lang.String", "description")
               },
               "java.util.StringBuffer",
               MBeanOperationInfo.ACTION_INFO
         );
        
         assertTrue(info1.getName().equals(""));
        
      }
      catch (AssertionFailedError e)
      {
         throw e;
View Full Code Here

    */
   public void testGetNameNull()
   {
      try
      {
         MBeanOperationInfo info1 = new MBeanOperationInfo(
               null,
               "This is a description.",
               new MBeanParameterInfo[] {
                        new MBeanParameterInfo("FooParam", "java.lang.Object", "description"),
                        new MBeanParameterInfo("BarParam", "java.lang.String", "description")
               },
               "java.util.StringBuffer",
               MBeanOperationInfo.ACTION_INFO
         );
        
         assertTrue(info1.getName() == null);
        
      }
      catch (AssertionFailedError e)
      {
         throw e;
View Full Code Here

    */
   public void testGetDescriptionNull()
   {
      try
      {
         MBeanOperationInfo info1 = new MBeanOperationInfo(
               "SomeName",
               null,
               new MBeanParameterInfo[] {
                        new MBeanParameterInfo("FooParam", "java.lang.Object", "description"),
                        new MBeanParameterInfo("BarParam", "java.lang.String", "description")
               },
               "java.util.StringBuffer",
               MBeanOperationInfo.ACTION_INFO
         );
        
         assertTrue(info1.getDescription() == null);
        
      }
      catch (AssertionFailedError e)
      {
         throw e;
View Full Code Here

    */
   public void testGetImpactInvalid()
   {
      try
      {
         MBeanOperationInfo info1 = new MBeanOperationInfo(
               "SomeName",
               "some description",
               new MBeanParameterInfo[] {
                        new MBeanParameterInfo("FooParam", "java.lang.Object", "description"),
                        new MBeanParameterInfo("BarParam", "java.lang.String", "description")
               },
               "java.util.StringBuffer",
               -22342
         );
        
         // according to javadoc, getImpact() is only allowed to return a value that matches
         // either ACTION, ACTION_INFO, INFO or UNKNOWN constant value.
         if (info1.getImpact() != MBeanOperationInfo.ACTION)
            if (info1.getImpact() != MBeanOperationInfo.INFO)
               if (info1.getImpact() != MBeanOperationInfo.ACTION_INFO)
                  if (info1.getImpact() != MBeanOperationInfo.UNKNOWN)
                    
                     // JPL: This fails in RI. The spec doesn't define how invalid impact types should be
                     //      handled. This could be checked at construction time (early) or at getImpact()
                     //      invocation time (late). Since behaviour is not specified, I've opted to check
                     //      late and throw an JMRuntimeException in case there is an invalid impact value.
View Full Code Here

    */
   public void testGetSignatureNull()
   {
      try
      {
         MBeanOperationInfo info1 = new MBeanOperationInfo(
               "SomeName",
               "some description",
               null,
               "java.util.StringBuffer",
               MBeanOperationInfo.ACTION
         );
        
         assertTrue(info1.getSignature().length == 0);
        
      }
      catch (AssertionFailedError e)
      {
         throw e;
View Full Code Here

TOP

Related Classes of javax.management.MBeanOperationInfo

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.