org.mc4j.ems.impl.jmx.connection.bean.attribute
Class DAttribute

java.lang.Object
  extended by org.mc4j.ems.impl.jmx.connection.bean.attribute.DAttribute
Direct Known Subclasses:
DUnkownAttribute

public class DAttribute
extends java.lang.Object

Version:
$Revision: 592 $($Author: ghinkl $ / $Date: 2008-09-16 12:32:53 -0400 (Tue, 16 Sep 2008) $)
Author:
Greg Hinkle (ghinkle@users.sourceforge.net), Apr 4, 2005

Field Summary
protected  DMBean bean
           
protected  java.util.Set<AttributeChangeListener> changeListeners
           
protected  java.lang.Object currentValue
           
protected  java.util.LinkedList<java.lang.Throwable> failures
           
protected  javax.management.MBeanAttributeInfo info
           
protected  long lastRetrieved
           
protected  boolean loaded
           
protected  boolean supportedType
           
protected  ValueHistory valueHistory
           
 
Constructor Summary
DAttribute(javax.management.MBeanAttributeInfo info, DMBean bean)
           
 
Method Summary
 void alterValue(java.lang.Object newValue)
          Alters the internally stored value of this attribute.
 int compareTo(java.lang.Object o)
           
 java.lang.String getDescription()
           
 java.util.List<java.lang.Throwable> getFailures()
          TODO GH: Should this be a list of failure objects that has more info or perhaps a custom exception with the info? (timestamp, bean name, attribute name) TODO GH: Should this be all failures, retrieval failures, what about set failures? TODO GH: Should this be genericised for the server proxy objects?
 java.lang.String getName()
           
 java.lang.String getType()
           
 java.lang.Class getTypeClass()
           
 java.lang.Object getValue()
           
 org.mc4j.ems.store.ValueHistory getValueHistory()
           
 int getValueSize()
           
protected  void init()
          Initializes internal storage settings for the value history
 boolean isNumericType()
           
 boolean isReadable()
           
 boolean isSupportedType()
           
 boolean isWritable()
           
 java.lang.Object refresh()
          Updates the local value of this mbean from the server

TODO we should not update to null on failure, but retain the last known

 void registerAttributeChangeListener(AttributeChangeListener listener)
           
protected  void registerFailure(java.lang.Throwable t)
           
 void setSupportedType(boolean supportedType)
           
 void setValue(java.lang.Object newValue)
          Set the attribute on the server
protected  boolean storeHistory(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

protected javax.management.MBeanAttributeInfo info

bean

protected DMBean bean

loaded

protected boolean loaded

supportedType

protected boolean supportedType

changeListeners

protected java.util.Set<AttributeChangeListener> changeListeners

lastRetrieved

protected long lastRetrieved

currentValue

protected java.lang.Object currentValue

valueHistory

protected ValueHistory valueHistory

failures

protected java.util.LinkedList<java.lang.Throwable> failures
Constructor Detail

DAttribute

public DAttribute(javax.management.MBeanAttributeInfo info,
                  DMBean bean)
Method Detail

init

protected void init()
Initializes internal storage settings for the value history


registerAttributeChangeListener

public void registerAttributeChangeListener(AttributeChangeListener listener)

getValue

public java.lang.Object getValue()

getValueSize

public int getValueSize()

setValue

public void setValue(java.lang.Object newValue)
              throws java.lang.Exception
Set the attribute on the server

Parameters:
newValue - The value to be set
Throws:
java.lang.Exception

alterValue

public void alterValue(java.lang.Object newValue)
Alters the internally stored value of this attribute. Does not update the server value. Is intended for mass load of attribute data via the MBean.

Parameters:
newValue -

storeHistory

protected boolean storeHistory(java.lang.Object value)

refresh

public java.lang.Object refresh()
Updates the local value of this mbean from the server

TODO we should not update to null on failure, but retain the last known


getFailures

public java.util.List<java.lang.Throwable> getFailures()
TODO GH: Should this be a list of failure objects that has more info or perhaps a custom exception with the info? (timestamp, bean name, attribute name) TODO GH: Should this be all failures, retrieval failures, what about set failures? TODO GH: Should this be genericised for the server proxy objects?

Returns:
failures of interaction with server related to this attribute

registerFailure

protected void registerFailure(java.lang.Throwable t)

getValueHistory

public org.mc4j.ems.store.ValueHistory getValueHistory()

getName

public java.lang.String getName()

getType

public java.lang.String getType()

getTypeClass

public java.lang.Class getTypeClass()

isNumericType

public boolean isNumericType()

getDescription

public java.lang.String getDescription()

isWritable

public boolean isWritable()

isReadable

public boolean isReadable()

isSupportedType

public boolean isSupportedType()

setSupportedType

public void setSupportedType(boolean supportedType)

compareTo

public int compareTo(java.lang.Object o)