001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.geronimo.kernel;
017:
018: import java.util.Date;
019: import java.util.Set;
020: import javax.management.ObjectName;
021:
022: import org.apache.geronimo.gbean.GBeanData;
023: import org.apache.geronimo.gbean.GBeanInfo;
024: import org.apache.geronimo.gbean.GBeanInfoBuilder;
025: import org.apache.geronimo.gbean.AbstractNameQuery;
026: import org.apache.geronimo.gbean.AbstractName;
027: import org.apache.geronimo.kernel.lifecycle.LifecycleMonitor;
028: import org.apache.geronimo.kernel.proxy.ProxyManager;
029:
030: /**
031: * @version $Rev:386515 $ $Date: 2007-02-10 18:00:20 -0800 (Sat, 10 Feb 2007) $
032: */
033: public class KernelGBean implements Kernel {
034: private final Kernel kernel;
035:
036: public KernelGBean(Kernel kernel) {
037: this .kernel = kernel;
038: }
039:
040: public String getKernelName() {
041: return kernel.getKernelName();
042: }
043:
044: public Naming getNaming() {
045: return kernel.getNaming();
046: }
047:
048: public DependencyManager getDependencyManager() {
049: return kernel.getDependencyManager();
050: }
051:
052: public LifecycleMonitor getLifecycleMonitor() {
053: return kernel.getLifecycleMonitor();
054: }
055:
056: public ProxyManager getProxyManager() {
057: return kernel.getProxyManager();
058: }
059:
060: public void loadGBean(GBeanData gbeanData, ClassLoader classLoader)
061: throws GBeanAlreadyExistsException, InternalKernelException {
062: kernel.loadGBean(gbeanData, classLoader);
063: }
064:
065: public boolean isLoaded(AbstractName name) {
066: return kernel.isLoaded(name);
067: }
068:
069: public boolean isLoaded(String shortName) {
070: return kernel.isLoaded(shortName);
071: }
072:
073: public boolean isLoaded(Class type) {
074: return kernel.isLoaded(type);
075: }
076:
077: public boolean isLoaded(String shortName, Class type) {
078: return kernel.isLoaded(shortName, type);
079: }
080:
081: public Object getGBean(ObjectName name)
082: throws GBeanNotFoundException, InternalKernelException,
083: IllegalStateException {
084: return kernel.getGBean(name);
085: }
086:
087: public Object getGBean(AbstractName name)
088: throws GBeanNotFoundException, InternalKernelException,
089: IllegalStateException {
090: return kernel.getGBean(name);
091: }
092:
093: public Object getGBean(String shortName)
094: throws GBeanNotFoundException, InternalKernelException,
095: IllegalStateException {
096: return kernel.getGBean(shortName);
097: }
098:
099: public Object getGBean(Class type) throws GBeanNotFoundException,
100: InternalKernelException, IllegalStateException {
101: return kernel.getGBean(type);
102: }
103:
104: public Object getGBean(String shortName, Class type)
105: throws GBeanNotFoundException, InternalKernelException,
106: IllegalStateException {
107: return kernel.getGBean(shortName, type);
108: }
109:
110: public void startGBean(AbstractName name)
111: throws GBeanNotFoundException, InternalKernelException,
112: IllegalStateException {
113: kernel.startGBean(name);
114: }
115:
116: public void startGBean(String shortName)
117: throws GBeanNotFoundException, InternalKernelException,
118: IllegalStateException {
119: kernel.startGBean(shortName);
120: }
121:
122: public void startGBean(Class type) throws GBeanNotFoundException,
123: InternalKernelException, IllegalStateException {
124: kernel.startGBean(type);
125: }
126:
127: public void startGBean(String shortName, Class type)
128: throws GBeanNotFoundException, InternalKernelException,
129: IllegalStateException {
130: kernel.startGBean(shortName, type);
131: }
132:
133: public void startRecursiveGBean(AbstractName name)
134: throws GBeanNotFoundException, InternalKernelException,
135: IllegalStateException {
136: kernel.startRecursiveGBean(name);
137: }
138:
139: public void startRecursiveGBean(String shortName)
140: throws GBeanNotFoundException, InternalKernelException,
141: IllegalStateException {
142: kernel.startRecursiveGBean(shortName);
143: }
144:
145: public void startRecursiveGBean(Class type)
146: throws GBeanNotFoundException, InternalKernelException,
147: IllegalStateException {
148: kernel.startRecursiveGBean(type);
149: }
150:
151: public void startRecursiveGBean(String shortName, Class type)
152: throws GBeanNotFoundException, InternalKernelException,
153: IllegalStateException {
154: kernel.startRecursiveGBean(shortName, type);
155: }
156:
157: public boolean isRunning(AbstractName name) {
158: return kernel.isRunning(name);
159: }
160:
161: public boolean isRunning(String shortName) {
162: return kernel.isRunning(shortName);
163: }
164:
165: public boolean isRunning(Class type) {
166: return kernel.isRunning(type);
167: }
168:
169: public boolean isRunning(String shortName, Class type) {
170: return kernel.isRunning(shortName, type);
171: }
172:
173: public void stopGBean(AbstractName name)
174: throws GBeanNotFoundException, InternalKernelException,
175: IllegalStateException {
176: kernel.stopGBean(name);
177: }
178:
179: public void stopGBean(String shortName)
180: throws GBeanNotFoundException, InternalKernelException,
181: IllegalStateException {
182: kernel.stopGBean(shortName);
183: }
184:
185: public void stopGBean(Class type) throws GBeanNotFoundException,
186: InternalKernelException, IllegalStateException {
187: kernel.stopGBean(type);
188: }
189:
190: public void stopGBean(String shortName, Class type)
191: throws GBeanNotFoundException, InternalKernelException,
192: IllegalStateException {
193: kernel.stopGBean(shortName, type);
194: }
195:
196: public void unloadGBean(AbstractName name)
197: throws GBeanNotFoundException, InternalKernelException,
198: IllegalStateException {
199: kernel.unloadGBean(name);
200: }
201:
202: public void unloadGBean(String shortName)
203: throws GBeanNotFoundException, InternalKernelException,
204: IllegalStateException {
205: kernel.unloadGBean(shortName);
206: }
207:
208: public void unloadGBean(Class type) throws GBeanNotFoundException,
209: InternalKernelException, IllegalStateException {
210: kernel.unloadGBean(type);
211: }
212:
213: public void unloadGBean(String shortName, Class type)
214: throws GBeanNotFoundException, InternalKernelException,
215: IllegalStateException {
216: kernel.unloadGBean(shortName, type);
217: }
218:
219: public int getGBeanState(ObjectName name)
220: throws GBeanNotFoundException {
221: return kernel.getGBeanState(name);
222: }
223:
224: public int getGBeanState(AbstractName name)
225: throws GBeanNotFoundException {
226: return kernel.getGBeanState(name);
227: }
228:
229: public int getGBeanState(String shortName)
230: throws GBeanNotFoundException {
231: return kernel.getGBeanState(shortName);
232: }
233:
234: public int getGBeanState(Class type) throws GBeanNotFoundException {
235: return kernel.getGBeanState(type);
236: }
237:
238: public int getGBeanState(String shortName, Class type)
239: throws GBeanNotFoundException {
240: return kernel.getGBeanState(shortName, type);
241: }
242:
243: public long getGBeanStartTime(AbstractName name)
244: throws GBeanNotFoundException {
245: return kernel.getGBeanStartTime(name);
246: }
247:
248: public long getGBeanStartTime(String shortName)
249: throws GBeanNotFoundException {
250: return kernel.getGBeanStartTime(shortName);
251: }
252:
253: public long getGBeanStartTime(Class type)
254: throws GBeanNotFoundException {
255: return kernel.getGBeanStartTime(type);
256: }
257:
258: public long getGBeanStartTime(String shortName, Class type)
259: throws GBeanNotFoundException {
260: return kernel.getGBeanStartTime(shortName, type);
261: }
262:
263: public ClassLoader getClassLoaderFor(AbstractName name)
264: throws GBeanNotFoundException {
265: return kernel.getClassLoaderFor(name);
266: }
267:
268: public ClassLoader getClassLoaderFor(String shortName)
269: throws GBeanNotFoundException {
270: return kernel.getClassLoaderFor(shortName);
271: }
272:
273: public ClassLoader getClassLoaderFor(Class type)
274: throws GBeanNotFoundException {
275: return kernel.getClassLoaderFor(type);
276: }
277:
278: public ClassLoader getClassLoaderFor(String shortName, Class type)
279: throws GBeanNotFoundException {
280: return kernel.getClassLoaderFor(shortName, type);
281: }
282:
283: public GBeanInfo getGBeanInfo(ObjectName name)
284: throws GBeanNotFoundException {
285: return kernel.getGBeanInfo(name);
286: }
287:
288: public GBeanInfo getGBeanInfo(AbstractName name)
289: throws GBeanNotFoundException {
290: return kernel.getGBeanInfo(name);
291: }
292:
293: public GBeanInfo getGBeanInfo(String shortName)
294: throws GBeanNotFoundException {
295: return kernel.getGBeanInfo(shortName);
296: }
297:
298: public GBeanInfo getGBeanInfo(Class type)
299: throws GBeanNotFoundException {
300: return kernel.getGBeanInfo(type);
301: }
302:
303: public GBeanInfo getGBeanInfo(String shortName, Class type)
304: throws GBeanNotFoundException {
305: return kernel.getGBeanInfo(shortName, type);
306: }
307:
308: public GBeanData getGBeanData(AbstractName name)
309: throws GBeanNotFoundException, InternalKernelException {
310: return kernel.getGBeanData(name);
311: }
312:
313: public GBeanData getGBeanData(String shortName)
314: throws GBeanNotFoundException, InternalKernelException {
315: return kernel.getGBeanData(shortName);
316: }
317:
318: public GBeanData getGBeanData(Class type)
319: throws GBeanNotFoundException, InternalKernelException {
320: return kernel.getGBeanData(type);
321: }
322:
323: public GBeanData getGBeanData(String shortName, Class type)
324: throws GBeanNotFoundException, InternalKernelException {
325: return kernel.getGBeanData(shortName, type);
326: }
327:
328: public Set listGBeans(ObjectName pattern) {
329: return kernel.listGBeans(pattern);
330: }
331:
332: public Set listGBeans(Set patterns) {
333: return kernel.listGBeans(patterns);
334: }
335:
336: public Object getAttribute(ObjectName objectName,
337: String attributeName) throws GBeanNotFoundException,
338: NoSuchAttributeException, Exception {
339: return kernel.getAttribute(objectName, attributeName);
340: }
341:
342: public Object getAttribute(AbstractName abstractName,
343: String attributeName) throws GBeanNotFoundException,
344: NoSuchAttributeException, Exception {
345: return kernel.getAttribute(abstractName, attributeName);
346: }
347:
348: public Object getAttribute(String shortName, String attributeName)
349: throws GBeanNotFoundException, NoSuchAttributeException,
350: Exception {
351: return kernel.getAttribute(shortName, attributeName);
352: }
353:
354: public Object getAttribute(Class type, String attributeName)
355: throws GBeanNotFoundException, NoSuchAttributeException,
356: Exception {
357: return kernel.getAttribute(type, attributeName);
358: }
359:
360: public Object getAttribute(String shortName, Class type,
361: String attributeName) throws GBeanNotFoundException,
362: NoSuchAttributeException, Exception {
363: return kernel.getAttribute(shortName, type, attributeName);
364: }
365:
366: public void setAttribute(AbstractName abstractName,
367: String attributeName, Object attributeValue)
368: throws GBeanNotFoundException, NoSuchAttributeException,
369: Exception {
370: kernel
371: .setAttribute(abstractName, attributeName,
372: attributeValue);
373: }
374:
375: public void setAttribute(String shortName, String attributeName,
376: Object attributeValue) throws GBeanNotFoundException,
377: NoSuchAttributeException, Exception {
378: kernel.setAttribute(shortName, attributeName, attributeValue);
379: }
380:
381: public void setAttribute(Class type, String attributeName,
382: Object attributeValue) throws GBeanNotFoundException,
383: NoSuchAttributeException, Exception {
384: kernel.setAttribute(type, attributeName, attributeValue);
385: }
386:
387: public void setAttribute(String shortName, Class type,
388: String attributeName, Object attributeValue)
389: throws GBeanNotFoundException, NoSuchAttributeException,
390: Exception {
391: kernel.setAttribute(shortName, type, attributeName,
392: attributeValue);
393: }
394:
395: public Object invoke(ObjectName objectName, String methodName)
396: throws GBeanNotFoundException, NoSuchOperationException,
397: InternalKernelException, Exception {
398: return kernel.invoke(objectName, methodName);
399: }
400:
401: public Object invoke(AbstractName abstractName, String methodName)
402: throws GBeanNotFoundException, NoSuchOperationException,
403: InternalKernelException, Exception {
404: return kernel.invoke(abstractName, methodName);
405: }
406:
407: public Object invoke(String shortName, String methodName)
408: throws GBeanNotFoundException, NoSuchOperationException,
409: InternalKernelException, Exception {
410: return kernel.invoke(shortName, methodName);
411: }
412:
413: public Object invoke(Class type, String methodName)
414: throws GBeanNotFoundException, NoSuchOperationException,
415: InternalKernelException, Exception {
416: return kernel.invoke(type, methodName);
417: }
418:
419: public Object invoke(String shortName, Class type, String methodName)
420: throws GBeanNotFoundException, NoSuchOperationException,
421: InternalKernelException, Exception {
422: return kernel.invoke(shortName, type, methodName);
423: }
424:
425: public Object invoke(ObjectName objectName, String methodName,
426: Object[] args, String[] types)
427: throws GBeanNotFoundException, NoSuchOperationException,
428: InternalKernelException, Exception {
429: return kernel.invoke(objectName, methodName, args, types);
430: }
431:
432: public String getStateReason(AbstractName abstractName) {
433: return kernel.getStateReason(abstractName);
434: }
435:
436: public Object invoke(AbstractName abstractName, String methodName,
437: Object[] args, String[] types)
438: throws GBeanNotFoundException, NoSuchOperationException,
439: InternalKernelException, Exception {
440: return kernel.invoke(abstractName, methodName, args, types);
441: }
442:
443: public Object invoke(String shortName, String methodName,
444: Object[] args, String[] types)
445: throws GBeanNotFoundException, NoSuchOperationException,
446: InternalKernelException, Exception {
447: return kernel.invoke(shortName, methodName, args, types);
448: }
449:
450: public Object invoke(Class type, String methodName, Object[] args,
451: String[] types) throws GBeanNotFoundException,
452: NoSuchOperationException, InternalKernelException,
453: Exception {
454: return kernel.invoke(type, methodName, args, types);
455: }
456:
457: public Object invoke(String shortName, Class type,
458: String methodName, Object[] args, String[] types)
459: throws GBeanNotFoundException, NoSuchOperationException,
460: InternalKernelException, Exception {
461: return kernel.invoke(shortName, type, methodName, args, types);
462: }
463:
464: public AbstractName getAbstractNameFor(Object service) {
465: return kernel.getAbstractNameFor(service);
466: }
467:
468: public String getShortNameFor(Object service) {
469: return kernel.getShortNameFor(service);
470: }
471:
472: public void boot() throws Exception {
473: kernel.boot();
474: }
475:
476: public Date getBootTime() {
477: return kernel.getBootTime();
478: }
479:
480: public void registerShutdownHook(Runnable hook) {
481: kernel.registerShutdownHook(hook);
482: }
483:
484: public void unregisterShutdownHook(Runnable hook) {
485: kernel.unregisterShutdownHook(hook);
486: }
487:
488: public void shutdown() {
489: kernel.shutdown();
490: }
491:
492: public boolean isRunning() {
493: return kernel.isRunning();
494: }
495:
496: public Set listGBeans(AbstractNameQuery refInfoQuery) {
497: return kernel.listGBeans(refInfoQuery);
498: }
499:
500: public static final GBeanInfo GBEAN_INFO;
501:
502: static {
503: GBeanInfoBuilder infoFactory = GBeanInfoBuilder
504: .createStatic(KernelGBean.class);
505: infoFactory.addInterface(Kernel.class);
506: infoFactory.addAttribute("kernel", Kernel.class, false);
507: infoFactory.setConstructor(new String[] { "kernel" });
508: GBEAN_INFO = infoFactory.getBeanInfo();
509: }
510:
511: public static GBeanInfo getGBeanInfo() {
512: return GBEAN_INFO;
513: }
514: }
|