Java Code Examples for javax.management.openmbean.SimpleType#DOUBLE

The following examples show how to use javax.management.openmbean.SimpleType#DOUBLE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AttributeNodeForSimpleType.java    From datakernel with Apache License 2.0 6 votes vote down vote up
private static SimpleType<?> simpleTypeOf(Class<?> clazz) throws IllegalArgumentException {
	if (clazz == boolean.class || clazz == Boolean.class) {
		return SimpleType.BOOLEAN;
	} else if (clazz == byte.class || clazz == Byte.class) {
		return SimpleType.BYTE;
	} else if (clazz == short.class || clazz == Short.class) {
		return SimpleType.SHORT;
	} else if (clazz == char.class || clazz == Character.class) {
		return SimpleType.CHARACTER;
	} else if (clazz == int.class || clazz == Integer.class) {
		return SimpleType.INTEGER;
	} else if (clazz == long.class || clazz == Long.class) {
		return SimpleType.LONG;
	} else if (clazz == float.class || clazz == Float.class) {
		return SimpleType.FLOAT;
	} else if (clazz == double.class || clazz == Double.class) {
		return SimpleType.DOUBLE;
	} else if (clazz == String.class) {
		return SimpleType.STRING;
	} else {
		throw new IllegalArgumentException("There is no SimpleType for " + clazz.getName());
	}
}
 
Example 2
Source File: JMXUtils.java    From alfresco-core with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static OpenType<?> getOpenType(Object o)
{
    if(o instanceof Long)
    {
        return SimpleType.LONG;
    }
    else if(o instanceof String)
    {
        return SimpleType.STRING;
    }
    else if(o instanceof Date)
    {
        return SimpleType.DATE;
    }
    else if(o instanceof Integer)
    {
        return SimpleType.INTEGER;
    }
    else if(o instanceof Boolean)
    {
        return SimpleType.BOOLEAN;
    }
    else if(o instanceof Double)
    {
        return SimpleType.DOUBLE;
    }
    else if(o instanceof Float)
    {
        return SimpleType.FLOAT;
    }
    else
    {
        throw new IllegalArgumentException();
    }
}
 
Example 3
Source File: StreamServiceTest.java    From cassandra-reaper with Apache License 2.0 5 votes vote down vote up
private CompositeType streamStateType_4_0_0() throws OpenDataException {
  String typeName = "org.apache.cassandra.streaming.StreamState";
  String description = "StreamState";
  String[] itemNames = {
      "currentRxBytes",
      "currentTxBytes",
      "description",
      "planId",
      "rxPercentage",
      "sessions",
      "totalRxBytes",
      "totalTxBytes",
      "txPercentage"
  };
  String[] itemDescriptions = {
      "currentRxBytes",
      "currentTxBytes",
      "description",
      "planId",
      "rxPercentage",
      "sessions",
      "totalRxBytes",
      "totalTxBytes",
      "txPercentage"
  };
  OpenType[] itemTypes = {
      SimpleType.LONG,
      SimpleType.LONG,
      SimpleType.STRING,
      SimpleType.STRING,
      SimpleType.DOUBLE,
      ArrayType.getArrayType(makeSessionsType4_0()),
      SimpleType.LONG,
      SimpleType.LONG,
      SimpleType.DOUBLE
  };

  return new CompositeType(typeName, description, itemNames, itemDescriptions, itemTypes);
}
 
Example 4
Source File: StreamServiceTest.java    From cassandra-reaper with Apache License 2.0 5 votes vote down vote up
private CompositeType streamStateType_2_1_20() throws OpenDataException {
  String typeName = "org.apache.cassandra.streaming.StreamState";
  String description = "StreamState";
  String[] itemNames = {
      "currentRxBytes",
      "currentTxBytes",
      "description",
      "planId",
      "rxPercentage",
      "sessions",
      "totalRxBytes",
      "totalTxBytes",
      "txPercentage"
  };
  String[] itemDescriptions = {
      "currentRxBytes",
      "currentTxBytes",
      "description",
      "planId",
      "rxPercentage",
      "sessions",
      "totalRxBytes",
      "totalTxBytes",
      "txPercentage"
  };

  OpenType[] itemTypes = {
      SimpleType.LONG,
      SimpleType.LONG,
      SimpleType.STRING,
      SimpleType.STRING,
      SimpleType.DOUBLE,
      ArrayType.getArrayType(makeSessionsTypePost2_1()),
      SimpleType.LONG,
      SimpleType.LONG,
      SimpleType.DOUBLE
  };

  return new CompositeType(typeName, description, itemNames, itemDescriptions, itemTypes);
}
 
Example 5
Source File: StreamServiceTest.java    From cassandra-reaper with Apache License 2.0 5 votes vote down vote up
private CompositeType streamStateType_2_0_17() throws OpenDataException {
  String typeName = "org.apache.cassandra.streaming.StreamState";
  String description = "StreamState";
  String[] itemNames = {
      "currentRxBytes",
      "currentTxBytes",
      "description",
      "planId",
      "rxPercentage",
      "sessions",
      "totalRxBytes",
      "totalTxBytes",
      "txPercentage"
  };
  String[] itemDescriptions = {
      "currentRxBytes",
      "currentTxBytes",
      "description",
      "planId",
      "rxPercentage",
      "sessions",
      "totalRxBytes",
      "totalTxBytes",
      "txPercentage"
  };
  OpenType[] itemTypes = {
      SimpleType.LONG,
      SimpleType.LONG,
      SimpleType.STRING,
      SimpleType.STRING,
      SimpleType.DOUBLE,
      ArrayType.getArrayType(makeSessionsTypePre2_1()),
      SimpleType.LONG,
      SimpleType.LONG,
      SimpleType.DOUBLE
  };

  return new CompositeType(typeName, description, itemNames, itemDescriptions, itemTypes);
}
 
Example 6
Source File: TypeConverters.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
OpenType<?> getOpenType() {
    return SimpleType.DOUBLE;
}