1 7 package com.sun.corba.se.spi.monitoring; 8 9 import java.util.*; 10 11 23 public abstract class MonitoredAttributeBase implements MonitoredAttribute { 24 String name; 25 MonitoredAttributeInfo attributeInfo; 26 29 public MonitoredAttributeBase( String name, MonitoredAttributeInfo info ) { 30 this.name = name; 31 this.attributeInfo = info; 32 } 33 34 35 38 MonitoredAttributeBase( String name ) { 39 this.name = name; 40 } 41 42 43 47 void setMonitoredAttributeInfo( MonitoredAttributeInfo info ) { 48 this.attributeInfo = info; 49 } 50 51 60 public void clearState( ) { 61 } 62 63 66 public abstract Object getValue( ); 67 68 73 public void setValue( Object value ) { 74 if( !attributeInfo.isWritable() ) { 75 throw new IllegalStateException ( 76 "The Attribute " + name + " is not Writable..." ); 77 } 78 throw new IllegalStateException ( 79 "The method implementation is not provided for the attribute " + 80 name ); 81 } 82 83 84 87 public MonitoredAttributeInfo getAttributeInfo( ) { 88 return attributeInfo; 89 } 90 91 94 public String getName( ) { 95 return name; 96 } 97 } 99 100 101 | Popular Tags |