001: /********************************************************************************
002: * CruiseControl, a Continuous Integration Toolkit
003: * Copyright (c) 2007, ThoughtWorks, Inc.
004: * 200 E. Randolph, 25th Floor
005: * Chicago, IL 60601 USA
006: * All rights reserved.
007: *
008: * Redistribution and use in source and binary forms, with or without
009: * modification, are permitted provided that the following conditions
010: * are met:
011: *
012: * + Redistributions of source code must retain the above copyright
013: * notice, this list of conditions and the following disclaimer.
014: *
015: * + Redistributions in binary form must reproduce the above
016: * copyright notice, this list of conditions and the following
017: * disclaimer in the documentation and/or other materials provided
018: * with the distribution.
019: *
020: * + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
021: * names of its contributors may be used to endorse or promote
022: * products derived from this software without specific prior
023: * written permission.
024: *
025: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
026: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
027: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
028: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
029: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
030: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
031: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
032: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
033: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
034: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
035: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
036: ********************************************************************************/package net.sourceforge.cruisecontrol.dashboard.testhelpers.jmxstub;
037:
038: import java.io.IOException;
039: import java.util.Set;
040:
041: import javax.management.Attribute;
042: import javax.management.AttributeList;
043: import javax.management.AttributeNotFoundException;
044: import javax.management.InstanceAlreadyExistsException;
045: import javax.management.InstanceNotFoundException;
046: import javax.management.IntrospectionException;
047: import javax.management.InvalidAttributeValueException;
048: import javax.management.ListenerNotFoundException;
049: import javax.management.MBeanException;
050: import javax.management.MBeanInfo;
051: import javax.management.MBeanRegistrationException;
052: import javax.management.MBeanServerConnection;
053: import javax.management.NotCompliantMBeanException;
054: import javax.management.NotificationFilter;
055: import javax.management.NotificationListener;
056: import javax.management.ObjectInstance;
057: import javax.management.ObjectName;
058: import javax.management.QueryExp;
059: import javax.management.ReflectionException;
060:
061: public class MBeanServerConnectionStatusStub implements
062: MBeanServerConnection {
063: private String buildStatus = "waiting for next time to build";
064:
065: public Object getAttribute(ObjectName name, String attr) {
066: return buildStatus;
067: }
068:
069: public Object invoke(ObjectName objName, String cmd,
070: Object[] params, String[] signatures) {
071: buildStatus = "now building since 20070420211341";
072: return buildStatus;
073: }
074:
075: public void addNotificationListener(ObjectName name,
076: NotificationListener listener, NotificationFilter filter,
077: Object handback) throws InstanceNotFoundException,
078: IOException {
079:
080: }
081:
082: public void addNotificationListener(ObjectName name,
083: ObjectName listener, NotificationFilter filter,
084: Object handback) throws InstanceNotFoundException,
085: IOException {
086:
087: }
088:
089: public ObjectInstance createMBean(String className, ObjectName name)
090: throws ReflectionException, InstanceAlreadyExistsException,
091: MBeanRegistrationException, MBeanException,
092: NotCompliantMBeanException, IOException {
093:
094: return null;
095: }
096:
097: public ObjectInstance createMBean(String className,
098: ObjectName name, ObjectName loaderName)
099: throws ReflectionException, InstanceAlreadyExistsException,
100: MBeanRegistrationException, MBeanException,
101: NotCompliantMBeanException, InstanceNotFoundException,
102: IOException {
103:
104: return null;
105: }
106:
107: public ObjectInstance createMBean(String className,
108: ObjectName name, Object[] params, String[] signature)
109: throws ReflectionException, InstanceAlreadyExistsException,
110: MBeanRegistrationException, MBeanException,
111: NotCompliantMBeanException, IOException {
112:
113: return null;
114: }
115:
116: public ObjectInstance createMBean(String className,
117: ObjectName name, ObjectName loaderName, Object[] params,
118: String[] signature) throws ReflectionException,
119: InstanceAlreadyExistsException, MBeanRegistrationException,
120: MBeanException, NotCompliantMBeanException,
121: InstanceNotFoundException, IOException {
122:
123: return null;
124: }
125:
126: public AttributeList getAttributes(ObjectName name,
127: String[] attributes) throws InstanceNotFoundException,
128: ReflectionException, IOException {
129:
130: return null;
131: }
132:
133: public String getDefaultDomain() throws IOException {
134:
135: return null;
136: }
137:
138: public String[] getDomains() throws IOException {
139:
140: return null;
141: }
142:
143: public Integer getMBeanCount() throws IOException {
144:
145: return null;
146: }
147:
148: public MBeanInfo getMBeanInfo(ObjectName name)
149: throws InstanceNotFoundException, IntrospectionException,
150: ReflectionException, IOException {
151:
152: return null;
153: }
154:
155: public ObjectInstance getObjectInstance(ObjectName name)
156: throws InstanceNotFoundException, IOException {
157:
158: return null;
159: }
160:
161: public boolean isInstanceOf(ObjectName name, String className)
162: throws InstanceNotFoundException, IOException {
163:
164: return false;
165: }
166:
167: public boolean isRegistered(ObjectName name) throws IOException {
168:
169: return false;
170: }
171:
172: public Set queryMBeans(ObjectName name, QueryExp query)
173: throws IOException {
174:
175: return null;
176: }
177:
178: public Set queryNames(ObjectName name, QueryExp query)
179: throws IOException {
180:
181: return null;
182: }
183:
184: public void removeNotificationListener(ObjectName name,
185: ObjectName listener) throws InstanceNotFoundException,
186: ListenerNotFoundException, IOException {
187:
188: }
189:
190: public void removeNotificationListener(ObjectName name,
191: NotificationListener listener)
192: throws InstanceNotFoundException,
193: ListenerNotFoundException, IOException {
194:
195: }
196:
197: public void removeNotificationListener(ObjectName name,
198: ObjectName listener, NotificationFilter filter,
199: Object handback) throws InstanceNotFoundException,
200: ListenerNotFoundException, IOException {
201:
202: }
203:
204: public void removeNotificationListener(ObjectName name,
205: NotificationListener listener, NotificationFilter filter,
206: Object handback) throws InstanceNotFoundException,
207: ListenerNotFoundException, IOException {
208:
209: }
210:
211: public void setAttribute(ObjectName name, Attribute attribute)
212: throws InstanceNotFoundException,
213: AttributeNotFoundException, InvalidAttributeValueException,
214: MBeanException, ReflectionException, IOException {
215:
216: }
217:
218: public AttributeList setAttributes(ObjectName name,
219: AttributeList attributes) throws InstanceNotFoundException,
220: ReflectionException, IOException {
221:
222: return null;
223: }
224:
225: public void unregisterMBean(ObjectName name)
226: throws InstanceNotFoundException,
227: MBeanRegistrationException, IOException {
228:
229: }
230: }
|