Package javax.management.modelmbean

Examples of javax.management.modelmbean.ModelMBeanOperationInfo


        // Create the associated ModelMBeanInfo
        ModelMBeanInfo info = http.createMBeanInfo();
        assertNotNull("Found HttpConnector ModelMBeanInfo", info);

        // Retrieve the specified ModelMBeanOperationInfo
        ModelMBeanOperationInfo mmoinfo = info.getOperation("initialize");
        assertNotNull("Found HttpConnector initialize info", mmoinfo);

        // Get the Descriptor
        Descriptor desc = mmoinfo.getDescriptor();
        assertNotNull("Found HttpConnector initialize descriptor", desc);

        // Check the configured fields
        checkDescriptor(desc, "field1", "HttpConnector.initialize/field1");
        checkDescriptor(desc, "field2", "HttpConnector.initialize/field2");
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

        addAttributes(attributes, source);
        addExtraAttributes(attributes);
       
        addOperations(operations, source);
        addExtraOperations(operations);
        operations.add(new ModelMBeanOperationInfo(
                "unregisterMBean", "unregisterMBean",
                new MBeanParameterInfo[0], void.class.getName(),
                ModelMBeanOperationInfo.ACTION));

        return new ModelMBeanInfoSupport(
View Full Code Here

                                null, null, paramType, true).getName(),
                        paramName));
            }
   
            Class<?> returnType = convertType(null, null, m.getReturnType(), false);
            operations.add(new ModelMBeanOperationInfo(
                    m.getName(), m.getName(),
                    signature.toArray(new MBeanParameterInfo[signature.size()]),
                    returnType.getName(), ModelMBeanOperationInfo.ACTION));
        }
    }
View Full Code Here

                true, false, false));
    }
   
    @Override
    protected void addExtraOperations(List<ModelMBeanOperationInfo> operations) {
        operations.add(new ModelMBeanOperationInfo(
                "addFilterFirst", "addFilterFirst", new MBeanParameterInfo[] {
                        new MBeanParameterInfo(
                                "name", String.class.getName(), "the new filter name"),
                        new MBeanParameterInfo(
                                "filter", ObjectName.class.getName(), "the ObjectName reference to the filter")
                }, void.class.getName(), ModelMBeanOperationInfo.ACTION));

        operations.add(new ModelMBeanOperationInfo(
                "addFilterLast", "addFilterLast", new MBeanParameterInfo[] {
                        new MBeanParameterInfo(
                                "name", String.class.getName(), "the new filter name"),
                        new MBeanParameterInfo(
                                "filter", ObjectName.class.getName(), "the ObjectName reference to the filter")
                }, void.class.getName(), ModelMBeanOperationInfo.ACTION));

        operations.add(new ModelMBeanOperationInfo(
                "addFilterBefore", "addFilterBefore", new MBeanParameterInfo[] {
                        new MBeanParameterInfo(
                                "baseName", String.class.getName(), "the next filter name"),
                        new MBeanParameterInfo(
                                "name", String.class.getName(), "the new filter name"),
                        new MBeanParameterInfo(
                                "filter", ObjectName.class.getName(), "the ObjectName reference to the filter")
                }, void.class.getName(), ModelMBeanOperationInfo.ACTION));

        operations.add(new ModelMBeanOperationInfo(
                "addFilterAfter", "addFilterAfter", new MBeanParameterInfo[] {
                        new MBeanParameterInfo(
                                "baseName", String.class.getName(), "the previous filter name"),
                        new MBeanParameterInfo(
                                "name", String.class.getName(), "the new filter name"),
                        new MBeanParameterInfo(
                                "filter", ObjectName.class.getName(), "the ObjectName reference to the filter")
                }, void.class.getName(), ModelMBeanOperationInfo.ACTION));
       
        operations.add(new ModelMBeanOperationInfo(
                "removeFilter", "removeFilter", new MBeanParameterInfo[] {
                        new MBeanParameterInfo(
                                "name", String.class.getName(), "the name of the filter to be removed"),
                }, void.class.getName(), ModelMBeanOperationInfo.ACTION));
    }
View Full Code Here

        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

            // add missing attribute descriptors, this is needed to have attributes accessible
            Descriptor desc = mbeanAttribute.getDescriptor();
            if (info.getGetter() != null) {
                desc.setField("getMethod", info.getGetter().getName());
                // attribute must also be added as mbean operation
                ModelMBeanOperationInfo mbeanOperation = new ModelMBeanOperationInfo(info.getKey(), info.getGetter());
                mBeanOperations.add(mbeanOperation);
            }
            if (info.getSetter() != null) {
                desc.setField("setMethod", info.getSetter().getName());
                // attribute must also be added as mbean operation
                ModelMBeanOperationInfo mbeanOperation = new ModelMBeanOperationInfo(info.getKey(), info.getSetter());
                mBeanOperations.add(mbeanOperation);
            }
            mbeanAttribute.setDescriptor(desc);

            mBeanAttributes.add(mbeanAttribute);
View Full Code Here

        }
    }

    private void extractMbeanOperations(Object managedBean, Set<ManagedOperationInfo> operations, Set<ModelMBeanOperationInfo> mBeanOperations) {
        for (ManagedOperationInfo info : operations) {
            ModelMBeanOperationInfo mbean = new ModelMBeanOperationInfo(info.getDescription(), info.getOperation());
            mBeanOperations.add(mbean);
            LOG.trace("Assembled operation: {}", mbean);
        }
    }
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.