Package javax.management.openmbean

Examples of javax.management.openmbean.OpenType


          for (MBeanAttributeInfo mb: mbinfos) {
            try{
              Descriptor d = mb.getDescriptor();
              val = mbsc.getAttribute(oname, mb.getName());
              if(d.getFieldNames().length > 0){ //this is an open mbean
                OpenType openType = (OpenType)d.getFieldValue("openType")
               
                if(openType.isArray()){                 
                  Object[] valarray = (Object[])val;                 
                  val = Integer.toString(valarray.length);
                }
                else if(openType instanceof CompositeType){
                  CompositeData data = (CompositeData)val;
View Full Code Here


            CompositeType compositeType = data.getCompositeType();
            Set keys = compositeType.keySet();
            for (Iterator iter = keys.iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                Object value = data.get(key);
                OpenType type = compositeType.getType(key);
                if (type instanceof SimpleType) {
                    setProperty(propertyPrefix + "." + key, value);
                } else {
                    createProperty(propertyPrefix + "." + key, value);
                }
            }
        } else if (result instanceof TabularDataSupport) {
            TabularDataSupport data = (TabularDataSupport) result;
            for (Iterator iter = data.keySet().iterator(); iter.hasNext();) {
                Object key = iter.next();
                for (Iterator iter1 = ((List) key).iterator(); iter1.hasNext();) {
                    Object key1 = iter1.next();
                    CompositeData valuedata = data.get(new Object[] { key1 });
                    Object value = valuedata.get("value");
                    OpenType type = valuedata.getCompositeType().getType(
                            "value");
                    if (type instanceof SimpleType) {
                        setProperty(propertyPrefix + "." + key1, value);
                    } else {
                        createProperty(propertyPrefix + "." + key1, value);
View Full Code Here

            CompositeType compositeType = data.getCompositeType();
            Set keys = compositeType.keySet();
            for (Iterator iter = keys.iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                Object value = data.get(key);
                OpenType type = compositeType.getType(key);
                if (type instanceof SimpleType) {
                    setProperty(propertyPrefix + "." + key, value);
                } else {
                    createProperty(propertyPrefix + "." + key, value);
                }
            }
        } else if (result instanceof TabularDataSupport) {
            TabularDataSupport data = (TabularDataSupport) result;
            for (Iterator iter = data.keySet().iterator(); iter.hasNext();) {
                Object key = iter.next();
                for (Iterator iter1 = ((List) key).iterator(); iter1.hasNext();) {
                    Object key1 = iter1.next();
                    CompositeData valuedata = data.get(new Object[] { key1 });
                    Object value = valuedata.get("value");
                    OpenType type = valuedata.getCompositeType().getType(
                            "value");
                    if (type instanceof SimpleType) {
                        setProperty(propertyPrefix + "." + key1, value);
                    } else {
                        createProperty(propertyPrefix + "." + key1, value);
View Full Code Here

    * @return the info
    * @throws Exception for any error
    */
   private OpenMBeanParameterInfo buildParameter(int i, Type parameterType) throws Exception
   {
      OpenType openType = MXBeanUtils.getOpenType(parameterType);
      return new OpenMBeanParameterInfoSupport("arg" + i, "MBean Parameter.", openType);
   }
View Full Code Here

   {
      boolean isReadable = (getter != null);
      boolean isWritable = (setter != null);
      boolean isIs = false;
     
      OpenType openType = null;
      if (getter != null)
      {
         openType = MXBeanUtils.getOpenType(getter.getGenericReturnType());
         if (getter.getName().startsWith("is"))
            isIs = true;
View Full Code Here

   {
      Type[] parameterTypes = method.getGenericParameterTypes();
      OpenMBeanParameterInfo[] parameterInfo = new OpenMBeanParameterInfo[parameterTypes.length];
      for (int i = 0; i < parameterTypes.length; ++i)
         parameterInfo[i] = buildParameter(i, parameterTypes[i]);
      OpenType openType = MXBeanUtils.getOpenType(method.getGenericReturnType());
      return new OpenMBeanOperationInfoSupport(method.getName(), method.getName(), parameterInfo, openType, MBeanOperationInfo.ACTION);
   }
View Full Code Here

   public static OpenType getOpenType(Type type)
   {
      if (type == null)
         throw new IllegalArgumentException("Null type");

      OpenType result = checkType(type);
      if (result != null)
         return result;
      Class clazz = (Class) type;
      return CompositeTypeMetaDataFactory.getCompositeType(clazz);
   }
View Full Code Here

    * @param type the type
    * @return the open type or null if composite
    */
   public static OpenType checkType(Type type)
   {
      OpenType result = checkSimpleType(type);
      if (result != null)
         return result;
      result = checkEnum(type);
      if (result != null)
         return result;
View Full Code Here

    * @return the open data
    * @throws Exception for any error
    */
   public static Object construct(Type type, Object value, Object context) throws Exception
   {
      OpenType openType = getOpenType(type);
      return construct(openType, value, context);
   }
View Full Code Here

    * @return the object
    * @throws Exception for any error
    */
   public static Object reconstruct(Type type, Object value, Object context) throws Exception
   {
      OpenType openType = MXBeanUtils.getOpenType(type);
      return reconstruct(openType, type, value, context);
   }
View Full Code Here

TOP

Related Classes of javax.management.openmbean.OpenType

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.