code: public static OpResultInfo invokeOp(String name, int index, String[] args) throws JMException
     {
        MBeanServer server = getMBeanServer();
        ObjectName objName = new ObjectName(name);
        MBeanInfo info = server.getMBeanInfo(objName);
        MBeanOperationInfo[] opInfo = info.getOperations();
        MBeanOperationInfo op = opInfo[index];
        MBeanParameterInfo[] paramInfo = op.getSignature();
        String[] argTypes = new String[paramInfo.length];
  
        for (int p = 0; p < paramInfo.length; p++)
           argTypes[p] = paramInfo[p].getType();
   
        return invokeOpByName(name, op.getName(), argTypes, args);
     }
docs: Invoke an operation
  @param name The bean name
  @param index The method index
  @param args The arguments
  @return The result
  @exception JMException Thrown if an error occurs