org.norther.tammi.core.rt
Class VariableY

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

public class VariableY
extends VariableX
implements NamePattern, NotificationEmitter

An extended Variable implementation supporting a fixed set of dynamic attributes only. VariableY implements NotificationEmitter, which allows its use with handles. The meta-data is locked and shared with other instances of the same virtual type by default making the memory footprint smaller.

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
VariableY()
          Constructs a new variable.
VariableY(String type)
          Constructs a new variable with a type.
 
Method Summary
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 String getCanonicalName()
          Gets the canonical object name of the MBean as a string.
 MBeanReference getMBean()
          Gets a reference to the MBean.
protected  MBeanDelegate getMBeanDelegate()
          Gets the delegate to provide access to its methods for subclasses.
 MBeanInfo getMBeanInfo()
           
 String getNamePattern()
          Gets the name pattern as a string.
 MBeanNotificationInfo[] getNotificationInfo()
           
 ObjectName getQueryPattern()
          Gets the name pattern as an object name query.
 void postDeregister()
           
 void postRegister(Boolean done)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer server, ObjectName name)
           
protected  void registerVariable(String type)
          Registers the type of the variable in the variable registry.
 void removeNotificationListener(NotificationListener listener)
           
 void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 void sendNotification(String message, String name, String type, Object oldValue, Object newValue)
          Sends a modification notification.
 void setCanonicalName(String name)
          Sets the canonical object name of the MBean as a string.
 void setNamePattern(String pattern)
          Sets the name pattern as a string.
 void setQueryPattern(ObjectName pattern)
          Sets the name pattern as an object name query.
 
Methods inherited from class org.norther.tammi.core.rt.VariableX
addAttributeInfo, addAttributeInfoIfAbsent, addTraceListener, addValidatedElement, addValidatedElement, applyAttributeExporter, applyAttributeImporter, applyAttributeValidator, attributeInfo, attributeInfo, attributeInfo, attributeInfoRegistered, attributeLength, attributeList, attributeList, attributeList, attributeList, attributesToStrings, clearAttributeInfo, clearAttributeValues, clearTraceListeners, clone, containsAttribute, exportAttributes, exportAttributes, exportAttributes, exportAttributes, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getInternalAttributeValue, getLastInitialized, getLastModified, getLastModified, getMBeanServer, getObjectName, getValidatedElement, getValidatedValue, getValidatedValues, getVariableId, getVariableType, importAttributes, importAttributes, importAttributes, importAttributes, invoke, isEmpty, isModifiable, putAttributeValue, putInternalAttributeValue, putInternalAttributeValue, registerAttributeInfo, 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

VariableY

public VariableY()
Constructs a new variable.


VariableY

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

Parameters:
type - the variable type.
Method Detail

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws Exception
Specified by:
preRegister in interface MBeanRegistration
Overrides:
preRegister in class VariableX
Throws:
Exception

postRegister

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

preDeregister

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

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface MBeanRegistration
Overrides:
postDeregister in class VariableX

getMBean

public MBeanReference getMBean()
Description copied from interface: ReferableMBean
Gets a reference to the MBean.

Specified by:
getMBean in interface ReferableMBean
Overrides:
getMBean in class VariableX
Returns:
a reference to the MBean.

getCanonicalName

public String getCanonicalName()
Description copied from interface: Identifiable
Gets the canonical object name of the MBean as a string.

Specified by:
getCanonicalName in interface Identifiable
Overrides:
getCanonicalName in class VariableX
Returns:
the canonical object name as a string or null.

setCanonicalName

public void setCanonicalName(String name)
                      throws MalformedObjectNameException
Description copied from interface: Identifiable
Sets the canonical object name of the MBean as a string. The canonical object name can be used by persistence mechanisms to store the identity of the MBean.

Specified by:
setCanonicalName in interface Identifiable
Overrides:
setCanonicalName in class VariableX
Parameters:
name - the canonical object name as a string.
Throws:
MalformedObjectNameException - for an invalid name.

getNamePattern

public String getNamePattern()
Description copied from interface: NamePattern
Gets the name pattern as a string.

Specified by:
getNamePattern in interface NamePattern
Returns:
the name pattern or null.

setNamePattern

public void setNamePattern(String pattern)
                    throws MalformedObjectNameException
Description copied from interface: NamePattern
Sets the name pattern as a string.

Specified by:
setNamePattern in interface NamePattern
Parameters:
pattern - the name pattern.
Throws:
MalformedObjectNameException - for an invalid name.

getQueryPattern

public ObjectName getQueryPattern()
Description copied from interface: NamePattern
Gets the name pattern as an object name query.

Specified by:
getQueryPattern in interface NamePattern
Returns:
the query pattern or null.

setQueryPattern

public void setQueryPattern(ObjectName pattern)
Description copied from interface: NamePattern
Sets the name pattern as an object name query. The name pattern is applied when generating a unique name during registration of an unnamed MBean.

Specified by:
setQueryPattern in interface NamePattern
Parameters:
pattern - the query pattern.

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
Specified by:
addNotificationListener in interface NotificationBroadcaster

removeNotificationListener

public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationEmitter
Throws:
ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationBroadcaster
Throws:
ListenerNotFoundException

getNotificationInfo

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

getMBeanInfo

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

sendNotification

public void sendNotification(String message,
                             String name,
                             String type,
                             Object oldValue,
                             Object newValue)
Description copied from class: VariableX
Sends a modification notification. Subclasses implementing the NotificationEmitter interface can implement this method also to provide modification notifications.

Overrides:
sendNotification in class VariableX
Parameters:
message - the notification message.
name - the attribute name.
type - the attribute type.
oldValue - the old value.
newValue - the new value.

registerVariable

protected void registerVariable(String type)
Description copied from class: VariableX
Registers the type of the variable in the variable registry. The current attributes will be replaced with attributes from the variable registry corresponding to the specified type.

Overrides:
registerVariable in class VariableX
Parameters:
type - the variable type.

getMBeanDelegate

protected MBeanDelegate getMBeanDelegate()
Gets the delegate to provide access to its methods for subclasses.

Returns:
the delegate.


Copyright © 2004 The Norther Organization. All rights reserved.