org.norther.tammi.core.rt
Class VariableInfo

java.lang.Object
  extended by javax.management.MBeanInfo
      extended by org.norther.tammi.core.rt.VariableInfo
All Implemented Interfaces:
Serializable, Cloneable, DescriptorRead

public class VariableInfo
extends MBeanInfo

A variable MBean extension to MBeanInfo.

Version:
$Id: VariableInfo.java,v 1.30 2010-06-29 18:29:33 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
protected static String ADD_ATTRIBUTE_ELEMENT_DESCRIPTION
          Add attribute element description.
protected static String ADD_ATTRIBUTE_INFO_DESCRIPTION
          Add attribute info description.
protected static String ADD_VALIDATED_ELEMENT_DESCRIPTION
          Add validated element description.
protected static String ATTRIBUTE_INFO_DESCRIPTION
          Attribute info description.
protected static String ATTRIBUTE_LENGTH_DESCRIPTION
          Attribute length description.
protected static String ATTRIBUTE_LIST_DESCRIPTION
          Attribute list description.
protected static String ATTRIBUTE_POSITION_DESCRIPTION
          Attribute position description.
protected static String ATTRIBUTE_VALUES_DESCRIPTION
          Attribute values description.
protected static String CLEAR_ATTRIBUTE_INFO_DESCRIPTION
          Clear attribute info description.
protected static String CLEAR_ATTRIBUTE_VALUES_DESCRIPTION
          Clear attribute values description.
protected static String CONTAINS_ATTRIBUTE_DESCRIPTION
          Contains attribute description.
protected static String CONTAINS_TRAIT_DESCRIPTION
          Contains trait description.
protected static String EXPORT_ATTRIBUTES_DESCRIPTION
          Export attributes description.
protected static String GET_ATTRIBUTE_ELEMENT_DESCRIPTION
          Get attribute element description.
protected static String GET_ATTRIBUTE_VALUE_DESCRIPTION
          Get attribute value description.
protected static String GET_RECURSIVE_ELEMENT_DESCRIPTION
          Get recursive element description.
protected static String GET_RECURSIVE_VALUE_DESCRIPTION
          Get recursive value description.
protected static String GET_VALIDATED_ELEMENT_DESCRIPTION
          Get validated element description.
protected static String GET_VALIDATED_VALUE_DESCRIPTION
          Get validated value description.
protected static String ID_ATTRIBUTE_LIST_DESCRIPTION
          Id attribute list description.
protected static String ID_DESCRIPTION
          Id description.
protected static String IMPORT_ATTRIBUTES_DESCRIPTION
          Import attributes description.
static String MBEAN_CONST_DESCRIPTION
          Constructor description.
static String NAME_PATTERN_FIELD
          The name pattern field.
protected static String REMOVE_ATTRIBUTE_ELEMENT_DESCRIPTION
          Remove attribute element description.
static String REMOVE_VALIDATED_ELEMENT_DESCRIPTION
          Remove validated element description.
protected static String REPLACE_ATTRIBUTE_INFO_DESCRIPTION
          Replace attribute info description.
protected static String RESET_VALIDATED_VALUES_DESCRIPTION
          Reset validated values description.
protected static String SET_ATTRIBUTE_ELEMENT_DESCRIPTION
          Set attribute element description.
protected static String SET_ATTRIBUTE_VALUE_DESCRIPTION
          Set attribute value description.
protected static String SET_ATTRIBUTE_VALUES_DESCRIPTION
          Sets attribute values description.
protected static String SET_VALIDATED_ELEMENT_DESCRIPTION
          Set validated element description.
protected static String SET_VALIDATED_VALUE_DESCRIPTION
          Set validated value description.
protected static String TYPE_DESCRIPTION
          Type description.
protected static String VALIDATE_ATTRIBUTE_VALUES_DESCRIPTION
          Validate attribute values description.
protected static String VALIDATED_VALUES_DESCRIPTION
          Validated values description.
protected static String VARIABLE_INFO_DESCRIPTION
          Variable info description.
static String VARIABLE_PACKAGE
          The default variable package.
 
Constructor Summary
VariableInfo()
          Constructs a default info.
VariableInfo(String className)
          Constructs a class specific info.
