geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1155989 - /geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
Date Wed, 10 Aug 2011 01:26:59 GMT
Author: gawor
Date: Wed Aug 10 01:26:59 2011
New Revision: 1155989

URL: http://svn.apache.org/viewvc?rev=1155989&view=rev
Log:
GERONIMODEVTOOLS-765: Expose a method for getting a state of a single module

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java?rev=1155989&r1=1155988&r2=1155989&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
Wed Aug 10 01:26:59 2011
@@ -38,6 +38,7 @@ import org.apache.geronimo.kernel.NoSuch
 import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.NoSuchStoreException;
+import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Dependency;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
@@ -349,4 +350,38 @@ public abstract class ExtendedDeployment
             kernel.getProxyManager().destroyProxy(recorder);
         }
     }
+    
+    public State getModulesState(Artifact moduleID) {
+        if (kernel == null) {
+            throw new IllegalStateException("Disconnected");
+        }
+        return getState(moduleID);
+    }
+    
+    public State[] getModulesState(Artifact[] moduleIDList) {
+        if (kernel == null) {
+            throw new IllegalStateException("Disconnected");
+        }
+        if (moduleIDList == null) {
+            return null; 
+        }        
+        State[] states = new State[moduleIDList.length];
+        for (int i = 0; i < moduleIDList.length; i++) {
+            Artifact moduleID = moduleIDList[i];
+            states[i] = getState(moduleID);
+        }
+        return states;
+    }
+    
+    private State getState(Artifact moduleID) {
+        if (moduleID != null && configurationManager.isInstalled(moduleID)) {   

+            if (configurationManager.isRunning(moduleID)) {
+                return State.RUNNING;
+            } else {
+                return State.STOPPED;
+            }
+        } else {
+            return null;
+        }
+    }
 }



Mime
View raw message