Package javax.management.modelmbean

Examples of javax.management.modelmbean.ModelMBeanOperationInfo


        return super.invoke0(name, params, signature);
    }

    @Override
    protected void addExtraOperations(List<ModelMBeanOperationInfo> operations) {
        operations.add(new ModelMBeanOperationInfo(
                "findSessions", "findSessions",
                new MBeanParameterInfo[] {
                        new MBeanParameterInfo(
                                "ognlQuery", String.class.getName(), "a boolean OGNL expression")
                }, Set.class.getName(), MBeanOperationInfo.INFO));
        operations.add(new ModelMBeanOperationInfo(
                "findAndRegisterSessions", "findAndRegisterSessions",
                new MBeanParameterInfo[] {
                        new MBeanParameterInfo(
                                "ognlQuery", String.class.getName(), "a boolean OGNL expression")
                }, Set.class.getName(), MBeanOperationInfo.ACTION_INFO));
        operations.add(new ModelMBeanOperationInfo(
                "findAndProcessSessions", "findAndProcessSessions",
                new MBeanParameterInfo[] {
                        new MBeanParameterInfo(
                                "ognlQuery", String.class.getName(), "a boolean OGNL expression"),
                        new MBeanParameterInfo(
View Full Code Here


     * @exception ReflectioNException if a Java reflection exception
     *  occurs when invoking a method
     */
    public Object invoke(String name, Object params[], String signature[])
        throws MBeanException, ReflectionException {
            ModelMBeanOperationInfo opInfo = (ModelMBeanOperationInfo)MBeanHelper.findMatchingOperationInfo((MBeanInfo)info, name, signature);
            if (opInfo == null)
            {
                String msg = _localStrings.getString( "admin.server.core.mbean.config.base.operation_is_not_found", mbeanType, name);
                throw new MBeanException
                    (new ServiceNotFoundException(msg), msg);
            }
            Descriptor descr = opInfo.getDescriptor();
           
            Object ret;
            //try MBean self
            try
            {
View Full Code Here

   public void testValidDescriptorFields() throws Exception
   {
      // Test that only name and descriptorType are mandatory
      Descriptor descriptor = new DescriptorSupport(new String[]{"name", "descriptortype", "role", "visibility"},
                                                    new String[]{"operation1", "operation", "operation", "1"});
      ModelMBeanOperationInfo operation
              = new ModelMBeanOperationInfo("operation1", "An operation", null, "java.lang.String", ModelMBeanOperationInfo.ACTION, descriptor);
      // in case the descriptor is not valid this should be overriden
      assertEquals(operation.getDescriptor().getFieldValue("visibility"), "1");
   }
View Full Code Here

                                                                  new Class[0]);
      String[] fields = {"name", "descriptorType", "role"};
      String[] values =
              {op.getName(), "operation", "operation"};
      DescriptorSupport ds = new DescriptorSupport(fields, values);
      ModelMBeanOperationInfo info =
              new ModelMBeanOperationInfo("Good Appendectomy", op, ds);
      Descriptor d = info.getDescriptor();
      String dispname = (String)d.getFieldValue("displayName");
      assertTrue("Unexpected displayName",
                 dispname.compareTo(op.getName()) == 0);
   }
View Full Code Here

                                                                  new Class[0]);
      String[] fields = {"name", "descriptorType", "role", "displayName"};
      String[] values =
              {op.getName(), "operation", "operation", "appendectomy"};
      DescriptorSupport ds = new DescriptorSupport(fields, values);
      ModelMBeanOperationInfo info =
              new ModelMBeanOperationInfo("Good Appendectomy", op, ds);

      try
      {
         values =
         new String[]{
            op.getName(),
            "operation",
            "constructor",
            "appendectomy"};
         ds = new DescriptorSupport(fields, values);
         info = new ModelMBeanOperationInfo("Bad Appendectomy", op, ds);
         fail("Expecting RuntimeOperationsException");
      }
      catch (RuntimeOperationsException x)
      {
         assertTrue(true); // success
View Full Code Here

         "name=getWineList",
         "descriptorType=oPERATION",
         "displayName=Retrieve the list of available wines",
         "role=getter"
      });
      ModelMBeanOperationInfo attrinfo =
              new ModelMBeanOperationInfo("getWineList",
                                          "Retrieve the list of available wines",
                                          new MBeanParameterInfo[0],
                                          "String",
                                          MBeanOperationInfo.INFO,
                                          ds);
View Full Code Here

   public void compareModelMBeanOperationInfo(Object o1, Object o2)
   {
      compareMBeanOperationInfo(o1, o2);

      ModelMBeanOperationInfo op1 = (ModelMBeanOperationInfo)o1;
      ModelMBeanOperationInfo op2 = (ModelMBeanOperationInfo)o2;
      compareDescriptorSupport(op1.getDescriptor(), op2.getDescriptor());
   }
View Full Code Here

                    (new IllegalArgumentException("Inconsistent arguments and signature"),
                     "Inconsistent arguments and signature");

            // Acquire the ModelMBeanOperationInfo information for
            // the requested operation
            ModelMBeanOperationInfo opInfo = info.getOperation(name);
            if (opInfo == null)
                throw new MBeanException
                    (new ServiceNotFoundException("Cannot find operation " + name),
                     "Cannot find operation " + name);
View Full Code Here

        ModelMBeanNotificationInfo notifications[] =
            new ModelMBeanNotificationInfo[notifs.length];
        for (int i = 0; i < notifs.length; i++)
            notifications[i] = notifs[i].createNotificationInfo();
        OperationInfo opers[] = getOperations();
        ModelMBeanOperationInfo operations[] =
            new ModelMBeanOperationInfo[opers.length];
        for (int i = 0; i < opers.length; i++)
            operations[i] = opers[i].createOperationInfo();

        /*
 
View Full Code Here

        else if ("ACTION_INFO".equals(getImpact()))
            impact = ModelMBeanOperationInfo.ACTION_INFO;
        else if ("INFO".equals(getImpact()))
            impact = ModelMBeanOperationInfo.INFO;

        info = new ModelMBeanOperationInfo
            (getName(), getDescription(), parameters,
             getReturnType(), impact);
        Descriptor descriptor = info.getDescriptor();
        descriptor.removeField("class");
        descriptor.setField("role", getRole());
View Full Code Here

TOP

Related Classes of javax.management.modelmbean.ModelMBeanOperationInfo

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.