VariableInfo(String className, String descr, MBeanAttributeInfo[] attributes, MBeanConstructorInfo[] constructors, MBeanOperationInfo[] operations, MBeanNotificationInfo[] notifications)
          Constructs a new info.
VariableInfo(String className, String descr, MBeanAttributeInfo[] attributes, MBeanConstructorInfo[] constructors, MBeanOperationInfo[] operations, MBeanNotificationInfo[] notifications, Descriptor dtor)
          Constructs a new info with a descriptor.
VariableInfo(String className, String descr, VariableAttributeInfo[] dynamics, MBeanAttributeInfo[] attributes, MBeanConstructorInfo[] constructors, MBeanOperationInfo[] operations, MBeanNotificationInfo[] notifications, Descriptor dtor)
          Constructs a new info with dynamic attributes and descriptor.
 
Method Summary
 boolean addDynamicAttribute(int index, VariableAttributeInfo info)
          Adds the specified dynamic attribute, if not present.
 void clearDynamicAtributes()
          Clears dynamic attributes.
 Object clone()
           
 boolean containsTrait(VariableAttributeInfo.Trait trait)
          Checks whether the specified trait is permanently on in any of the attributes.
 int dynamicAttributeCount()
          Returns the number of dynamic attributes.
 VariableAttributeInfo dynamicAttributeInfo(int index)
          Returns an indexed dynamic attribute info.
 VariableAttributeInfo dynamicAttributeInfo(String name, boolean... modifiable)
          Returns an optionally modifiable named dynamic attribute info.
 List<VariableAttributeInfo> dynamicAttributeList(boolean... modifiable)
          Returns a list of optionally modifiable dynamic attribute infos.
 VariableAttributeInfo elementAttributeInfo()
          Returns the element attribute info.
protected  OrderedMap<String,VariableAttributeInfo> getAttributeMap()
          Gets the map of variable attributes.
 MBeanAttributeInfo[] getAttributes()
           
<E extends Enum<?>>
E
getConstant(Class<E> clazz)
          Gets the specified constant.
 String getDescription()
           
 Descriptor getDescriptor()
          Gets the descriptor of this variable.
 VariableAttributeInfo[] getDynamicAttributes()
          Gets the dynamic attributes of this variable.
 MBeanAttributeInfo[] getFixedAttributes()
          Gets the fixed attributes of this variable.
<L extends EventListener>
L[]
getListeners(Class<L> clazz)
          Gets the specified listeners.
 String getNamePattern()
          Gets the name pattern of this variable.
 int indexOfDynamicAttribute(String name)
          Gets the index of the named dynamic attribute.
 boolean isImmutable()
          Checks whether this variable is immutable.
<E extends Enum<?>>
void
setConstant(Class<E> clazz, E constant)
          Sets the specified constant.
 void setDescription(String descr)
          Sets the description of this variable.
 void setImmutable(boolean flag)
          Sets whether this variable is immutable.
<L extends EventListener>
void
setListener(Class<L> clazz, L[] listeners)
          Sets the specified listeners.
 void setNamePattern(String pattern)
          Sets the name pattern of this variable.
 
Methods inherited from class javax.management.MBeanInfo
equals, getClassName, getConstructors, getNotifications, getOperations, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

VARIABLE_PACKAGE

public static final String VARIABLE_PACKAGE
The default variable package.


NAME_PATTERN_FIELD

public static final String NAME_PATTERN_FIELD
The name pattern field.


MBEAN_CONST_DESCRIPTION

public static final String MBEAN_CONST_DESCRIPTION
Constructor description.

See Also:
Constant Field Values

ID_DESCRIPTION

protected static final String ID_DESCRIPTION
Id description.

See Also:
Constant Field Values

TYPE_DESCRIPTION

protected static final String TYPE_DESCRIPTION
Type description.

See Also:
Constant Field Values

ATTRIBUTE_VALUES_DESCRIPTION

protected static final String ATTRIBUTE_VALUES_DESCRIPTION
Attribute values description.

See Also:
Constant Field Values

SET_ATTRIBUTE_VALUES_DESCRIPTION

protected static final String SET_ATTRIBUTE_VALUES_DESCRIPTION
Sets attribute values description.

