1 17 package org.apache.geronimo.kernel; 18 19 import java.util.Date ; 20 import java.util.Set ; 21 import java.util.Collections ; 22 import javax.management.ObjectName ; 23 24 import org.apache.geronimo.gbean.GBeanData; 25 import org.apache.geronimo.gbean.GBeanInfo; 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 import org.apache.geronimo.kernel.repository.Artifact; 31 32 35 public interface Kernel { 36 39 ObjectName KERNEL = ObjectNameUtil.getObjectName(":role=Kernel"); 40 AbstractName KERNEL_NAME = new AbstractName(new Artifact("geronimo", "boot", "none", "car"), Collections.singletonMap("role", "kernel"), KERNEL); 41 42 47 String getKernelName(); 48 49 53 Naming getNaming(); 54 55 59 DependencyManager getDependencyManager(); 60 61 65 LifecycleMonitor getLifecycleMonitor(); 66 67 71 ProxyManager getProxyManager(); 72 73 82 void loadGBean(GBeanData gbeanData, ClassLoader classLoader) throws GBeanAlreadyExistsException, InternalKernelException; 83 84 89 boolean isLoaded(AbstractName name); 90 boolean isLoaded(String shortName); 91 boolean isLoaded(Class type); 92 boolean isLoaded(String shortName, Class type); 93 94 102 Object getGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 103 Object getGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 104 Object getGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 105 Object getGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 106 107 115 void startGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 116 void startGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 117 void startGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 118 void startGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 119 120 128 void startRecursiveGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 129 void startRecursiveGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 130 void startRecursiveGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 131 void startRecursiveGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 132 133 138 boolean isRunning(AbstractName name); 139 boolean isRunning(String shortName); 140 boolean isRunning(Class type); 141 boolean isRunning(String shortName, Class type); 142 143 151 void stopGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 152 void stopGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 153 void stopGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 154 void stopGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 155 156 164 void unloadGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 165 void unloadGBean(String shortName) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 166 void unloadGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 167 void unloadGBean(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 168 169 175 int getGBeanState(AbstractName name) throws GBeanNotFoundException; 176 int getGBeanState(String shortName) throws GBeanNotFoundException; 177 int getGBeanState(Class type) throws GBeanNotFoundException; 178 int getGBeanState(String shortName, Class type) throws GBeanNotFoundException; 179 180 186 long getGBeanStartTime(AbstractName name) throws GBeanNotFoundException; 187 long getGBeanStartTime(String shortName) throws GBeanNotFoundException; 188 long getGBeanStartTime(Class type) throws GBeanNotFoundException; 189 long getGBeanStartTime(String shortName, Class type) throws GBeanNotFoundException; 190 191 197 ClassLoader getClassLoaderFor(AbstractName name) throws GBeanNotFoundException; 198 ClassLoader getClassLoaderFor(String shortName) throws GBeanNotFoundException; 199 ClassLoader getClassLoaderFor(Class type) throws GBeanNotFoundException; 200 ClassLoader getClassLoaderFor(String shortName, Class type) throws GBeanNotFoundException; 201 202 208 GBeanInfo getGBeanInfo(AbstractName name) throws GBeanNotFoundException; 209 GBeanInfo getGBeanInfo(String shortName) throws GBeanNotFoundException; 210 GBeanInfo getGBeanInfo(Class type) throws GBeanNotFoundException; 211 GBeanInfo getGBeanInfo(String shortName, Class type) throws GBeanNotFoundException; 212 213 219 GBeanData getGBeanData(AbstractName name) throws GBeanNotFoundException, InternalKernelException; 220 GBeanData getGBeanData(String shortName) throws GBeanNotFoundException, InternalKernelException; 221 GBeanData getGBeanData(Class type) throws GBeanNotFoundException, InternalKernelException; 222 GBeanData getGBeanData(String shortName, Class type) throws GBeanNotFoundException, InternalKernelException; 223 224 229 Set listGBeans(AbstractNameQuery abstractNameQuery); 230 231 236 Set listGBeans(Set abstractNameQueries); 237 238 247 Object getAttribute(AbstractName name, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception ; 248 Object getAttribute(String shortName, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception ; 249 Object getAttribute(Class type, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception ; 250 Object getAttribute(String shortName, Class type, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception ; 251 252 261 void setAttribute(AbstractName name, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception ; 262 void setAttribute(String shortName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception ; 263 void setAttribute(Class type, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception ; 264 void setAttribute(String shortName, Class type, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception ; 265 266 276 Object invoke(AbstractName name, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception ; 277 Object invoke(String shortName, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception ; 278 Object invoke(Class type, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception ; 279 Object invoke(String shortName, Class type, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception ; 280 281 293 Object invoke(AbstractName name, String methodName, Object [] args, String [] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception ; 294 Object invoke(String shortName, String methodName, Object [] args, String [] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception ; 295 Object invoke(Class type, String methodName, Object [] args, String [] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception ; 296 Object invoke(String shortName, Class type, String methodName, Object [] args, String [] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception ; 297 298 303 AbstractName getAbstractNameFor(Object service); 304 305 309 String getShortNameFor(Object service); 310 311 315 void boot() throws Exception ; 316 317 321 Date getBootTime(); 322 323 327 void registerShutdownHook(Runnable hook); 328 329 333 void unregisterShutdownHook(Runnable hook); 334 335 338 void shutdown(); 339 340 344 boolean isRunning(); 345 346 349 Object getGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException ; 350 353 int getGBeanState(ObjectName name) throws GBeanNotFoundException; 354 357 GBeanInfo getGBeanInfo(ObjectName name) throws GBeanNotFoundException; 358 363 Set listGBeans(ObjectName pattern); 364 367 Object getAttribute(ObjectName name, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception ; 368 371 Object invoke(ObjectName name, String methodName) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception ; 372 375 Object invoke(ObjectName name, String methodName, Object [] args, String [] types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception ; 376 } 377 | Popular Tags |