KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > mbeanserver > Repository


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
8 package com.sun.jmx.mbeanserver;
9
10
11 // java import
12
import java.util.ArrayList JavaDoc;
13 import java.util.Set JavaDoc;
14
15
16 // RI import
17
import javax.management.*;
18
19 /**
20  * The Repository interface provides local access to the
21  * implementation of Repository Service in use in the agent.
22  *
23  * @since 1.5
24  * @since.unbundled JMX RI 1.2
25  */

26 public interface Repository {
27
28
29     /**
30      * The purpose of this method is to provide a unified way to provide whatever
31      * configuration information is needed by the specific underlying implementation
32      * of the repository.
33      *
34      * @param configParameters An list containing the configuration parameters needed by the specific
35      * Repository Service implementation.
36      */

37     public void setConfigParameters(ArrayList JavaDoc configParameters) ;
38
39     /**
40      * Indicates whether or not the Repository Service supports filtering. If
41      * the Repository Service does not support filtering, the MBean Server
42      * will perform filtering.
43      *
44      * @return true if filtering is supported, false otherwise.
45      */

46     public boolean isFiltering() ;
47     
48     /**
49      * Stores an MBean associated with its object name in the repository.
50      *
51      *@param object MBean to be stored in the repository.
52      *@param name MBean object name.
53      *
54      *@exception InstanceAlreadyExistsException The MBean is already stored in the repository.
55      */

56     public void addMBean(Object JavaDoc object, ObjectName name )
57     throws InstanceAlreadyExistsException ;
58     
59     /**
60      * Checks whether an MBean of the name specified is already stored in
61      * the repository.
62      *
63      * @param name name of the MBean to find.
64      *
65      * @return true if the MBean is stored in the repository, false otherwise.
66      */

67     public boolean contains(ObjectName name) ;
68     
69     /**
70      * Retrieves the MBean of the name specified from the repository. The
71      * object name must match exactly.
72      *
73      * @param name name of the MBean to retrieve.
74      *
75      * @return The retrieved MBean if it is contained in the repository, null otherwise.
76      *
77      */

78     public Object JavaDoc retrieve(ObjectName name) ;
79
80     /**
81      * Selects and retrieves the list of MBeans whose names match the specified
82      * object name pattern and which match the specified query expression (optionally).
83      *
84      *
85      * @param name The name of the MBean(s) to retrieve - may be a specific object or
86      * a name pattern allowing multiple MBeans to be selected.
87      * @param query query expression to apply when selecting objects - this parameter will
88      * be ignored when the Repository Service does not support filtering.
89      *
90      * @return The list of MBeans selected. There may be zero, one or many MBeans returned
91      * in the Set.
92      *
93      */

94     public Set JavaDoc query(ObjectName name, QueryExp query);
95        
96     /**
97      * Removes an MBean from the repository.
98      *
99      * @param name name of the MBean to remove.
100      *
101      * @exception InstanceNotFoundException The MBean does not exist in the repository.
102      */

103     public void remove(ObjectName name) throws InstanceNotFoundException ;
104
105     /**
106      * Gets the number of MBeans stored in the repository.
107      *
108      * @return Number of MBeans.
109      */

110     public Integer JavaDoc getCount() ;
111
112     /**
113      * Gets the name of the domain currently used by default in the repository.
114      *
115      * @return A string giving the name of the default domain name.
116      */

117     public String JavaDoc getDefaultDomain() ;
118
119     /**
120      * Returns the list of domains in which any MBean is currently
121      * registered.
122      *
123      * @since.unbundled JMX RI 1.2
124      */

125     public String JavaDoc[] getDomains();
126
127  }
128
Popular Tags