See Also:
Constant Field Values

GET_ATTRIBUTE_VALUE_DESCRIPTION

protected static final String GET_ATTRIBUTE_VALUE_DESCRIPTION
Get attribute value description.

See Also:
Constant Field Values

SET_ATTRIBUTE_VALUE_DESCRIPTION

protected static final String SET_ATTRIBUTE_VALUE_DESCRIPTION
Set attribute value description.

See Also:
Constant Field Values

GET_ATTRIBUTE_ELEMENT_DESCRIPTION

protected static final String GET_ATTRIBUTE_ELEMENT_DESCRIPTION
Get attribute element description.

See Also:
Constant Field Values

SET_ATTRIBUTE_ELEMENT_DESCRIPTION

protected static final String SET_ATTRIBUTE_ELEMENT_DESCRIPTION
Set attribute element description.

See Also:
Constant Field Values

ADD_ATTRIBUTE_ELEMENT_DESCRIPTION

protected static final String ADD_ATTRIBUTE_ELEMENT_DESCRIPTION
Add attribute element description.

See Also:
Constant Field Values

REMOVE_ATTRIBUTE_ELEMENT_DESCRIPTION

protected static final String REMOVE_ATTRIBUTE_ELEMENT_DESCRIPTION
Remove attribute element description.

See Also:
Constant Field Values

VALIDATED_VALUES_DESCRIPTION

protected static final String VALIDATED_VALUES_DESCRIPTION
Validated values description.

See Also:
Constant Field Values

RESET_VALIDATED_VALUES_DESCRIPTION

protected static final String RESET_VALIDATED_VALUES_DESCRIPTION
Reset validated values description.

See Also:
Constant Field Values

VALIDATE_ATTRIBUTE_VALUES_DESCRIPTION

protected static final String VALIDATE_ATTRIBUTE_VALUES_DESCRIPTION
Validate attribute values description.

See Also:
Constant Field Values

CLEAR_ATTRIBUTE_VALUES_DESCRIPTION

protected static final String CLEAR_ATTRIBUTE_VALUES_DESCRIPTION
Clear attribute values description.

See Also:
Constant Field Values

GET_VALIDATED_VALUE_DESCRIPTION

protected static final String GET_VALIDATED_VALUE_DESCRIPTION
Get validated value description.

See Also:
Constant Field Values

SET_VALIDATED_VALUE_DESCRIPTION

protected static final String SET_VALIDATED_VALUE_DESCRIPTION
Set validated value description.

See Also:
Constant Field Values

GET_VALIDATED_ELEMENT_DESCRIPTION

protected static final String GET_VALIDATED_ELEMENT_DESCRIPTION
Get validated element description.

See Also:
Constant Field Values

SET_VALIDATED_ELEMENT_DESCRIPTION

protected static final String SET_VALIDATED_ELEMENT_DESCRIPTION
Set validated element description.

See Also:
Constant Field Values

ADD_VALIDATED_ELEMENT_DESCRIPTION

protected static final String ADD_VALIDATED_ELEMENT_DESCRIPTION
Add validated element description.

See Also:
Constant Field Values

REMOVE_VALIDATED_ELEMENT_DESCRIPTION

public static final String REMOVE_VALIDATED_ELEMENT_DESCRIPTION
Remove validated element description.

See Also:
Constant Field Values

GET_RECURSIVE_VALUE_DESCRIPTION

protected static final String GET_RECURSIVE_VALUE_DESCRIPTION
Get recursive value description.

See Also:
Constant Field Values

GET_RECURSIVE_ELEMENT_DESCRIPTION

protected static final String GET_RECURSIVE_ELEMENT_DESCRIPTION
Get recursive element description.

See Also:
Constant Field Values

ATTRIBUTE_LENGTH_DESCRIPTION

protected static final String ATTRIBUTE_LENGTH_DESCRIPTION
Attribute length description.

See Also:
Constant Field Values

VARIABLE_INFO_DESCRIPTION

protected static final String VARIABLE_INFO_DESCRIPTION
Variable info description.

See Also:
Constant Field Values

ATTRIBUTE_INFO_DESCRIPTION

protected static final String ATTRIBUTE_INFO_DESCRIPTION
Attribute info description.

