KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > excalibur > instrument > manager > InstrumentableDescriptor


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14  * implied.
15  *
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */

19
20 package org.apache.excalibur.instrument.manager;
21
22 /**
23  * Describes a Instrumentable and acts as a Proxy to protect the original
24  * Instrumentable.
25  *
26  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
27  */

28 public interface InstrumentableDescriptor
29 {
30     /**
31      * Returns true if the Instrumentable was configured in the instrumentables
32      * section of the configuration.
33      *
34      * @return True if configured.
35      */

36     boolean isConfigured();
37
38     /**
39      * Returns true if the Instrumentable was registered with the Instrument
40      * Manager.
41      *
42      * @return True if registered.
43      */

44     boolean isRegistered();
45
46     /**
47      * Gets the name for the Instrumentable. The Instrumentable Name is used
48      * to uniquely identify the Instrumentable during its configuration and to
49      * gain access to a InstrumentableDescriptor through a
50      * DefaultInstrumentManager.
51      *
52      * @return The name used to identify a Instrumentable.
53      */

54     String JavaDoc getName();
55
56     /**
57      * Gets the description of the Instrumentable.
58      *
59      * @return The description of the Instrumentable.
60      */

61     String JavaDoc getDescription();
62     
63     /**
64      * Returns the parent InstrumentableDescriptor or null if this is a top
65      * level instrumentable.
66      *
67      * @return The parent InstrumentableDescriptor or null.
68      */

69     InstrumentableDescriptor getParentInstrumentableDescriptor();
70
71     /**
72      * Returns a child InstrumentableDescriptor based on its name or the name
73      * of any of its children.
74      *
75      * @param childInstrumentableName Name of the child Instrumentable being
76      * requested.
77      *
78      * @return A descriptor of the requested child Instrumentable.
79      *
80      * @throws NoSuchInstrumentableException If the specified Instrumentable
81      * does not exist.
82      */

83     InstrumentableDescriptor getChildInstrumentableDescriptor( String JavaDoc childInstrumentableName )
84         throws NoSuchInstrumentableException;
85
86     /**
87      * Returns an array of Descriptors for the child Instrumentables registered
88      * by this Instrumentable.
89      *
90      * @return An array of Descriptors for the child Instrumentables registered
91      * by this Instrumentable.
92      */

93     InstrumentableDescriptor[] getChildInstrumentableDescriptors();
94         
95     /**
96      * Returns a InstrumentDescriptor based on its name.
97      *
98      * @param instrumentName Name of the Instrument being requested.
99      *
100      * @return A Descriptor of the requested Instrument.
101      *
102      * @throws NoSuchInstrumentException If the specified Instrument does
103      * not exist.
104      */

105     InstrumentDescriptor getInstrumentDescriptor( String JavaDoc instrumentName )
106         throws NoSuchInstrumentException;
107
108     /**
109      * Returns an array of Descriptors for the Instruments registered by this
110      * Instrumentable.
111      *
112      * @return An array of Descriptors for the Instruments registered by this
113      * Instrumentable.
114      */

115     InstrumentDescriptor[] getInstrumentDescriptors();
116     
117     /**
118      * Returns the stateVersion of the instrumentable. The state version
119      * will be incremented each time any of the configuration of the
120      * instrumentable or any of its children is modified.
121      * Clients can use this value to tell whether or not anything has
122      * changed without having to do an exhaustive comparison.
123      *
124      * @return The state version of the instrumentable.
125      */

126     int getStateVersion();
127 }
128
Popular Tags