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 */
017 package org.apache.geronimo.kernel;
018
019 import java.util.Date;
020 import java.util.Set;
021 import javax.management.ObjectName;
022
023 import org.apache.geronimo.gbean.GBeanData;
024 import org.apache.geronimo.gbean.GBeanInfo;
025 import org.apache.geronimo.gbean.GBeanInfoBuilder;
026 import org.apache.geronimo.gbean.AbstractNameQuery;
027 import org.apache.geronimo.gbean.AbstractName;
028 import org.apache.geronimo.kernel.lifecycle.LifecycleMonitor;
029 import org.apache.geronimo.kernel.proxy.ProxyManager;
030
031 /**
032 * @version $Rev:386515 $ $Date: 2007-02-10 21:00:20 -0500 (Sat, 10 Feb 2007) $
033 */
034 public class KernelGBean implements Kernel{
035 private final Kernel kernel;
036
037 public KernelGBean(Kernel kernel) {
038 this.kernel = kernel;
039 }
040
041 public String getKernelName() {
042 return kernel.getKernelName();
043 }
044
045 public Naming getNaming() {
046 return kernel.getNaming();
047 }
048
049 public DependencyManager getDependencyManager() {
050 return kernel.getDependencyManager();
051 }
052
053 public LifecycleMonitor getLifecycleMonitor() {
054 return kernel.getLifecycleMonitor();
055 }
056
057 public ProxyManager getProxyManager() {
058 return kernel.getProxyManager();
059 }
060
061 public void loadGBean(GBeanData gbeanData, ClassLoader classLoader) 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) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
082 return kernel.getGBean(name);
083 }
084
085 public Object getGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
086 return kernel.getGBean(name);
087 }
088
089 public Object getGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
090 return kernel.getGBean(shortName);
091 }
092
093 public Object getGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
094 return kernel.getGBean(type);
095 }
096
097 public Object getGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
098 return kernel.getGBean(shortName, type);
099 }
100
101 public void startGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
102 kernel.startGBean(name);
103 }
104
105 public void startGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
106 kernel.startGBean(shortName);
107 }
108
109 public void startGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
110 kernel.startGBean(type);
111 }
112
113 public void startGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
114 kernel.startGBean(shortName, type);
115 }
116
117 public void startRecursiveGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
118 kernel.startRecursiveGBean(name);
119 }
120
121 public void startRecursiveGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
122 kernel.startRecursiveGBean(shortName);
123 }
124
125 public void startRecursiveGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
126 kernel.startRecursiveGBean(type);
127 }
128
129 public void startRecursiveGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
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 shortName) {
138 return kernel.isRunning(shortName);
139 }
140
141 public boolean isRunning(Class type) {
142 return kernel.isRunning(type);
143 }
144
145 public boolean isRunning(String shortName, Class type) {
146 return kernel.isRunning(shortName, type);
147 }
148
149 public void stopGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
150 kernel.stopGBean(name);
151 }
152
153 public void stopGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
154 kernel.stopGBean(shortName);
155 }
156
157 public void stopGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
158 kernel.stopGBean(type);
159 }
160
161 public void stopGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
162 kernel.stopGBean(shortName, type);
163 }
164
165 public void unloadGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
166 kernel.unloadGBean(name);
167 }
168
169 public void unloadGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
170 kernel.unloadGBean(shortName);
171 }
172
173 public void unloadGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
174 kernel.unloadGBean(type);
175 }
176
177 public void unloadGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
178 kernel.unloadGBean(shortName, type);
179 }
180
181 public int getGBeanState(ObjectName 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 shortName) throws GBeanNotFoundException {
190 return kernel.getGBeanState(shortName);
191 }
192
193 public int getGBeanState(Class type) throws GBeanNotFoundException {
194 return kernel.getGBeanState(type);
195 }
196
197 public int getGBeanState(String shortName, Class 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 shortName) throws GBeanNotFoundException {
206 return kernel.getGBeanStartTime(shortName);
207 }
208
209 public long getGBeanStartTime(Class type) throws GBeanNotFoundException {
210 return kernel.getGBeanStartTime(type);
211 }
212
213 public long getGBeanStartTime(String shortName, Class type) throws GBeanNotFoundException {
214 return kernel.getGBeanStartTime(shortName, type);
215 }
216
217 public ClassLoader getClassLoaderFor(AbstractName name) throws GBeanNotFoundException {
218 return kernel.getClassLoaderFor(name);
219 }
220
221 public ClassLoader getClassLoaderFor(String shortName) throws GBeanNotFoundException {
222 return kernel.getClassLoaderFor(shortName);
223 }
224
225 public ClassLoader getClassLoaderFor(Class type) throws GBeanNotFoundException {
226 return kernel.getClassLoaderFor(type);
227 }
228
229 public ClassLoader getClassLoaderFor(String shortName, Class type) throws GBeanNotFoundException {
230 return kernel.getClassLoaderFor(shortName, type);
231 }
232
233 public GBeanInfo getGBeanInfo(ObjectName 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 shortName) throws GBeanNotFoundException {
242 return kernel.getGBeanInfo(shortName);
243 }
244
245 public GBeanInfo getGBeanInfo(Class type) throws GBeanNotFoundException {
246 return kernel.getGBeanInfo(type);
247 }
248
249 public GBeanInfo getGBeanInfo(String shortName, Class 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 shortName) throws GBeanNotFoundException, InternalKernelException {
258 return kernel.getGBeanData(shortName);
259 }
260
261 public GBeanData getGBeanData(Class type) throws GBeanNotFoundException, InternalKernelException {
262 return kernel.getGBeanData(type);
263 }
264
265 public GBeanData getGBeanData(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException {
266 return kernel.getGBeanData(shortName, type);
267 }
268
269 public Set listGBeans(ObjectName pattern) {
270 return kernel.listGBeans(pattern);
271 }
272
273 public Set listGBeans(Set patterns) {
274 return kernel.listGBeans(patterns);
275 }
276
277 public Object getAttribute(ObjectName objectName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
278 return kernel.getAttribute(objectName, attributeName);
279 }
280
281 public Object getAttribute(AbstractName abstractName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
282 return kernel.getAttribute(abstractName, attributeName);
283 }
284
285 public Object getAttribute(String shortName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
286 return kernel.getAttribute(shortName, attributeName);
287 }
288
289 public Object getAttribute(Class type, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
290 return kernel.getAttribute(type, attributeName);
291 }
292
293 public Object getAttribute(String shortName, Class type, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
294 return kernel.getAttribute(shortName, type, attributeName);
295 }
296
297 public void setAttribute(AbstractName abstractName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
298 kernel.setAttribute(abstractName, attributeName, attributeValue);
299 }
300
301 public void setAttribute(String shortName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
302 kernel.setAttribute(shortName, attributeName, attributeValue);
303 }
304
305 public void setAttribute(Class type, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
306 kernel.setAttribute(type, attributeName, attributeValue);
307 }
308
309 public void setAttribute(String shortName, Class type, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
310 kernel.setAttribute(shortName, type, attributeName, attributeValue);
311 }
312
313 public Object invoke(ObjectName objectName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception {
314 return kernel.invoke(objectName, methodName);
315 }
316
317 public Object invoke(AbstractName abstractName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception {
318 return kernel.invoke(abstractName, methodName);
319 }
320
321 public Object invoke(String shortName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception {
322 return kernel.invoke(shortName, methodName);
323 }
324
325 public Object invoke(Class type, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception {
326 return kernel.invoke(type, methodName);
327 }
328
329 public Object invoke(String shortName, Class type, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception {
330 return kernel.invoke(shortName, type, methodName);
331 }
332
333 public Object invoke(ObjectName objectName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception {
334 return kernel.invoke(objectName, methodName, args, types);
335 }
336
337 public String getStateReason(AbstractName abstractName) {
338 return kernel.getStateReason(abstractName);
339 }
340
341 public Object invoke(AbstractName abstractName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception {
342 return kernel.invoke(abstractName, methodName, args, types);
343 }
344
345 public Object invoke(String shortName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception {
346 return kernel.invoke(shortName, methodName, args, types);
347 }
348
349 public Object invoke(Class type, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception {
350 return kernel.invoke(type, methodName, args, types);
351 }
352
353 public Object invoke(String shortName, Class type, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception {
354 return kernel.invoke(shortName, type, methodName, args, types);
355 }
356
357 public AbstractName getAbstractNameFor(Object service) {
358 return kernel.getAbstractNameFor(service);
359 }
360
361 public String getShortNameFor(Object service) {
362 return kernel.getShortNameFor(service);
363 }
364
365 public void boot() throws Exception {
366 kernel.boot();
367 }
368
369 public Date getBootTime() {
370 return kernel.getBootTime();
371 }
372
373 public void registerShutdownHook(Runnable hook) {
374 kernel.registerShutdownHook(hook);
375 }
376
377 public void unregisterShutdownHook(Runnable hook) {
378 kernel.unregisterShutdownHook(hook);
379 }
380
381 public void shutdown() {
382 kernel.shutdown();
383 }
384
385 public boolean isRunning() {
386 return kernel.isRunning();
387 }
388
389 public Set listGBeans(AbstractNameQuery refInfoQuery) {
390 return kernel.listGBeans(refInfoQuery);
391 }
392
393 public static final GBeanInfo GBEAN_INFO;
394
395 static {
396 GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(KernelGBean.class);
397 infoFactory.addInterface(Kernel.class);
398 infoFactory.addAttribute("kernel", Kernel.class, false);
399 infoFactory.setConstructor(new String[]{"kernel"});
400 GBEAN_INFO = infoFactory.getBeanInfo();
401 }
402
403 public static GBeanInfo getGBeanInfo() {
404 return GBEAN_INFO;
405 }
406 }