1. /*
  2. * @(#)MonitoredAttribute.java 1.3 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.spi.monitoring;
  8. import com.sun.corba.se.spi.monitoring.MonitoredAttributeInfo;
  9. import java.util.*;
  10. /**
  11. * <p>
  12. *
  13. * @author Hemanth Puttaswamy
  14. * </p>
  15. * <p>
  16. * Monitored Attribute is the interface to represent a Monitorable
  17. * Attribute. Using this interface, one can get the value of the attribute
  18. * and set the value if it is a writeable attribute.
  19. * </p>
  20. */
  21. public interface MonitoredAttribute {
  22. ///////////////////////////////////////
  23. // operations
  24. /**
  25. * <p>
  26. * Gets the Monitored Attribute Info for the attribute.
  27. * </p>
  28. * <p>
  29. *
  30. * @param monitoredAttributeInfo for this Monitored Attribute.
  31. * </p>
  32. */
  33. public MonitoredAttributeInfo getAttributeInfo();
  34. /**
  35. * <p>
  36. * Sets the value for the Monitored Attribute if isWritable() is false, the
  37. * method will throw ILLEGAL Operation exception.
  38. *
  39. * Also, the type of 'value' should be same as specified in the
  40. * MonitoredAttributeInfo for a particular instance.
  41. * </p>
  42. * <p>
  43. *
  44. * @param value should be any one of the Basic Java Type Objects which are
  45. * Long, Double, Float, String, Integer, Short, Character, Byte.
  46. * </p>
  47. */
  48. public void setValue(Object value);
  49. /**
  50. * <p>
  51. * Gets the value of the Monitored Attribute. The value can be obtained
  52. * from different parts of the module. User may choose to delegate the call
  53. * to getValue() to other variables.
  54. *
  55. * NOTE: It is important to make sure that the type of Object returned in
  56. * getvalue is same as the one specified in MonitoredAttributeInfo for this
  57. * attribute.
  58. * </p>
  59. * <p>
  60. *
  61. * </p>
  62. * <p>
  63. *
  64. * @param value is the current value for this MonitoredAttribute
  65. * </p>
  66. */
  67. public Object getValue();
  68. /**
  69. * <p>
  70. * Gets the name of the Monitored Attribute.
  71. * </p>
  72. * <p>
  73. *
  74. * @param name of this Attribute
  75. * </p>
  76. */
  77. public String getName();
  78. /**
  79. * <p>
  80. * If this attribute needs to be cleared, the user needs to implement this
  81. * method to reset the state to initial state. If the Monitored Attribute
  82. * doesn't change like for example (ConnectionManager High Water Mark),
  83. * then clearState() is a No Op.
  84. * </p>
  85. *
  86. */
  87. public void clearState();
  88. } // end MonitoredAttribute