org.norther.tammi.core.rt
Class VariableZ

java.lang.Object
  extended by org.norther.tammi.core.rt.VariableX
      extended by org.norther.tammi.core.rt.VariableY
          extended by org.norther.tammi.core.rt.VariableZ
All Implemented Interfaces:
Serializable, Cloneable, DynamicMBean, MBeanRegistration, NotificationBroadcaster, NotificationEmitter, Traceable, Identifiable, NamePattern, ReferableMBean, Variable

public class VariableZ
extends VariableY

A fully dynamic Variable implementation supporting run-time modifications to its attribute set. The memory footprint is larger as each instance maintains its own copy of meta-data of its attribute set.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.core.rt.VariableX
MBEAN_CONST_DESCRIPTION, VARIABLE_ATTRIBUTES, VARIABLE_CONSTRUCTORS, VARIABLE_NOTIFICATIONS, VARIABLE_OPERATIONS
 
Fields inherited from interface org.norther.tammi.core.rt.Variable
ADD_VALIDATED_ELEMENT, ADD_VALIDATED_ELEMENT_DESCRIPTION, APPLY_ATTRIBUTE_EXPORTER, APPLY_ATTRIBUTE_EXPORTER_DESCRIPTION, APPLY_ATTRIBUTE_IMPORTER, APPLY_ATTRIBUTE_IMPORTER_DESCRIPTION, APPLY_ATTRIBUTE_VALIDATOR, APPLY_ATTRIBUTE_VALIDATOR_DESCRIPTION, ATTRIBUTE_INFO, ATTRIBUTE_INFO_DESCRIPTION, ATTRIBUTE_LENGTH, ATTRIBUTE_LENGTH_DESCRIPTION, ATTRIBUTE_LIST, ATTRIBUTE_LIST_DESCRIPTION, CLEAR_ATTRIBUTE_VALUES, CLEAR_ATTRIBUTE_VALUES_DESCRIPTION, CONTAINS_ATTRIBUTE, CONTAINS_ATTRIBUTE_DESCRIPTION, EXPORT_ATTRIBUTES, EXPORT_ATTRIBUTES_DESCRIPTION, GET_ATTRIBUTE_VALUE, GET_ATTRIBUTE_VALUE_DESCRIPTION, GET_VALIDATED_ELEMENT, GET_VALIDATED_ELEMENT_DESCRIPTION, GET_VALIDATED_VALUE, GET_VALIDATED_VALUE_DESCRIPTION, IMPORT_ATTRIBUTES, IMPORT_ATTRIBUTES_DESCRIPTION, REMOVE_VALIDATED_ELEMENT, REMOVE_VALIDATED_ELEMENT_DESCRIPTION, RESET_VALIDATED_VALUES, RESET_VALIDATED_VALUES_DESCRIPTION, SET_ATTRIBUTE_VALUE, SET_ATTRIBUTE_VALUE_DESCRIPTION, SET_VALIDATED_ELEMENT, SET_VALIDATED_ELEMENT_DESCRIPTION, SET_VALIDATED_VALUE, SET_VALIDATED_VALUE_DESCRIPTION, VALIDATE_ATTRIBUTE_VALUES, VALIDATE_ATTRIBUTE_VALUES_DESCRIPTION, VALIDATED_VALUES, VALIDATED_VALUES_DESCRIPTION, VARIABLE_ID, VARIABLE_ID_DESCRIPTION, VARIABLE_TYPE, VARIABLE_TYPE_DESCRIPTION
 
Fields inherited from interface org.norther.tammi.core.base.ReferableMBean
DEFAULT_ID, ID, MBEAN, MBEAN_DESCRIPTION, TYPE
 
Constructor Summary
  VariableZ()
          Constructs a new variable.
  VariableZ(MBeanAttributeInfo[] attrs)
          Constructs a new dynamic MBean with attributes.
protected VariableZ(MBeanAttributeInfo[] attrs, MBeanOperationInfo[] opers)
          Constructs a new dynamic MBean with attributes and operations.
protected VariableZ(MBeanAttributeInfo[] attrs, MBeanOperationInfo[] opers, MBeanNotificationInfo[] notifs)
          Constructs a new dynamic MBean with attributes, operations and notifications.
  VariableZ(String type)
          Constructs a new variable with a type.
 
Method Summary
 Collection attributeCollection()
          Returns a snapshot collection of attributes.
protected  void attributeInfoRegistered(VariableAttributeInfo info)
          Callback for a registered attribute info.
 void clearAttributeInfo()
          Clears all attributes of this variable.
 Object clone()
          Clones this variable.
protected  Object getAttributeValue(VariableAttributeInfo info, boolean validate)
          Gets the attribute value.
protected  Object getInternalAttributeValue(VariableAttributeInfo info, boolean reset)
          Gets the internal attribute value.
 MBeanInfo getMBeanInfo()
           
 MBeanNotificationInfo[] getNotificationInfo()
           
 void postRegister(Boolean done)
           
 void preDeregister()
           
protected  Object putInternalAttributeValue(VariableAttributeInfo info, Object value, long timestamp, boolean reset)
          Puts the internal attribute value with a modification timestamp.
protected  void registerAttributeInfo(OrderedMap map)
          Sets the attribute info map.
 