See Also:
Constant Field Values

ADD_ATTRIBUTE_INFO_DESCRIPTION

protected static final String ADD_ATTRIBUTE_INFO_DESCRIPTION
Add attribute info description.

See Also:
Constant Field Values

REPLACE_ATTRIBUTE_INFO_DESCRIPTION

protected static final String REPLACE_ATTRIBUTE_INFO_DESCRIPTION
Replace attribute info description.

See Also:
Constant Field Values

CLEAR_ATTRIBUTE_INFO_DESCRIPTION

protected static final String CLEAR_ATTRIBUTE_INFO_DESCRIPTION
Clear attribute info description.

See Also:
Constant Field Values

ATTRIBUTE_LIST_DESCRIPTION

protected static final String ATTRIBUTE_LIST_DESCRIPTION
Attribute list description.

See Also:
Constant Field Values

CONTAINS_ATTRIBUTE_DESCRIPTION

protected static final String CONTAINS_ATTRIBUTE_DESCRIPTION
Contains attribute description.

See Also:
Constant Field Values

CONTAINS_TRAIT_DESCRIPTION

protected static final String CONTAINS_TRAIT_DESCRIPTION
Contains trait description.

See Also:
Constant Field Values

ID_ATTRIBUTE_LIST_DESCRIPTION

protected static final String ID_ATTRIBUTE_LIST_DESCRIPTION
Id attribute list description.

See Also:
Constant Field Values

ATTRIBUTE_POSITION_DESCRIPTION

protected static final String ATTRIBUTE_POSITION_DESCRIPTION
Attribute position description.

See Also:
Constant Field Values

IMPORT_ATTRIBUTES_DESCRIPTION

protected static final String IMPORT_ATTRIBUTES_DESCRIPTION
Import attributes description.

See Also:
Constant Field Values

EXPORT_ATTRIBUTES_DESCRIPTION

protected static final String EXPORT_ATTRIBUTES_DESCRIPTION
Export attributes description.

See Also:
Constant Field Values
Constructor Detail

VariableInfo

public VariableInfo()
Constructs a default info.


VariableInfo

public VariableInfo(String className)
Constructs a class specific info.

Parameters:
className - the class name.

VariableInfo

public VariableInfo(String className,
                    String descr,
                    MBeanAttributeInfo[] attributes,
                    MBeanConstructorInfo[] constructors,
                    MBeanOperationInfo[] operations,
                    MBeanNotificationInfo[] notifications)
Constructs a new info.

Parameters:
className - the class name.
descr - the description.
attributes - the attributes.
constructors - constructors.
operations - the operations.
notifications - the notifications.

VariableInfo

public VariableInfo(String className,
                    String descr,
                    MBeanAttributeInfo[] attributes,
                    MBeanConstructorInfo[] constructors,
                    MBeanOperationInfo[] operations,
                    MBeanNotificationInfo[] notifications,
                    Descriptor dtor)
Constructs a new info with a descriptor.

Parameters:
className - the class name.
descr - the description.
attributes - the attributes.
constructors - constructors.
operations - the operations.
notifications - the notifications.
dtor - the descriptor.

VariableInfo

public VariableInfo(String className,
                    String descr,
                    VariableAttributeInfo[] dynamics,
                    MBeanAttributeInfo[] attributes,
                    MBeanConstructorInfo[] constructors,
                    MBeanOperationInfo[] operations,
                    MBeanNotificationInfo[] notifications,
                    Descriptor dtor)
Constructs a new info with dynamic attributes and descriptor.

Parameters:
className - the class name.
descr - the description.
dynamics - the dynamic attributes.
attributes - the fixed attributes.
constructors - constructors.
operations - the operations.
notifications - the notifications.
dtor - the descriptor.
Method Detail

clone

public Object clone()
Overrides:
clone in class MBeanInfo

getAttributes

public MBeanAttributeInfo[] getAttributes()
Overrides:
getAttributes in class MBeanInfo

getFixedAttributes

public MBeanAttributeInfo[] getFixedAttributes()
Gets the fixed attributes of this variable.

Returns:
an array of fixed attributes.

getDynamicAttributes

public VariableAttributeInfo[] getDynamicAttributes()
Gets the dynamic attributes of this variable.

