djencks 2004/07/31 19:06:19
Modified: modules/kernel/src/java/org/apache/geronimo/kernel Kernel.java KernelMBean.java Log: Allow remote determination of a configuration state and remote shutdown Revision Changes Path 1.38 +17 -1 incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java Index: Kernel.java =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- Kernel.java 5 Jun 2004 20:33:40 -0000 1.37 +++ Kernel.java 1 Aug 2004 02:06:18 -0000 1.38 @@ -329,6 +329,22 @@ configurationManager.unload(configID); } + public int getConfigurationState(URI configID) throws NoSuchConfigException { + ConfigurationManager configurationManager = getConfigurationManager(); + try { + ObjectName configName = configurationManager.getConfigObjectName(configID); + return ((Integer)getAttribute(configName, "state")).intValue(); + } catch (MalformedObjectNameException e) { + throw new NoSuchConfigException(e); + } catch (InstanceNotFoundException e) { + throw new NoSuchConfigException(e); + } catch (InvalidConfigException e) { + throw (IllegalStateException) new IllegalStateException().initCause(e); + } catch (Exception e) { + throw new NoSuchConfigException(e); + } + } + /** * Boot this Kernel, triggering the instantiation of the MBeanServer and DependencyManager, * and the registration ConfigurationStore 1.14 +5 -1 incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/KernelMBean.java Index: KernelMBean.java =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/KernelMBean.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- KernelMBean.java 4 Jun 2004 17:27:00 -0000 1.13 +++ KernelMBean.java 1 Aug 2004 02:06:18 -0000 1.14 @@ -116,6 +116,8 @@ void stopConfiguration(URI configID) throws NoSuchConfigException; + int getConfigurationState(URI configId) throws NoSuchConfigException; + Object getAttribute(ObjectName objectName, String attributeName) throws Exception; void setAttribute(ObjectName objectName, String attributeName, Object attributeValue) throws Exception; @@ -136,4 +138,6 @@ void registerShutdownHook(Runnable hook); void unregisterShutdownHook(Runnable hook); + + void shutdown(); }