Methods inherited from class org.norther.tammi.core.rt.VariableY
addNotificationListener, getCanonicalName, getMBean, getMBeanDelegate, getNamePattern, getQueryPattern, postDeregister, preRegister, registerVariable, removeNotificationListener, removeNotificationListener, sendNotification, setCanonicalName, setNamePattern, setQueryPattern
 
Methods inherited from class org.norther.tammi.core.rt.VariableX
addAttributeInfo, addAttributeInfoIfAbsent, addTraceListener, addValidatedElement, addValidatedElement, applyAttributeExporter, applyAttributeImporter, applyAttributeValidator, attributeInfo, attributeInfo, attributeInfo, attributeLength, attributeList, attributeList, attributeList, attributeList, attributesToStrings, clearAttributeValues, clearTraceListeners, containsAttribute, exportAttributes, exportAttributes, exportAttributes, exportAttributes, getAttribute, getAttributes, getAttributeValue, getLastInitialized, getLastModified, getLastModified, getMBeanServer, getObjectName, getValidatedElement, getValidatedValue, getValidatedValues, getVariableId, getVariableType, importAttributes, importAttributes, importAttributes, importAttributes, invoke, isEmpty, isModifiable, putAttributeValue, putInternalAttributeValue, removeTraceListener, removeValidatedElement, removeValidatedElement, replaceAttributeInfo, resetValidatedValues, setAttribute, setAttributeElement, setAttributes, setAttributeValue, setInternalAttributeElement, setLastModified, setObjectName, setValidatedElement, setValidatedValue, setValidatedValues, setVariableId, validateAttributes, validateAttributeValue, validateAttributeValues, validateAttributeValues
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableZ

public VariableZ()
Constructs a new variable.


VariableZ

public VariableZ(String type)
Constructs a new variable with a type.

Parameters:
type - the variable type.

VariableZ

public VariableZ(MBeanAttributeInfo[] attrs)
Constructs a new dynamic MBean with attributes.

Parameters:
attrs - the attributes of the MBean.

VariableZ

protected VariableZ(MBeanAttributeInfo[] attrs,
                    MBeanOperationInfo[] opers)
Constructs a new dynamic MBean with attributes and operations.

Operations must be implemented by subclasses.

Parameters:
attrs - the attributes of the MBean.
opers - the operations of the MBean.

VariableZ

protected VariableZ(MBeanAttributeInfo[] attrs,
                    MBeanOperationInfo[] opers,
                    MBeanNotificationInfo[] notifs)
Constructs a new dynamic MBean with attributes, operations and notifications.

Operations must be implemented by subclasses.

Parameters:
attrs - the attributes of the MBean.
opers - the operations of the MBean.
notifs - the notifications of the MBean.
Method Detail

postRegister

public void postRegister(Boolean done)
Specified by:
postRegister in interface MBeanRegistration
Overrides:
postRegister in class VariableY

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface MBeanRegistration
Overrides:
preDeregister in class VariableY
Throws:
Exception

clone

public Object clone()
Description copied from interface: Variable
Clones this variable. The new variable contains the same attributes as the original one. The attribute values themselves are not cloned.

Specified by:
clone in interface Variable
Overrides:
clone in class VariableX
Returns:
a clone of this variable.

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster
Overrides:
getNotificationInfo in class VariableY

getMBeanInfo

public MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface DynamicMBean
Overrides:
getMBeanInfo in class VariableY

clearAttributeInfo

public void clearAttributeInfo()
Clears all attributes of this variable.

Overrides:
clearAttributeInfo in class VariableX

attributeCollection

public Collection attributeCollection()
Returns a snapshot collection of attributes. The collection will update added attributes to the variable.

Returns:
a collection of attributes.
Throws:
IllegalStateException - if registered.

getAttributeValue

protected Object getAttributeValue(VariableAttributeInfo info,
                                   boolean validate)
Description copied from class: VariableX
Gets the attribute value. Array values are copied to prevent modifications from outside.

Overrides:
getAttributeValue in class VariableX
Parameters:
info - the attribute to get.
validate - true for validation, false otherwise.
Returns:
the attribute value.

getInternalAttributeValue

protected Object getInternalAttributeValue(VariableAttributeInfo info,
                                           boolean reset)
Description copied from class: VariableX
Gets the internal attribute value.

Overrides:
getInternalAttributeValue in class VariableX
Parameters:
info - the attribute to set.
reset - true to reset access rights, false otherwise.
Returns:
the attribute value.

putInternalAttributeValue

protected Object putInternalAttributeValue(VariableAttributeInfo info,
                                           Object value,
                                           long timestamp,
                                           boolean reset)
Description copied from class: VariableX
Puts the internal attribute value with a modification timestamp.

Overrides:
putInternalAttributeValue in class VariableX
Parameters:
info - the attribute to put.
value - the attribute value.
timestamp - the timestamp.
reset - true to reset access rights, false otherwise.
Returns:
the previous value.

registerAttributeInfo

protected void registerAttributeInfo(OrderedMap map)
Description copied from class: VariableX
Sets the attribute info map.

Overrides:
registerAttributeInfo in class VariableX
Parameters:
map - a map of VariableAttributeInfo instances.

attributeInfoRegistered

protected void attributeInfoRegistered(VariableAttributeInfo info)
Description copied from class: VariableX
Callback for a registered attribute info.

Overrides:
attributeInfoRegistered in class VariableX
Parameters:
info - the registered attribute.


Copyright © 2004 The Norther Organization. All rights reserved.