KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > kernel > KernelGBean


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 implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.geronimo.kernel;
18
19 import java.util.Date JavaDoc;
20 import java.util.Set JavaDoc;
21 import javax.management.ObjectName JavaDoc;
22
23 import org.apache.geronimo.gbean.GBeanData;
24 import org.apache.geronimo.gbean.GBeanInfo;
25 import org.apache.geronimo.gbean.GBeanInfoBuilder;
26 import org.apache.geronimo.gbean.AbstractNameQuery;
27 import org.apache.geronimo.gbean.AbstractName;
28 import org.apache.geronimo.kernel.lifecycle.LifecycleMonitor;
29 import org.apache.geronimo.kernel.proxy.ProxyManager;
30
31 /**
32  * @version $Rev:386515 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
33  */

34 public class KernelGBean implements Kernel{
35     private final Kernel kernel;
36
37     public KernelGBean(Kernel kernel) {
38         this.kernel = kernel;
39     }
40
41     public String JavaDoc getKernelName() {
42         return kernel.getKernelName();
43     }
44
45     public Naming getNaming() {
46         return kernel.getNaming();
47     }
48
49     public DependencyManager getDependencyManager() {
50         return kernel.getDependencyManager();
51     }
52
53     public LifecycleMonitor getLifecycleMonitor() {
54         return kernel.getLifecycleMonitor();
55     }
56
57     public ProxyManager getProxyManager() {
58         return kernel.getProxyManager();
59     }
60
61     public void loadGBean(GBeanData gbeanData, ClassLoader JavaDoc classLoader) throws GBeanAlreadyExistsException, InternalKernelException {
62         kernel.loadGBean(gbeanData, classLoader);
63     }
64
65     public boolean isLoaded(AbstractName name) {
66         return kernel.isLoaded(name);
67     }
68
69     public boolean isLoaded(String JavaDoc shortName) {
70         return kernel.isLoaded(shortName);
71     }
72
73     public boolean isLoaded(Class JavaDoc type) {
74         return kernel.isLoaded(type);
75     }
76
77     public boolean isLoaded(String JavaDoc shortName, Class JavaDoc type) {
78         return kernel.isLoaded(shortName, type);
79     }
80
81     public Object JavaDoc getGBean(ObjectName JavaDoc name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
82         return kernel.getGBean(name);
83     }
84
85     public Object JavaDoc getGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
86         return kernel.getGBean(name);
87     }
88
89     public Object JavaDoc getGBean(String JavaDoc shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
90         return kernel.getGBean(shortName);
91     }
92
93     public Object JavaDoc getGBean(Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
94         return kernel.getGBean(type);
95     }
96
97     public Object JavaDoc getGBean(String JavaDoc shortName, Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
98         return kernel.getGBean(shortName, type);
99     }
100
101     public void startGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
102         kernel.startGBean(name);
103     }
104
105     public void startGBean(String JavaDoc shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
106         kernel.startGBean(shortName);
107     }
108
109     public void startGBean(Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
110         kernel.startGBean(type);
111     }
112
113     public void startGBean(String JavaDoc shortName, Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
114         kernel.startGBean(shortName, type);
115     }
116
117     public void startRecursiveGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
118         kernel.startRecursiveGBean(name);
119     }
120
121     public void startRecursiveGBean(String JavaDoc shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
122         kernel.startRecursiveGBean(shortName);
123     }
124
125     public void startRecursiveGBean(Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
126         kernel.startRecursiveGBean(type);
127     }
128
129     public void startRecursiveGBean(String JavaDoc shortName, Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
130         kernel.startRecursiveGBean(shortName, type);
131     }
132
133     public boolean isRunning(AbstractName name) {
134         return kernel.isRunning(name);
135     }
136
137     public boolean isRunning(String JavaDoc shortName) {
138         return kernel.isRunning(shortName);
139     }
140
141     public boolean isRunning(Class JavaDoc type) {
142         return kernel.isRunning(type);
143     }
144
145     public boolean isRunning(String JavaDoc shortName, Class JavaDoc type) {
146         return kernel.isRunning(shortName, type);
147     }
148
149     public void stopGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
150         kernel.stopGBean(name);
151     }
152
153     public void stopGBean(String JavaDoc shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
154         kernel.stopGBean(shortName);
155     }
156
157     public void stopGBean(Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
158         kernel.stopGBean(type);
159     }
160
161     public void stopGBean(String JavaDoc shortName, Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
162         kernel.stopGBean(shortName, type);
163     }
164
165     public void unloadGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
166         kernel.unloadGBean(name);
167     }
168
169     public void unloadGBean(String JavaDoc shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
170         kernel.unloadGBean(shortName);
171     }
172
173     public void unloadGBean(Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
174         kernel.unloadGBean(type);
175     }
176
177     public void unloadGBean(String JavaDoc shortName, Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException JavaDoc {
178         kernel.unloadGBean(shortName, type);
179     }
180
181     public int getGBeanState(ObjectName JavaDoc name) throws GBeanNotFoundException {
182         return kernel.getGBeanState(name);
183     }
184
185     public int getGBeanState(AbstractName name) throws GBeanNotFoundException {
186         return kernel.getGBeanState(name);
187     }
188
189     public int getGBeanState(String JavaDoc shortName) throws GBeanNotFoundException {
190         return kernel.getGBeanState(shortName);
191     }
192
193     public int getGBeanState(Class JavaDoc type) throws GBeanNotFoundException {
194         return kernel.getGBeanState(type);
195     }
196
197     public int getGBeanState(String JavaDoc shortName, Class JavaDoc type) throws GBeanNotFoundException {
198         return kernel.getGBeanState(shortName, type);
199     }
200
201     public long getGBeanStartTime(AbstractName name) throws GBeanNotFoundException {
202         return kernel.getGBeanStartTime(name);
203     }
204
205     public long getGBeanStartTime(String JavaDoc shortName) throws GBeanNotFoundException {
206         return kernel.getGBeanStartTime(shortName);
207     }
208
209     public long getGBeanStartTime(Class JavaDoc type) throws GBeanNotFoundException {
210         return kernel.getGBeanStartTime(type);
211     }
212
213     public long getGBeanStartTime(String JavaDoc shortName, Class JavaDoc type) throws GBeanNotFoundException {
214         return kernel.getGBeanStartTime(shortName, type);
215     }
216
217     public ClassLoader JavaDoc getClassLoaderFor(AbstractName name) throws GBeanNotFoundException {
218         return kernel.getClassLoaderFor(name);
219     }
220
221     public ClassLoader JavaDoc getClassLoaderFor(String JavaDoc shortName) throws GBeanNotFoundException {
222         return kernel.getClassLoaderFor(shortName);
223     }
224
225     public ClassLoader JavaDoc getClassLoaderFor(Class JavaDoc type) throws GBeanNotFoundException {
226         return kernel.getClassLoaderFor(type);
227     }
228
229     public ClassLoader JavaDoc getClassLoaderFor(String JavaDoc shortName, Class JavaDoc type) throws GBeanNotFoundException {
230         return kernel.getClassLoaderFor(shortName, type);
231     }
232
233     public GBeanInfo getGBeanInfo(ObjectName JavaDoc name) throws GBeanNotFoundException {
234         return kernel.getGBeanInfo(name);
235     }
236
237     public GBeanInfo getGBeanInfo(AbstractName name) throws GBeanNotFoundException {
238         return kernel.getGBeanInfo(name);
239     }
240
241     public GBeanInfo getGBeanInfo(String JavaDoc shortName) throws GBeanNotFoundException {
242         return kernel.getGBeanInfo(shortName);
243     }
244
245     public GBeanInfo getGBeanInfo(Class JavaDoc type) throws GBeanNotFoundException {
246         return kernel.getGBeanInfo(type);
247     }
248
249     public GBeanInfo getGBeanInfo(String JavaDoc shortName, Class JavaDoc type) throws GBeanNotFoundException {
250         return kernel.getGBeanInfo(shortName, type);
251     }
252
253     public GBeanData getGBeanData(AbstractName name) throws GBeanNotFoundException, InternalKernelException {
254         return kernel.getGBeanData(name);
255     }
256
257     public GBeanData getGBeanData(String JavaDoc shortName) throws GBeanNotFoundException, InternalKernelException {
258         return kernel.getGBeanData(shortName);
259     }
260
261     public GBeanData getGBeanData(Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException {
262         return kernel.getGBeanData(type);
263     }
264
265     public GBeanData getGBeanData(String JavaDoc shortName, Class JavaDoc type) throws GBeanNotFoundException, InternalKernelException {
266         return kernel.getGBeanData(shortName, type);
267     }
268
269     public Set JavaDoc listGBeans(ObjectName JavaDoc pattern) {
270         return kernel.listGBeans(pattern);
271     }
272
273     public Set JavaDoc listGBeans(Set JavaDoc patterns) {
274         return kernel.listGBeans(patterns);
275     }
276
277     public Object JavaDoc getAttribute(ObjectName JavaDoc objectName, String JavaDoc attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception JavaDoc {
278         return kernel.getAttribute(objectName, attributeName);
279     }
280
281     public Object JavaDoc getAttribute(AbstractName abstractName, String JavaDoc attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception JavaDoc {
282         return kernel.getAttribute(abstractName, attributeName);
283     }
284
285     public Object JavaDoc getAttribute(String JavaDoc shortName, String JavaDoc attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception JavaDoc {
286         return kernel.getAttribute(shortName, attributeName);
287     }
288
289     public Object JavaDoc getAttribute(Class JavaDoc type, String JavaDoc attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception JavaDoc {
290         return kernel.getAttribute(type, attributeName);
291     }
292
293     public Object JavaDoc getAttribute(String JavaDoc shortName, Class JavaDoc type, String JavaDoc attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception JavaDoc {
294         return kernel.getAttribute(shortName, type, attributeName);
295     }
296
297     public void setAttribute(AbstractName abstractName, String JavaDoc attributeName, Object JavaDoc attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception JavaDoc {
298         kernel.setAttribute(abstractName, attributeName, attributeValue);
299     }
300
301     public void setAttribute(String JavaDoc shortName, String JavaDoc attributeName, Object JavaDoc attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception JavaDoc {
302         kernel.setAttribute(shortName, attributeName, attributeValue);
303     }
304
305     public void setAttribute(Class JavaDoc type, String JavaDoc attributeName, Object JavaDoc attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception JavaDoc {
306         kernel.setAttribute(type, attributeName, attributeValue);
307     }
308
309     public void setAttribute(String JavaDoc shortName, Class JavaDoc type, String JavaDoc attributeName, Object JavaDoc attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception JavaDoc {
310         kernel.setAttribute(shortName, type, attributeName, attributeValue);
311     }
312
313     public Object JavaDoc invoke(ObjectName JavaDoc objectName, String JavaDoc methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception JavaDoc {
314         return kernel.invoke(objectName, methodName);
315     }
316
317     public Object JavaDoc invoke(AbstractName abstractName, String JavaDoc methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception JavaDoc {
318         return kernel.invoke(abstractName, methodName);
319     }
320
321     public Object JavaDoc invoke(String JavaDoc shortName, String JavaDoc methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception JavaDoc {
322         return kernel.invoke(shortName, methodName);
323     }
324
325     public Object JavaDoc invoke(Class JavaDoc type, String JavaDoc methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception JavaDoc {
326         return kernel.invoke(type, methodName);
327     }
328
329     public Object JavaDoc invoke(String JavaDoc shortName, Class JavaDoc type, String JavaDoc methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception JavaDoc {
330         return kernel.invoke(shortName, type, methodName);
331     }
332
333     public Object JavaDoc invoke(ObjectName JavaDoc objectName, String JavaDoc methodName, Object JavaDoc[] args, String JavaDoc[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception JavaDoc {
334         return kernel.invoke(objectName, methodName, args, types);
335     }
336
337     public Object JavaDoc invoke(AbstractName abstractName, String JavaDoc methodName, Object JavaDoc[] args, String JavaDoc[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception JavaDoc {
338         return kernel.invoke(abstractName, methodName, args, types);
339     }
340
341     public Object JavaDoc invoke(String JavaDoc shortName, String JavaDoc methodName, Object JavaDoc[] args, String JavaDoc[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception JavaDoc {
342         return kernel.invoke(shortName, methodName, args, types);
343     }
344
345     public Object JavaDoc invoke(Class JavaDoc type, String JavaDoc methodName, Object JavaDoc[] args, String JavaDoc[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception JavaDoc {
346         return kernel.invoke(type, methodName, args, types);
347     }
348
349     public Object JavaDoc invoke(String JavaDoc shortName, Class JavaDoc type, String JavaDoc methodName, Object JavaDoc[] args, String JavaDoc[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception JavaDoc {
350         return kernel.invoke(shortName, type, methodName, args, types);
351     }
352
353     public AbstractName getAbstractNameFor(Object JavaDoc service) {
354         return kernel.getAbstractNameFor(service);
355     }
356
357     public String JavaDoc getShortNameFor(Object JavaDoc service) {
358         return kernel.getShortNameFor(service);
359     }
360
361     public void boot() throws Exception JavaDoc {
362         kernel.boot();
363     }
364
365     public Date JavaDoc getBootTime() {
366         return kernel.getBootTime();
367     }
368
369     public void registerShutdownHook(Runnable JavaDoc hook) {
370         kernel.registerShutdownHook(hook);
371     }
372
373     public void unregisterShutdownHook(Runnable JavaDoc hook) {
374         kernel.unregisterShutdownHook(hook);
375     }
376
377     public void shutdown() {
378         kernel.shutdown();
379     }
380
381     public boolean isRunning() {
382         return kernel.isRunning();
383     }
384
385     public Set JavaDoc listGBeans(AbstractNameQuery refInfoQuery) {
386         return kernel.listGBeans(refInfoQuery);
387     }
388
389     public static final GBeanInfo GBEAN_INFO;
390
391     static {
392         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(KernelGBean.class);
393         infoFactory.addInterface(Kernel.class);
394         infoFactory.addAttribute("kernel", Kernel.class, false);
395         infoFactory.setConstructor(new String JavaDoc[]{"kernel"});
396         GBEAN_INFO = infoFactory.getBeanInfo();
397     }
398
399     public static GBeanInfo getGBeanInfo() {
400         return GBEAN_INFO;
401     }
402 }
403
Popular Tags