org.osgi.jmx.codec
Class OSGiProperties
java.lang.Object
org.osgi.jmx.codec.OSGiProperties
public class OSGiProperties
- extends java.lang.Object
- Author:
- Hal Hildebrand Date: Nov 26, 2008 Time: 10:13:10 AM
This class serves as both the documentation of the type structure and
as the codification of the mechanism to convert to/from the
TabularData.
This class represents the CODEC for property dictionaries. As JMX is
a rather primitive system and is not intended to be a generic RMI
type system, the set of types that can be transfered between the
management agent and the managed OSGi container is limited to simple
types, arrays of simple types and vectors of simple types. This
enforcement is strict and no attempt is made to create a yet another
generic serialization mechanism for transferring property values
outside of these types.
The syntax for the type indicator
type ::= scalar | vector | array
scalar ::= String | Integer | Long | Float |
Double | Byte | Short | Character |
Boolean | BigDecimal | BigInteger
primitive ::= int | long | float | double | byte | short |
char | boolean
array ::= <Array of primitive> | <Array of scalar>
vector ::= Vector of scalar
The values for Arrays and Vectors are separated by ",".
The structure of the composite data for a row in the table is:
Key |
String |
Value |
String |
Type |
String |
The
Field Summary |
static java.lang.String |
KEY
|
protected static java.util.Set<java.lang.String> |
PRIMITIVE_TYPES
|
static java.lang.String[] |
PROPERTIES
|
static javax.management.openmbean.CompositeType |
PROPERTY
|
static javax.management.openmbean.TabularType |
PROPERTY_TABLE
|
protected static java.util.Set<java.lang.String> |
SCALAR_TYPES
|
static java.lang.String |
TYPE
|
static java.lang.String |
VALUE
|
Method Summary |
protected static java.lang.Object[] |
createScalarArray(java.lang.String type,
int size)
|
static javax.management.openmbean.CompositeData |
encode(java.lang.String key,
java.lang.Object value)
|
protected static javax.management.openmbean.CompositeData |
encodeArray(java.lang.String key,
java.lang.Object value,
java.lang.Class<?> componentClazz)
|
protected static javax.management.openmbean.CompositeData |
encodeVector(java.lang.String key,
java.util.Vector value)
|
static java.lang.Object |
parse(java.lang.String value,
java.lang.String type)
|
protected static java.lang.Object |
parseArray(java.lang.String value,
java.util.StringTokenizer tokens)
|
protected static java.lang.Object |
parsePrimitiveArray(java.lang.String value,
java.lang.String type)
|
protected static java.lang.Object |
parseScalar(java.lang.String value,
java.lang.String type)
|
protected static java.lang.Object |
parseScalarArray(java.lang.String value,
java.lang.String type)
|
protected static java.lang.Object |
parseVector(java.lang.String value,
java.util.StringTokenizer tokens)
|
static java.util.Hashtable<java.lang.String,java.lang.Object> |
propertiesFrom(javax.management.openmbean.TabularData table)
|
protected static javax.management.openmbean.CompositeData |
propertyData(java.lang.String key,
java.lang.String value,
java.lang.String type)
|
static javax.management.openmbean.TabularData |
tableFrom(java.util.Dictionary properties)
|
static javax.management.openmbean.TabularData |
tableFrom(org.osgi.framework.ServiceReference ref)
|
protected static java.lang.String |
typeOf(java.lang.Class<?> clazz)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY
public static final java.lang.String KEY
- See Also:
- Constant Field Values
VALUE
public static final java.lang.String VALUE
- See Also:
- Constant Field Values
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
PROPERTIES
public static final java.lang.String[] PROPERTIES
PROPERTY
public static final javax.management.openmbean.CompositeType PROPERTY
PROPERTY_TABLE
public static final javax.management.openmbean.TabularType PROPERTY_TABLE
SCALAR_TYPES
protected static final java.util.Set<java.lang.String> SCALAR_TYPES
PRIMITIVE_TYPES
protected static final java.util.Set<java.lang.String> PRIMITIVE_TYPES
OSGiProperties
public OSGiProperties()
tableFrom
public static javax.management.openmbean.TabularData tableFrom(java.util.Dictionary properties)
tableFrom
public static javax.management.openmbean.TabularData tableFrom(org.osgi.framework.ServiceReference ref)
encode
public static javax.management.openmbean.CompositeData encode(java.lang.String key,
java.lang.Object value)
propertiesFrom
public static java.util.Hashtable<java.lang.String,java.lang.Object> propertiesFrom(javax.management.openmbean.TabularData table)
encodeArray
protected static javax.management.openmbean.CompositeData encodeArray(java.lang.String key,
java.lang.Object value,
java.lang.Class<?> componentClazz)
encodeVector
protected static javax.management.openmbean.CompositeData encodeVector(java.lang.String key,
java.util.Vector value)
typeOf
protected static java.lang.String typeOf(java.lang.Class<?> clazz)
propertyData
protected static javax.management.openmbean.CompositeData propertyData(java.lang.String key,
java.lang.String value,
java.lang.String type)
parse
public static java.lang.Object parse(java.lang.String value,
java.lang.String type)
parseArray
protected static java.lang.Object parseArray(java.lang.String value,
java.util.StringTokenizer tokens)
parseScalarArray
protected static java.lang.Object parseScalarArray(java.lang.String value,
java.lang.String type)
createScalarArray
protected static java.lang.Object[] createScalarArray(java.lang.String type,
int size)
parsePrimitiveArray
protected static java.lang.Object parsePrimitiveArray(java.lang.String value,
java.lang.String type)
parseVector
protected static java.lang.Object parseVector(java.lang.String value,
java.util.StringTokenizer tokens)
parseScalar
protected static java.lang.Object parseScalar(java.lang.String value,
java.lang.String type)
Copyright © 2009. All Rights Reserved.