geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r817506 - in /geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core: GeronimoRuntimeDelegate.java operations/GeronimoAccountManager.java
Date Tue, 22 Sep 2009 06:00:18 GMT
Author: delos
Date: Tue Sep 22 06:00:18 2009
New Revision: 817506

URL: http://svn.apache.org/viewvc?rev=817506&view=rev
Log:
GERONIMODEVTOOLS-594 Geronimo server can't be deleted when it has been stopped in GEP. 

Modified:
    geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoRuntimeDelegate.java
    geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java

Modified: geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoRuntimeDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoRuntimeDelegate.java?rev=817506&r1=817505&r2=817506&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoRuntimeDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoRuntimeDelegate.java
Tue Sep 22 06:00:18 2009
@@ -26,6 +26,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.geronimo.kernel.classloader.JarFileClassLoader;
 import org.apache.geronimo.st.core.internal.Messages;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -237,15 +238,16 @@
         }
 
         if (systemjarURL != null) {
-            URLClassLoader cl = new URLClassLoader(new URL[] { systemjarURL});
-            try {
-                Class clazz = cl.loadClass("org.apache.geronimo.system.serverinfo.ServerConstants");
-                Method method = clazz.getMethod("getVersion", new Class[] {});
-                return(String) method.invoke(null, null);
-            }
-            catch (Exception e) {
-                e.printStackTrace();
-            }
+        	JarFileClassLoader loader = new JarFileClassLoader(null,new URL[]{systemjarURL},this.getClass().getClassLoader());
+			try {
+				Class clazz = loader.loadClass("org.apache.geronimo.system.serverinfo.ServerConstants");
+				Method method = clazz.getMethod("getVersion", new Class[] {});
+				String version =(String) method.invoke(null, null);
+				loader.destroy();
+				return version;
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
         }
         return null;
     }

Modified: geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java?rev=817506&r1=817505&r2=817506&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java
(original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.5/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java
Tue Sep 22 06:00:18 2009
@@ -30,8 +30,13 @@
         userProperties = new Properties();
         groupProperties= new Properties();
         try {
-          userProperties.load(new FileInputStream(new File(securityPath,userPropertiesFile)));
-          groupProperties.load(new FileInputStream(new File(securityPath,groupPropertiesFile)));
+        	FileInputStream fis = new FileInputStream(new File(securityPath,userPropertiesFile));
+            userProperties.load(fis);
+            fis.close();
+            
+            fis = new FileInputStream(new File(securityPath,groupPropertiesFile));
+            groupProperties.load(fis);
+            fis.close();
       } catch (FileNotFoundException e) {
           Trace.trace(Trace.SEVERE, e.getMessage());
           throw e;
@@ -112,8 +117,13 @@
     
     public void persist() throws Exception, IOException{
         try{
-            groupProperties.store(new FileOutputStream(new File(securityPath,groupPropertiesFile)),
"");
-            userProperties.store(new FileOutputStream(new File(securityPath,userPropertiesFile)),
"");
+        	FileOutputStream fos = new FileOutputStream(new File(securityPath,groupPropertiesFile));
+            groupProperties.store(fos, "");
+            fos.close();
+            
+            fos = new FileOutputStream(new File(securityPath,userPropertiesFile));
+            userProperties.store(fos, "");
+            fos.close();
         } catch (FileNotFoundException e) {
             Trace.trace(Trace.SEVERE, e.getMessage());
             throw e;



Mime
View raw message