You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by de...@apache.org on 2009/09/22 07:54:12 UTC
svn commit: r817504 - in
/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core:
GeronimoRuntimeDelegate.java operations/GeronimoAccountManager.java
Author: delos
Date: Tue Sep 22 05:54:11 2009
New Revision: 817504
URL: http://svn.apache.org/viewvc?rev=817504&view=rev
Log:
GERONIMODEVTOOLS-594 Geronimo server can't be deleted when it has been stopped in GEP.
Modified:
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoRuntimeDelegate.java
geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java
Modified: geronimo/devtools/eclipse-plugin/trunk/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/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoRuntimeDelegate.java?rev=817504&r1=817503&r2=817504&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoRuntimeDelegate.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoRuntimeDelegate.java Tue Sep 22 05:54:11 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/trunk/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/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java?rev=817504&r1=817503&r2=817504&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java Tue Sep 22 05:54:11 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;