1 /** 2 * 3 * Copyright 2004 The Apache Software Foundation 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * 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; 20 import java.util.Set; 21 import javax.management.ObjectName; 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-04-24 00:27:37 -0700 (Mon, 24 Apr 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 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 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 shortName) { 70 return kernel.isLoaded(shortName); 71 } 72 73 public boolean isLoaded(Class type) { 74 return kernel.isLoaded(type); 75 } 76 77 public boolean isLoaded(String shortName, Class type) { 78 return kernel.isLoaded(shortName, type); 79 } 80 81 public Object getGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { 82 return kernel.getGBean(name); 83 } 84 85 public Object getGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { 86 return kernel.getGBean(name); 87 } 88 89 public Object getGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { 90 return kernel.getGBean(shortName); 91 } 92 93 public Object getGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { 94 return kernel.getGBean(type); 95 } 96 97 public Object getGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { 98 return kernel.getGBean(shortName, type); 99 } 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 Object invoke(AbstractName abstractName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception { 338 return kernel.invoke(abstractName, methodName, args, types); 339 } 340 341 public Object invoke(String shortName, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception { 342 return kernel.invoke(shortName, methodName, args, types); 343 } 344 345 public Object invoke(Class type, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception { 346 return kernel.invoke(type, methodName, args, types); 347 } 348 349 public Object invoke(String shortName, Class type, String methodName, Object[] args, String[] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception { 350 return kernel.invoke(shortName, type, methodName, args, types); 351 } 352 353 public AbstractName getAbstractNameFor(Object service) { 354 return kernel.getAbstractNameFor(service); 355 } 356 357 public String getShortNameFor(Object service) { 358 return kernel.getShortNameFor(service); 359 } 360 361 public void boot() throws Exception { 362 kernel.boot(); 363 } 364 365 public Date getBootTime() { 366 return kernel.getBootTime(); 367 } 368 369 public void registerShutdownHook(Runnable hook) { 370 kernel.registerShutdownHook(hook); 371 } 372 373 public void unregisterShutdownHook(Runnable 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 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[]{"kernel"}); 396 GBEAN_INFO = infoFactory.getBeanInfo(); 397 } 398 399 public static GBeanInfo getGBeanInfo() { 400 return GBEAN_INFO; 401 } 402 }