FileDocCategorySizeDatePackage
MonitoredAttributeBase.javaAPI DocJava SE 5 API2790Fri Aug 26 14:54:38 BST 2005com.sun.corba.se.spi.monitoring

MonitoredAttributeBase

public abstract class MonitoredAttributeBase extends Object implements MonitoredAttribute

author
Hemanth Puttaswamy

A Convenient class provided to help users extend and implement only getValue(), if there is no need to clear the state and the attribute is not writable.

Fields Summary
String
name
MonitoredAttributeInfo
attributeInfo
Constructors Summary
public MonitoredAttributeBase(String name, MonitoredAttributeInfo info)
Constructor.

        this.name = name;
        this.attributeInfo = info;
    
MonitoredAttributeBase(String name)
A Package Private Constructor for internal use only.

        this.name = name;
    
Methods Summary
public voidclearState()
If the concrete class decides not to provide the implementation of this method, then it's OK. Some of the examples where we may decide to not provide the implementation is the connection state. Irrespective of the call to clearState, the connection state will be showing the currect state of the connection. NOTE: This method is only used to clear the Monitored Attribute state, not the real state of the system itself.

    
public MonitoredAttributeInfogetAttributeInfo()
Gets the MonitoredAttributeInfo for the attribute.

        return attributeInfo;
    
public java.lang.StringgetName()
Gets the name of the attribute.

        return name;
    
public abstract java.lang.ObjectgetValue()
This method should be implemented by the concrete class.

voidsetMonitoredAttributeInfo(MonitoredAttributeInfo info)
A Package Private convenience method for setting MonitoredAttributeInfo for this Monitored Attribute.

        this.attributeInfo = info;
    
public voidsetValue(java.lang.Object value)
This method should be implemented by the concrete class only if the attribute is writable. If the attribute is not writable and if this method called, it will result in an IllegalStateException.

        if( !attributeInfo.isWritable() ) {
            throw new IllegalStateException( 
                "The Attribute " + name + " is not Writable..." );
        }
        throw new IllegalStateException( 
            "The method implementation is not provided for the attribute " + 
            name );