Java MBean createOpenMBeanAttributeInfo(final OpenType type, final MBeanAttributeInfo in, final String prefix)

Here you can find the source of createOpenMBeanAttributeInfo(final OpenType type, final MBeanAttributeInfo in, final String prefix)

Description

create Open M Bean Attribute Info

License

Open Source License

Parameter

Parameter Description
type Type of new OpenMBeanAttributeInfo.
in The MBeanAttributeInfo we're converting.
prefix Prefix to add to name of new Attribute (If null, nothing is added).

Return

New OpenMBeanAttributeInfo based on in.

Declaration

public static OpenMBeanAttributeInfo createOpenMBeanAttributeInfo(final OpenType type,
        final MBeanAttributeInfo in, final String prefix) 

Method Source Code

//package com.java2s;
/* JmxUtils/* www.j  ava 2  s.  c om*/
 * 
 * Created on May 18, 2005
 *
 * Copyright (C) 2005 Internet Archive.
 * 
 * This file is part of the Heritrix web crawler (crawler.archive.org).
 * 
 * Heritrix is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * any later version.
 * 
 * Heritrix is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser Public License
 * along with Heritrix; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

import javax.management.MBeanAttributeInfo;

import javax.management.openmbean.OpenMBeanAttributeInfo;
import javax.management.openmbean.OpenMBeanAttributeInfoSupport;

import javax.management.openmbean.OpenType;

public class Main {
    /**
     * @param type Type of new OpenMBeanAttributeInfo.
     * @param in The MBeanAttributeInfo we're converting.
     * @param prefix Prefix to add to name of new Attribute (If null, nothing
     * is added).
     * @return New OpenMBeanAttributeInfo based on <code>in</code>.
     */
    public static OpenMBeanAttributeInfo createOpenMBeanAttributeInfo(final OpenType type,
            final MBeanAttributeInfo in, final String prefix) {
        return new OpenMBeanAttributeInfoSupport(((prefix != null) ? prefix + in.getName() : in.getName()),
                in.getDescription(), type, in.isReadable(), in.isWritable(), in.isIs());
    }
}

Related

  1. chooseMBean(Set mbeans)
  2. composeMBeanName(String objTypeName, String objInstanceName)
  3. convertToOpenMBeanAttribute(final MBeanAttributeInfo in, final String prefix)
  4. convertToOpenMBeanOperation(MBeanOperationInfo in)
  5. createMBeanServer()
  6. createProxy(final ObjectName objectName, final Class mbeanInterface, final MBeanServer mbeanServer)
  7. createTimerMBean(ObjectName name, MBeanServer server)
  8. dumpAttributes(MBeanAttributeInfo[] attributes)
  9. dumpConstructors(MBeanConstructorInfo[] constructors)