Package javax.management

Examples of javax.management.MBeanOperationInfo


                                                                         ReflectionException {
      if (log.isDebugEnabled()) {
         log.debugf("Invoke method called on %s", name);
      }

      MBeanOperationInfo opInfo = null;
      for (MBeanOperationInfo op : opInfos) {
         if (op.getName().equals(name)) {
            opInfo = op;
            break;
         }
View Full Code Here


            new MBeanAttributeInfo[attrs.length];
        for (int i = 0; i < attrs.length; i++)
            attributes[i] = attrs[i].createAttributeInfo();

        OperationInfo opers[] = getOperations();
        MBeanOperationInfo operations[] =
            new MBeanOperationInfo[opers.length];
        for (int i = 0; i < opers.length; i++)
            operations[i] = opers[i].createOperationInfo();

View Full Code Here

                                                                         ReflectionException {
      if (log.isDebugEnabled()) {
         log.debugf("Invoke method called on %s", name);
      }

      MBeanOperationInfo opInfo = null;
      for (MBeanOperationInfo op : opInfos) {
         if (op.getName().equals(name)) {
            opInfo = op;
            break;
         }
View Full Code Here

            attName = attName.substring(2);
         }
         // expose unless we already exposed matching attribute field
         boolean isAlreadyExposed = atts.containsKey(attName);
         if (!isAlreadyExposed) {
            ops.add(new MBeanOperationInfo(op != null ? op.description() : "", method));
         }
      }
   }
View Full Code Here

      }
      catch(Exception e)
      {
      }
      MBeanOperationInfo[] opInfo = {
         new MBeanOperationInfo("Access the LoginConfiguration", getConfiguration)
      };
      MBeanInfo info = new MBeanInfo(c.getName(), "Default JAAS LoginConfig",
         attrInfo, ctorInfo, opInfo, null);
      return info;
   }
View Full Code Here

        assertTrue(attribute.isReadable());
        assertFalse(attribute.isWritable());
        // Check that both methods are exposed
        MBeanOperationInfo[] operations = mBeanInfo.getOperations();
        assertEquals(2, operations.length);
        MBeanOperationInfo getOperation;
        MBeanOperationInfo setOperation;
        // Order is not important
        if (operations[0].getName().equals("getIntegerValue")) {
            getOperation = operations[0];
            setOperation = operations[1];
        } else {
            setOperation = operations[0];
            getOperation = operations[1];
        }
        // Check the 'get' operation
        assertEquals("getIntegerValue", getOperation.getName());
        assertEquals("Get the value of the integer",
                getOperation.getDescription());
        assertEquals("int", getOperation.getReturnType());
        MBeanParameterInfo[] getOperationParams = getOperation.getSignature();
        assertEquals(0, getOperationParams.length);
        // Check the 'set' operation
        assertEquals("setIntegerValue", setOperation.getName());
        assertEquals("Set the value of the integer",
                setOperation.getDescription());
        assertEquals("int", setOperation.getReturnType());
        MBeanParameterInfo[] setOperationParams = setOperation.getSignature();
        assertEquals(1, setOperationParams.length);
        assertEquals("int", setOperationParams[0].getType());
        // Call the methods and test the result, also test notifications
        CustomNotificationListener listener = new CustomNotificationListener();
        m_server.addNotificationListener(objectName, listener, null, null);
View Full Code Here

        public String getColumnText(Object element, int columnIndex) {
            if (!(element instanceof MBeanOperationInfoWrapper))
                return super.getText(element);

            MBeanOperationInfoWrapper wrapper = (MBeanOperationInfoWrapper) element;
            MBeanOperationInfo opInfo = wrapper.getMBeanOperationInfo();
            switch (columnIndex) {
            case 0:
                return ""; //$NON-NLS-1$
            case 1:
                return opInfo.getReturnType() != null ? StringUtils
                        .toString(opInfo.getReturnType()) : "void"; //$NON-NLS-1$
            case 2:
                return opInfo.getName();
            case 3:
                MBeanParameterInfo[] params = opInfo.getSignature();
                StringBuffer sb = new StringBuffer();
                for (int j = 0; j < params.length; j++) {
                    String type = params[j].getType();
                    if (j != 0)
                        sb.append(", "); //$NON-NLS-1$
View Full Code Here

        @Override
        public int compare(Viewer viewer, Object e1, Object e2) {
            if (e1 instanceof MBeanOperationInfo
                    && e2 instanceof MBeanOperationInfo) {
                MBeanOperationInfo opInfo1 = ((MBeanOperationInfoWrapper) e1)
                        .getMBeanOperationInfo();
                MBeanOperationInfo opInfo2 = ((MBeanOperationInfoWrapper) e2)
                        .getMBeanOperationInfo();
                switch (fIndex) {
                case 1:
                    String a1 = opInfo1.getReturnType();
                    String a2 = opInfo2.getReturnType();
                    int p = a1.lastIndexOf('.');
                    if (p != -1)
                        a1 = a1.substring(p + 1);
                    p = a2.lastIndexOf('.');
                    if (p != -1)
                        a2 = a2.substring(p + 1);
                    return fDirection * a1.compareTo(a2);
                case 2:
                    return fDirection
                            * opInfo1.getName().compareTo(opInfo2.getName());
                case 3:
                    MBeanParameterInfo[] info1 = opInfo1.getSignature();
                    MBeanParameterInfo[] info2 = opInfo2.getSignature();
                    if (info2.length == 0)
                        return fDirection;
                    if (info1.length == 0)
                        return -fDirection;

View Full Code Here

            }
        }
        if (wrapper == null) {
            return;
        }
        MBeanOperationInfo opInfo = wrapper.getMBeanOperationInfo();
        String desc = opInfo.getDescription();
        // FIX issue #27: the MBean operation description can be null
        if (desc != null) {
            section.setDescription(desc);
        }
        // composite for method signature [ return type | method button | ( |
        // Composite(1..n parameters) | ) ]
        Composite c = toolkit.createComposite(container, SWT.NONE);
        c.setLayout(new GridLayout(5, false));
        // return type
        Label returnTypeLabel = toolkit.createLabel(c,
                opInfo.getReturnType() != null ? StringUtils.toString(opInfo
                        .getReturnType()) : "void"); //$NON-NLS-1$
        returnTypeLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER,
                false, false));
        // method name
        InvokeOperationButton invocationButton = new InvokeOperationButton(c,
                SWT.PUSH);
        Label leftParenthesis = toolkit.createLabel(c, "("); //$NON-NLS-1$
        leftParenthesis.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER,
                false, false));

        // parameters
        final MBeanParameterInfo[] params = opInfo.getSignature();
        Text[] textParams = null;
        if (params.length > 0) {
            Composite paramsComposite = toolkit.createComposite(c, SWT.NONE);
            paramsComposite.setLayout(new GridLayout(1, false));
            paramsComposite.setLayoutData(new GridData(SWT.BEGINNING, SWT.BOTTOM,
View Full Code Here

               attName = attName.substring(2);
            }
            //expose unless we already exposed matching attribute field
            boolean isAlreadyExposed = atts.containsKey(attName);
            if (!isAlreadyExposed) {
               ops.add(new MBeanOperationInfo(op != null ? op.description() : "", method));
            }
         }
      }
   }
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.