1. /*
  2. * @(#)Repository.java 1.37 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.jmx.mbeanserver;
  8. // java import
  9. import java.util.ArrayList;
  10. import java.util.Set;
  11. // RI import
  12. import javax.management.*;
  13. /**
  14. * The Repository interface provides local access to the
  15. * implementation of Repository Service in use in the agent.
  16. *
  17. * @since 1.5
  18. * @since.unbundled JMX RI 1.2
  19. */
  20. public interface Repository {
  21. /**
  22. * The purpose of this method is to provide a unified way to provide whatever
  23. * configuration information is needed by the specific underlying implementation
  24. * of the repository.
  25. *
  26. * @param configParameters An list containing the configuration parameters needed by the specific
  27. * Repository Service implementation.
  28. */
  29. public void setConfigParameters(ArrayList configParameters) ;
  30. /**
  31. * Indicates whether or not the Repository Service supports filtering. If
  32. * the Repository Service does not support filtering, the MBean Server
  33. * will perform filtering.
  34. *
  35. * @return true if filtering is supported, false otherwise.
  36. */
  37. public boolean isFiltering() ;
  38. /**
  39. * Stores an MBean associated with its object name in the repository.
  40. *
  41. *@param object MBean to be stored in the repository.
  42. *@param name MBean object name.
  43. *
  44. *@exception InstanceAlreadyExistsException The MBean is already stored in the repository.
  45. */
  46. public void addMBean(Object object, ObjectName name )
  47. throws InstanceAlreadyExistsException ;
  48. /**
  49. * Checks whether an MBean of the name specified is already stored in
  50. * the repository.
  51. *
  52. * @param name name of the MBean to find.
  53. *
  54. * @return true if the MBean is stored in the repository, false otherwise.
  55. */
  56. public boolean contains(ObjectName name) ;
  57. /**
  58. * Retrieves the MBean of the name specified from the repository. The
  59. * object name must match exactly.
  60. *
  61. * @param name name of the MBean to retrieve.
  62. *
  63. * @return The retrieved MBean if it is contained in the repository, null otherwise.
  64. *
  65. */
  66. public Object retrieve(ObjectName name) ;
  67. /**
  68. * Selects and retrieves the list of MBeans whose names match the specified
  69. * object name pattern and which match the specified query expression (optionally).
  70. *
  71. *
  72. * @param name The name of the MBean(s) to retrieve - may be a specific object or
  73. * a name pattern allowing multiple MBeans to be selected.
  74. * @param query query expression to apply when selecting objects - this parameter will
  75. * be ignored when the Repository Service does not support filtering.
  76. *
  77. * @return The list of MBeans selected. There may be zero, one or many MBeans returned
  78. * in the Set.
  79. *
  80. */
  81. public Set query(ObjectName name, QueryExp query);
  82. /**
  83. * Removes an MBean from the repository.
  84. *
  85. * @param name name of the MBean to remove.
  86. *
  87. * @exception InstanceNotFoundException The MBean does not exist in the repository.
  88. */
  89. public void remove(ObjectName name) throws InstanceNotFoundException ;
  90. /**
  91. * Gets the number of MBeans stored in the repository.
  92. *
  93. * @return Number of MBeans.
  94. */
  95. public Integer getCount() ;
  96. /**
  97. * Gets the name of the domain currently used by default in the repository.
  98. *
  99. * @return A string giving the name of the default domain name.
  100. */
  101. public String getDefaultDomain() ;
  102. /**
  103. * Returns the list of domains in which any MBean is currently
  104. * registered.
  105. *
  106. * @since.unbundled JMX RI 1.2
  107. */
  108. public String[] getDomains();
  109. }