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>, Variable
Direct Known Subclasses:
VariableZ

public class VariableY
extends VariableX
implements NamePattern, NotificationEmitter

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

Version:
$Id: VariableY.java,v 1.29 2010-04-07 15:45:46 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.norther.tammi.core.rt.Variable
ADD_ATTRIBUTE_ELEMENT, ADD_ATTRIBUTE_INFO, ADD_VALIDATED_ELEMENT, ATTRIBUTE_ELEMENT_SEPARATOR, ATTRIBUTE_INFO, ATTRIBUTE_LENGTH, ATTRIBUTE_LIST, ATTRIBUTE_POSITION, ATTRIBUTE_VALUES, CLEAR_ATTRIBUTE_INFO, CLEAR_ATTRIBUTE_VALUES, CONTAINS_ATTRIBUTE, CONTAINS_TRAIT, EXPORT_ATTRIBUTES, GET_ATTRIBUTE_ELEMENT, GET_ATTRIBUTE_VALUE, GET_RECURSIVE_ELEMENT, GET_RECURSIVE_VALUE, GET_VALIDATED_ELEMENT, GET_VALIDATED_VALUE, ID, ID_ATTRIBUTE_LIST, IMPORT_ATTRIBUTES, REMOVE_ATTRIBUTE_ELEMENT, REMOVE_VALIDATED_ELEMENT, REPLACE_ATTRIBUTE_INFO, RESET_VALIDATED_VALUES, SET_ATTRIBUTE_ELEMENT, SET_ATTRIBUTE_VALUE, SET_ATTRIBUTE_VALUES, SET_VALIDATED_ELEMENT, SET_VALIDATED_VALUE, TYPE, VALIDATE_ATTRIBUTE_VALUES, VALIDATED_VALUES, VARIABLE_INFO
 
Fields inherited from interface org.norther.tammi.core.base.ReferableMBean
MBEAN, NS
 
Constructor Summary
  VariableY()
          Constructs a new variable.
protected VariableY(String type)
          Constructs a new variable with a virtual type.
  VariableY(String type, MBeanReference<? extends VariableRegistry> vr)
          Constructs a new variable with a virtual type from the specified registry.
 
Method Summary
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 String getCanonicalName()
          Gets the canonical object name of the MBean as a string.
 MBeanReference<Variable> 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 registerAttributeInfo(VariableInfo info)
          Registers attribute info.
 void removeNotificationListener(NotificationListener listener)
           
 void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 void sendNotification(String message, String name, String type, Object... values)
          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
addAttributeElement, addAttributeElement, addAttributeInfo, addAttributeInfoIfAbsent, addTraceListener, addValidatedElement, addValidatedElement, attributeInfo, attributeInfo, attributeInfoRegistered, attributeLength, attributeList, attributePosition, clearAttributeInfo, clearAttributeValues, clearLastModified, clearTraceListeners, clone, containsAttribute, containsTrait, equals, exportAttributes, getAttribute, getAttributeElement, getAttributes, getAttributeValue, getAttributeValue, getAttributeValues, getAttributeValues, getId, getInternalAttributeValue, getLastModified, getLastModified, getMBeanServer, getObjectName, getRecursiveElement, getRecursiveValue, getType, getValidatedElement, getValidatedValue, idAttributeList, importAttributes, invoke, isEmpty, putAttributeElement, putAttributeValue, putAttributeValues, putInternalAttributeValue, putInternalAttributeValue, removeAttributeElement, removeAttributeElement, removeAttributeElement, removeTraceListener, removeValidatedElement, removeValidatedElement, replaceAttributeInfo, resetValidatedValues, setAttribute, setAttributeElement, setAttributeElement, setAttributes, setAttributeValue, setAttributeValues, setAttributeValues, setId, setLastModified, setObjectName, setValidatedElement, setValidatedValue, toString, validateAttributeValue, validateAttributeValues, validateAttributeValues, validateAttributeValues, validatedValues, validateMandatoryValue, variableInfo
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableY

public VariableY()
Constructs a new variable.


VariableY

public VariableY(String type,
                 MBeanReference<? extends VariableRegistry> vr)
Constructs a new variable with a virtual type from the specified registry.

Parameters:
type - the variable type.
vr - the variable registry.

VariableY

protected VariableY(String type)
Constructs a new variable with a virtual 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<Variable> getMBean()
Description copied from interface: ReferableMBean
Gets a reference to the MBean.

Specified by:
getMBean in interface ReferableMBean<Variable>
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... values)
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.
values - the old and new values of the attribute.

getMBeanDelegate

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

Returns:
the delegate.

registerAttributeInfo

protected void registerAttributeInfo(VariableInfo info)
Description copied from class: VariableX
Registers attribute info.

Overrides:
registerAttributeInfo in class VariableX
Parameters:
info - the variable info.


Copyright © 2004 The Norther Organization. All rights reserved.