Returns:
an array of dynamic attributes.

dynamicAttributeList

public List<VariableAttributeInfo> dynamicAttributeList(boolean... modifiable)
Returns a list of optionally modifiable dynamic attribute infos.

Parameters:
modifiable - true for modifiable, false otherwise.
Returns:
an unmodifiable list of dynamic attribute infos.

dynamicAttributeInfo

public VariableAttributeInfo dynamicAttributeInfo(String name,
                                                  boolean... modifiable)
Returns an optionally modifiable named dynamic attribute info.

Parameters:
name - the attribute name.
modifiable - true for modifiable, false otherwise.
Returns:
a dynamic attribute info or null.

dynamicAttributeInfo

public VariableAttributeInfo dynamicAttributeInfo(int index)
Returns an indexed dynamic attribute info.

Parameters:
index - the attribute index.
Returns:
a dynamic attribute info.

addDynamicAttribute

public boolean addDynamicAttribute(int index,
                                   VariableAttributeInfo info)
Adds the specified dynamic attribute, if not present.

Parameters:
index - the position.
info - the attribute info.
Returns:
true if added, false otherwise.

indexOfDynamicAttribute

public int indexOfDynamicAttribute(String name)
Gets the index of the named dynamic attribute.

Parameters:
name - the attribute name.
Returns:
the attribute index or -1.

dynamicAttributeCount

public int dynamicAttributeCount()
Returns the number of dynamic attributes.

Returns:
the number of attributes.

clearDynamicAtributes

public void clearDynamicAtributes()
Clears dynamic attributes.


elementAttributeInfo

public VariableAttributeInfo elementAttributeInfo()
Returns the element attribute info.

Returns:
an element attribute info.

containsTrait

public boolean containsTrait(VariableAttributeInfo.Trait trait)
Checks whether the specified trait is permanently on in any of the attributes.

Parameters:
trait - the trait to check.
Returns:
true if found, otherwise false.

isImmutable

public boolean isImmutable()
Checks whether this variable is immutable.

Returns:
true if immutable, false otherwise.

setImmutable

public void setImmutable(boolean flag)
Sets whether this variable is immutable. Once set to true, the variable remains immutable until cloned.

Parameters:
flag - true if immutable, false otherwise.

getDescription

public String getDescription()
Overrides:
getDescription in class MBeanInfo

setDescription

public void setDescription(String descr)
Sets the description of this variable.

Parameters:
descr - the variable description.

getNamePattern

public String getNamePattern()
Gets the name pattern of this variable.

Returns:
the name pattern.

setNamePattern

public void setNamePattern(String pattern)
Sets the name pattern of this variable.

Parameters:
pattern - the name pattern.

getListeners

public <L extends EventListener> L[] getListeners(Class<L> clazz)
Gets the specified listeners.

Type Parameters:
L - the listener type.
Parameters:
clazz - the listener class.
Returns:
the listener instances or null.

setListener

public <L extends EventListener> void setListener(Class<L> clazz,
                                                  L[] listeners)
Sets the specified listeners.

Type Parameters:
L - the listener type.
Parameters:
clazz - the listener class.
listeners - the listener instances.

getConstant

public <E extends Enum<?>> E getConstant(Class<E> clazz)
Gets the specified constant.

Type Parameters:
E - the constant type.
Parameters:
clazz - the constant class.
Returns:
the constant instance or null.

setConstant

public <E extends Enum<?>> void setConstant(Class<E> clazz,
                                            E constant)
Sets the specified constant.

Type Parameters:
E - the constant type.
Parameters:
clazz - the constant class.
constant - the constant instance.

getDescriptor

public Descriptor getDescriptor()
Gets the descriptor of this variable. The descriptor is either immutable or modifiable depending on the variable state. Changes to a modifiable descriptor directly affects the variable.

Specified by:
getDescriptor in interface DescriptorRead
Overrides:
getDescriptor in class MBeanInfo
Returns:
the attribute descriptor.

getAttributeMap

protected OrderedMap<String,VariableAttributeInfo> getAttributeMap()
Gets the map of variable attributes.

Returns:
the map of VariableAttributeInfo instances.


Copyright © 2004 The Norther Organization. All rights reserved.