geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanhongf...@apache.org
Subject svn commit: r1161034 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core: META-INF/ src/main/java/org/apache/geronimo/st/v30/core/ src/main/java/org/apache/geronimo/st/v30/core/base/ src/main/java/org/apache/geronimo/st...
Date Wed, 24 Aug 2011 10:05:14 GMT
Author: hanhongfang
Date: Wed Aug 24 10:05:12 2011
New Revision: 1161034

URL: http://svn.apache.org/viewvc?rev=1161034&view=rev
Log:
GERONIMODEVTOOLS-759 Using the new APIs to manage the bundles status both in GEP and Server side. Thanks Yi Xiao for the patch.

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Artifact.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Bundle.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/ModuleSet.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/PersistenceManager.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/PersistenceManagerFactory.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/impl/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/impl/FilePersistenceManagerFactory.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/impl/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/impl/FilePersistenceManager.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/Utils.java   (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/AbstractModuleHandler.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DefaultModuleHandler.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/ModuleArtifactMapper.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/AriesHelper.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/OSGiModuleHandler.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/OsgiConstants.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF?rev=1161034&r1=1161033&r2=1161034&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF Wed Aug 24 10:05:12 2011
@@ -40,10 +40,12 @@ Require-Bundle: 
 Bundle-ActivationPolicy: lazy
 Export-Package: 
  org.apache.geronimo.st.v30.core,
+ org.apache.geronimo.st.v30.core.base,
  org.apache.geronimo.st.v30.core.commands,
  org.apache.geronimo.st.v30.core.descriptor,
  org.apache.geronimo.st.v30.core.facets,
  org.apache.geronimo.st.v30.core.internal,
  org.apache.geronimo.st.v30.core.jaxb,
- org.apache.geronimo.st.v30.core.operations
+ org.apache.geronimo.st.v30.core.operations,
+ org.apache.geronimo.st.v30.core.osgi
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/AbstractModuleHandler.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/AbstractModuleHandler.java?rev=1161034&r1=1161033&r2=1161034&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/AbstractModuleHandler.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/AbstractModuleHandler.java Wed Aug 24 10:05:12 2011
@@ -19,7 +19,6 @@ package org.apache.geronimo.st.v30.core;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
 import org.eclipse.wst.server.core.IModule;
 import org.eclipse.wst.server.core.IServer;
 
@@ -51,9 +50,7 @@ public abstract class AbstractModuleHand
     }
     
     protected void doFail(IStatus status, String message) throws CoreException {
-        MultiStatus ms = new MultiStatus(Activator.PLUGIN_ID, 0, message, null);
-        ms.addAll(status);
-        throw new CoreException(ms);
+        throw new CoreException(status);
     }
     
     public void setModuleState(IModule[] module, int state) {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DefaultModuleHandler.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DefaultModuleHandler.java?rev=1161034&r1=1161033&r2=1161034&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DefaultModuleHandler.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DefaultModuleHandler.java Wed Aug 24 10:05:12 2011
@@ -17,14 +17,14 @@
 package org.apache.geronimo.st.v30.core;
 
 import java.util.Arrays;
-import java.util.Map;
 
 import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.TargetModuleID;
 
 import org.apache.geronimo.deployment.plugin.jmx.ExtendedDeploymentManager;
 import org.apache.geronimo.kernel.management.State;
-import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.st.v30.core.base.Artifact;
+import org.apache.geronimo.st.v30.core.base.ModuleSet;
 import org.apache.geronimo.st.v30.core.commands.DeploymentCmdStatus;
 import org.apache.geronimo.st.v30.core.commands.DeploymentCommandFactory;
 import org.apache.geronimo.st.v30.core.commands.IDeploymentCommand;
@@ -56,9 +56,9 @@ public class DefaultModuleHandler extend
             IStatus status;
             TargetModuleID[] ids;
             
-            Map<String, String> artifactsMap = mapper.getServerArtifactsMap(getServer());
-            if (artifactsMap != null) {
-                synchronized (artifactsMap) {
+            ModuleSet<Artifact> artifacts = mapper.getServerArtifacts(getServer());
+            if (artifacts != null) {
+                synchronized (artifacts) {
                     status = distribute(module, monitor);
                     if (!status.isOK()) {
                         doFail(status, Messages.DISTRIBUTE_FAIL);
@@ -141,9 +141,9 @@ public class DefaultModuleHandler extend
     public void doRemoved(IModule module, IProgressMonitor monitor) throws Exception {
         Trace.tracePoint("Entry", Activator.traceCore, "DefaultModuleHandler.doRemoved", module.getName());
 
-        Map<String, String> artifactsMap = mapper.getServerArtifactsMap(getServer());
-        if (artifactsMap != null) {
-            synchronized (artifactsMap) {
+        ModuleSet<Artifact> artifacts = mapper.getServerArtifacts(getServer());
+        if (artifacts != null) {
+            synchronized (artifacts) {
                 try {
                     _doRemove(module, monitor);
                 } finally {
@@ -262,7 +262,7 @@ public class DefaultModuleHandler extend
         int moduleState = IServer.STATE_UNKNOWN;
         if (configID != null) {
             try {
-                State state = dm.getModulesState(Artifact.create(configID));
+                State state = dm.getModulesState(org.apache.geronimo.kernel.repository.Artifact.create(configID));
                 if (state == null) {
                     moduleState = -1;
                 } else if (state == State.RUNNING) {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java?rev=1161034&r1=1161033&r2=1161034&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java Wed Aug 24 10:05:12 2011
@@ -1596,4 +1596,9 @@ public class GeronimoServerBehaviourDele
         }
         return null;
     }
+
+    public OSGiModuleHandler getOsgiModuleHandler() {
+        return osgiModuleHandler;
+    }
+    
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/ModuleArtifactMapper.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/ModuleArtifactMapper.java?rev=1161034&r1=1161033&r2=1161034&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/ModuleArtifactMapper.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/ModuleArtifactMapper.java Wed Aug 24 10:05:12 2011
@@ -16,42 +16,51 @@
  */
 package org.apache.geronimo.st.v30.core;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
 import java.util.HashMap;
 import java.util.Map;
-import org.eclipse.core.runtime.IPath;
+
+import org.apache.geronimo.st.v30.core.base.Artifact;
+import org.apache.geronimo.st.v30.core.base.Bundle;
+import org.apache.geronimo.st.v30.core.base.ModuleSet;
+import org.apache.geronimo.st.v30.core.internal.Trace;
+import org.apache.geronimo.st.v30.core.osgi.AriesHelper;
+import org.apache.geronimo.st.v30.core.persist.PersistenceManager;
+import org.apache.geronimo.st.v30.core.persist.factory.PersistenceManagerFactory;
+import org.apache.geronimo.st.v30.core.persist.factory.impl.FilePersistenceManagerFactory;
 import org.eclipse.wst.server.core.IModule;
 import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
 import org.eclipse.wst.server.core.util.SocketUtil;
+import org.osgi.framework.Version;
 
 
 /**
  * @version $Rev$ $Date$
  */
 public class ModuleArtifactMapper {
-
+    private static PersistenceManagerFactory<File, File> factory = FilePersistenceManagerFactory.getInstance();
     private static ModuleArtifactMapper instance = new ModuleArtifactMapper();
+    private static final String ARTIFACT_FILE_NAME = "serverArtifacts.info";   
+    private static final String BUNDLE_FILE_NAME = "serverBundles.info";
     
-    private static final String FILE_NAME = "servermodule.info";    
-    
-    private ServerEntries serverArtifactEntries = null;    
+    private Map<File, ModuleSet<Artifact>> serverArtifacts = null;
+    private Map<File, ModuleSet<Bundle>> serverBundles = null;
+    private PersistenceManager<File, File> persistenceMgr;
     
     private ModuleArtifactMapper() {
-        if (serverArtifactEntries == null) {
-            serverArtifactEntries = new ServerEntries();
+        try {
+            if(this.serverArtifacts == null) this.serverArtifacts = new HashMap<File, ModuleSet<Artifact>>();
+            if(this.serverBundles == null) this.serverBundles = new HashMap<File, ModuleSet<Bundle>>();
+            if(this.persistenceMgr == null) {
+                if(factory == null) factory = FilePersistenceManagerFactory.getInstance();
+                this.persistenceMgr = factory.create(ARTIFACT_FILE_NAME, ARTIFACT_FILE_NAME);
+            }
+    
+            load();
+        } catch(Exception e) {
+            Trace.trace(Trace.ERROR, e.getMessage(), e, Activator.logCore);
         }
-        load();
     }
 
     public static ModuleArtifactMapper getInstance() {
@@ -67,176 +76,153 @@ public class ModuleArtifactMapper {
     }
     
     synchronized public void addArtifactEntry(IServer server, IModule module, String configId) {
-        Map<String, String> artifactEntries = getServerArtifactsMap(server);
-        if (artifactEntries != null) {
-            artifactEntries.put(getId(module), configId); 
+        ModuleSet<Artifact> artifacts = getServerArtifacts(server);
+        if (artifacts != null) {
+            artifacts.add(new Artifact(getId(module), configId)); 
         }       
     }
     
+    synchronized public void addBundleEntry(IServer server, IModule module, long bundleId, int bundleStartLevel) {
+        ModuleSet<Bundle> bundles = getServerBundles(server);
+        if(bundles != null) {
+            String symbolicName = AriesHelper.getSymbolicName(module);
+            Version version = AriesHelper.getVersion(module);
+            bundles.add(new Bundle(getId(module), symbolicName, version, bundleId, bundleStartLevel));
+        }
+    }
+    
     synchronized public void removeArtifactEntry(IServer server, IModule module) {
-        Map<String, String> artifactEntries = getServerArtifactsMap(server);
-        if (artifactEntries != null) {
-            artifactEntries.remove(getId(module)); 
+        ModuleSet<Artifact> artifacts = getServerArtifacts(server);
+        if (artifacts != null) {
+            try {
+                artifacts.remove("projectName", getId(module));
+            } catch (Exception e) {
+                Trace.trace(Trace.ERROR, e.getMessage(), e, Activator.logCore);
+            } 
         }       
     }
     
+    synchronized public void removeBundleEntry(IServer server, IModule module) {
+        ModuleSet<Bundle> bundles = getServerBundles(server);
+        if(bundles != null) {
+            try {
+                bundles.remove("projectName", getId(module));
+            } catch (Exception e) {
+                Trace.trace(Trace.ERROR, e.getMessage(), e, Activator.logCore);
+            }
+        }
+    }
+    
+    synchronized public void removeBundleEntryById(IServer server, long bundleId) {
+        if(bundleId != -1) {
+            ModuleSet<Bundle> bundles = getServerBundles(server);
+            if(bundles != null) {
+                try {
+                    bundles.remove("id", bundleId);
+                } catch (Exception e) {
+                    Trace.trace(Trace.ERROR, e.getMessage(), e, Activator.logCore);
+                }
+            }
+        }
+    }
+    
     synchronized public String resolveArtifact(IServer server, IModule module) {  
         if (module != null) {
-            Map<String, String> artifactEntries = getServerArtifactsMap(server);
-            if (artifactEntries != null) {
-                return artifactEntries.get(getId(module));
+            ModuleSet<Artifact> artifacts = getServerArtifacts(server);
+            if (artifacts != null) {
+                try {
+                    return artifacts.query("projectName", getId(module)).getConfigId();
+                } catch (Exception e) {
+                    Trace.trace(Trace.ERROR, e.getMessage(), e, Activator.logCore);
+                }
             }
         }
         return null;
      }
           
-    synchronized public Map<String, String> getServerArtifactsMap(IServer server) {
+    synchronized public Bundle resolveBundle(IServer server, IModule module) {
+        if(module != null) {
+            ModuleSet<Bundle> bundles = getServerBundles(server);
+            if(bundles != null) {
+                try {
+                    return bundles.query("projectName", getId(module));
+                } catch (Exception e) {
+                    Trace.trace(Trace.ERROR, e.getMessage(), e, Activator.logCore);
+                }
+            }
+        }
+        return null;
+    }
+    
+    synchronized public Bundle resolveBundleById(IServer server, long bundleId) {
+        if(bundleId != -1) {
+            ModuleSet<Bundle> bundles = getServerBundles(server);
+            if(bundles != null) {
+                try {
+                    return bundles.query("id", bundleId);
+                } catch (Exception e) {
+                    Trace.trace(Trace.ERROR, e.getMessage(), e, Activator.logCore);
+                }
+            }
+        }
+        return null;
+    }
+    
+    synchronized public ModuleSet<Artifact> getServerArtifacts(IServer server) {
         if (!SocketUtil.isLocalhost(server.getHost())) {
             return null;
         }            
         
-        File runtimeLoc = server.getRuntime().getLocation().toFile();  
-        Map<String, String> artifactEntries = serverArtifactEntries.get(runtimeLoc);
-        if (artifactEntries == null) {
-            artifactEntries = new HashMap<String, String>();
-            serverArtifactEntries.put(runtimeLoc, artifactEntries);
+        File runtimeLoc = server.getRuntime().getLocation().toFile();
+        ModuleSet<Artifact> artifacts = this.serverArtifacts.get(runtimeLoc);
+        if (artifacts == null) {
+            artifacts = new ModuleSet<Artifact>();
+            this.serverArtifacts.put(runtimeLoc, artifacts);
         }
         
-        return artifactEntries;        
+        return artifacts;        
     }
-
-    private void save(IServerEntries entries, String fileName) {
-        ObjectOutput output = null;
-        try {
-            IPath dest = Activator.getDefault().getStateLocation().append(fileName);
-            OutputStream fos = new FileOutputStream(dest.toFile());
-            OutputStream buffer = new BufferedOutputStream(fos);
-            output = new ObjectOutputStream(buffer);
-            String xml = entries.toXML();
-            output.writeObject(xml);
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (output != null)
-                    output.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
+    
+    synchronized public ModuleSet<Bundle> getServerBundles(IServer server) {
+        if (!SocketUtil.isLocalhost(server.getHost())) {
+            return null;
+        }            
+        
+        File runtimeLoc = server.getRuntime().getLocation().toFile();
+        ModuleSet<Bundle> bundles = this.serverBundles.get(runtimeLoc);
+        if (bundles == null) {
+            bundles = new ModuleSet<Bundle>();
+            this.serverBundles.put(runtimeLoc, bundles);
         }
+        
+        return bundles;  
     }
     
-    synchronized public void save() {
-        save(serverArtifactEntries, FILE_NAME);
+    synchronized public void save() throws Exception {
+        /* save serverArifacts in the format of object file */
+        this.persistenceMgr.setDestination(ARTIFACT_FILE_NAME);
+        this.persistenceMgr.save(this.serverArtifacts);
+        /* save serverBundles in the format of object file */
+        this.persistenceMgr.setDestination(BUNDLE_FILE_NAME);
+        this.persistenceMgr.save(this.serverBundles);
     }
-
-    private void load(IServerEntries entries, String fileName) {
-        ObjectInput input = null;
-        try {
-            IPath dest = Activator.getDefault().getStateLocation().append(fileName);
-            if (dest.toFile().exists()) {
-                InputStream file = new FileInputStream(dest.toFile());
-                InputStream buffer = new BufferedInputStream(file);
-                input = new ObjectInputStream(buffer);
-                String xml = (String) input.readObject();
-                entries.loadXML(xml);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (input != null)
-                    input.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
+    
+    synchronized public int getServerBundleDefaultStartLevel(IServer server) {
+        return this.getServerBundles(server).getDefaultModuleStartLevel();
     }
     
-    synchronized private void load() {
-        load(serverArtifactEntries, FILE_NAME);
-    }
-
-	protected interface IServerEntries {
-        public  void loadXML (String xml);
-        public String toXML ();        
-    }
-    
-    // This Inner class is the result of removing XStream.  ModuleArtifactMapper
-    // was the only class using it so it seemed silly to have two extra jar
-    // files (xpp3.jar and xstream.jar) just for one class.
-    // this class is a HashMap
-    // keys are the files
-    // entries are the Maps of artifact entries
-    // this is all saved/loaded to .plugins/org.apache.geronimo.st.v30.core/servermodule.info
-    protected class ServerEntries extends HashMap<File, Map<String, String>> implements IServerEntries{
-        static final long serialVersionUID = 0;
-
-        public void loadXML (String xml) {
-            if (xml == null || xml.length() == 0)
-                return;
-
-            String projectName, configId;
-            int fileEndPos, nomapStartPos, mapStartPos, mapEndPos, stringStartPos, stringEndPos;
-            int fileStartPos = xml.indexOf("<file>", 0);
-            Map<String, String> artifactEntries;
-            while (fileStartPos > -1) {
-                fileEndPos = xml.indexOf("</file>", fileStartPos);
-                File runtimeLoc = new File(xml.substring(fileStartPos + 6, fileEndPos));
-
-                nomapStartPos = xml.indexOf("<map/>", fileEndPos);
-                mapStartPos = xml.indexOf("<map>", fileEndPos);
-                artifactEntries = new HashMap<String, String>();
-                // have projects on the server
-                if ((nomapStartPos == -1) || (nomapStartPos > mapStartPos)) {
-                    mapEndPos = xml.indexOf("</map>", mapStartPos);
-                    stringStartPos = xml.indexOf("<string>", mapStartPos);
-                    while ((stringStartPos > -1) && (stringStartPos < mapEndPos)) {
-                        stringEndPos = xml.indexOf("</string>", stringStartPos);
-                        projectName = xml.substring(stringStartPos + 8, stringEndPos);
-                        stringStartPos = xml.indexOf("<string>", stringEndPos);
-                        stringEndPos = xml.indexOf("</string>", stringStartPos);
-                        configId = xml.substring(stringStartPos + 8, stringEndPos);
-                        artifactEntries.put(projectName, configId);
-                        stringStartPos = xml.indexOf("<string>", stringEndPos);
-                    }
-                }
-                // if no projects on the server, it is ok to put an empty HashMap
-                this.put (runtimeLoc, artifactEntries);
-
-                fileStartPos = xml.indexOf("<file>", fileEndPos);
-            }
-        }
-
-        public String toXML () {
-            String xmlString = "";
-            if (!isEmpty()) {
-                xmlString = "<map>\n  <entry>\n";
-
-                Object[] serverKeySet = keySet().toArray();
-                for (int i = 0; i < serverKeySet.length; i++) {
-                    xmlString += "    <file>" + serverKeySet[i] + "</file>\n";
-                    Map<String, String> projectMap = (Map<String, String>)get(serverKeySet[i]);
-                    if (projectMap == null || projectMap.size() == 0) {
-                        xmlString += "    <map/>\n";
-                    }
-                    else {
-                        xmlString += "    <map>\n";
-                        Object[] projectKeySet = projectMap.keySet().toArray();
-                        for (int j = 0; j < projectKeySet.length; j++)
-                        {
-                             xmlString += "      <entry>\n";
-                             xmlString += "        <string>" + projectKeySet[j] + "</string>\n";
-                             xmlString += "        <string>" + projectMap.get(projectKeySet[j]) + "</string>\n";
-                             xmlString += "      </entry>\n";
-                        }
-                        xmlString += "    </map>\n";
-                    }
-                }
-                xmlString += "  </entry>\n</map>";
-            }
-            return xmlString;
-        }
+    synchronized public void saveDefaultBundleStartLevel(IServerWorkingCopy server, int startLevel) {
+        this.serverBundles.get(server.getRuntime().getLocation().toFile()).setDefaultStartLevel(startLevel);
     }
     
+    synchronized private void load() throws Exception {
+        /* load artifacts */
+        this.persistenceMgr.setSource(ARTIFACT_FILE_NAME);
+        serverArtifacts = this.persistenceMgr.load(null, serverArtifacts);
+        /* load bundles */
+        this.persistenceMgr.setSource(BUNDLE_FILE_NAME);
+        serverBundles =  this.persistenceMgr.load(null, serverBundles);
+    }
+
+    
 }

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Artifact.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Artifact.java?rev=1161034&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Artifact.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Artifact.java Wed Aug 24 10:05:12 2011
@@ -0,0 +1,79 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.st.v30.core.base;
+
+import java.io.Serializable;
+
+
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+public class Artifact implements Serializable{
+    private static final long serialVersionUID = -648381812102706448L;
+    private String projectName;
+    private String configId;
+    public Artifact(String projectName, String configId) {
+        super();
+        this.projectName = projectName;
+        this.configId = configId;
+    }
+    public String getProjectName() {
+        return projectName;
+    }
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+    public String getConfigId() {
+        return configId;
+    }
+    public void setConfigId(String configId) {
+        this.configId = configId;
+    }
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((configId == null) ? 0 : configId.hashCode());
+        result = prime * result + ((projectName == null) ? 0 : projectName.hashCode());
+        return result;
+    }
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        Artifact other = (Artifact) obj;
+        if (configId == null) {
+            if (other.configId != null)
+                return false;
+        } else if (!configId.equals(other.configId))
+            return false;
+        if (projectName == null) {
+            if (other.projectName != null)
+                return false;
+        } else if (!projectName.equals(other.projectName))
+            return false;
+        return true;
+    }
+    
+    
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Artifact.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Artifact.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Artifact.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Bundle.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Bundle.java?rev=1161034&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Bundle.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Bundle.java Wed Aug 24 10:05:12 2011
@@ -0,0 +1,142 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.st.v30.core.base;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+import org.osgi.framework.Version;
+
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+public class Bundle implements Serializable {
+    private static final long serialVersionUID = 206202053802426677L;
+    private String projectName;
+    private String symbolicName;
+    private transient Version version;
+    private long id;
+    private int startLevel;
+    
+    
+    public Bundle(String projectName, String symbolicName, Version version, long id, int startLevel) {
+        super();
+        this.projectName = projectName;
+        this.symbolicName = symbolicName;
+        this.version = version;
+        this.id = id;
+        this.startLevel = startLevel;
+    }
+    
+    private void writeObject(ObjectOutputStream stream) throws IOException {
+        stream.defaultWriteObject();
+        stream.writeObject(version.toString());
+    }
+    
+    private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
+        stream.defaultReadObject();
+        this.version = new Version((String) stream.readObject());
+    }
+    
+    public String getProjectName() {
+        return projectName;
+    }
+
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+
+    public String getSymbolicName() {
+        return symbolicName;
+    }
+
+
+    public void setSymbolicName(String symbolicName) {
+        this.symbolicName = symbolicName;
+    }
+
+
+    public Version getVersion() {
+        return version;
+    }
+
+
+    public void setVersion(Version version) {
+        this.version = version;
+    }
+
+
+    public long getId() {
+        return id;
+    }
+
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+
+    public int getStartLevel() {
+        return startLevel;
+    }
+
+
+    public void setStartLevel(int startLevel) {
+        this.startLevel = startLevel;
+    }
+
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((symbolicName == null) ? 0 : symbolicName.hashCode());
+        result = prime * result + ((version == null) ? 0 : version.hashCode());
+        return result;
+    }
+
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        Bundle other = (Bundle) obj;
+        if (symbolicName == null) {
+            if (other.symbolicName != null)
+                return false;
+        } else if (!symbolicName.equals(other.symbolicName))
+            return false;
+        if (version == null) {
+            if (other.version != null)
+                return false;
+        } else if (!version.equals(other.version))
+            return false;
+        return true;
+    }
+
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Bundle.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Bundle.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/Bundle.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/ModuleSet.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/ModuleSet.java?rev=1161034&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/ModuleSet.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/ModuleSet.java Wed Aug 24 10:05:12 2011
@@ -0,0 +1,67 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.st.v30.core.base;
+
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.apache.geronimo.st.v30.core.osgi.OsgiConstants;
+import org.apache.geronimo.st.v30.core.util.Utils;
+
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+public class ModuleSet<E> extends HashSet<E> {
+    private static final long serialVersionUID = 6614548315200004801L;
+    protected int defaultStartLevel;
+    
+    public ModuleSet() {
+        this(OsgiConstants.BUNDLE_DEFAULT_START_LEVEL);
+    }
+    public ModuleSet(int defaultStartLevel) {
+        super();
+        this.defaultStartLevel = defaultStartLevel;
+    }
+    
+    public E query(String fieldName, Object value) throws Exception {
+        E element = null;
+        
+        Iterator<E> iter = this.iterator();
+        while(iter.hasNext()) {
+            E b = iter.next();
+            if(value.equals(Utils.getValueByFieldName(fieldName, b))) {
+                element = b;
+                break;
+            }
+        }
+        return element;
+    }
+    
+    public boolean remove(String fieldName, Object value) throws Exception {
+        return this.remove(this.query(fieldName, value));
+    }
+
+    public int getDefaultModuleStartLevel() {
+        return defaultStartLevel;
+    }
+
+    public void setDefaultStartLevel(int defaultStartLevel) {
+        this.defaultStartLevel = defaultStartLevel;
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/ModuleSet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/ModuleSet.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/base/ModuleSet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/AriesHelper.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/AriesHelper.java?rev=1161034&r1=1161033&r2=1161034&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/AriesHelper.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/AriesHelper.java Wed Aug 24 10:05:12 2011
@@ -20,7 +20,6 @@ import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 
 import org.apache.geronimo.st.v30.core.Activator;
-import org.apache.geronimo.st.v30.core.GeronimoUtils;
 import org.apache.geronimo.st.v30.core.internal.Trace;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.Platform;
@@ -89,7 +88,25 @@ public final class AriesHelper {
         }
         return null;
     }
-
+    
+    public static Version getVersion(IModule bundleModule) {
+        if (AriesHelper.isAriesInstalled()) {
+            try {
+                Class<?> ariesUtilsClass = Class.forName("com.ibm.etools.aries.internal.core.utils.AriesUtils");
+                Method method = ariesUtilsClass.getMethod("getBlueprintBundleManifest", IProject.class);
+                Object object = method.invoke(null, bundleModule.getProject());
+
+                Class<?> bundleManifest = Class.forName("com.ibm.etools.aries.core.models.BundleManifest");
+                method = bundleManifest.getMethod("getBundleVersion");
+                String versionStr = (String) method.invoke(object);
+                Version version = Version.parseVersion(versionStr);
+                return version;
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
     public static BundleInfo getBundleInfo(IProject project) throws Exception {
         if (AriesHelper.isAriesInstalled()) {
             Class<?> ariesUtilsClass = Class.forName("com.ibm.etools.aries.internal.core.utils.AriesUtils");
@@ -147,11 +164,13 @@ public final class AriesHelper {
         private final String symbolicName;
         private final Version version;
         
-        public BundleInfo(String symbolicName, Version version) {
+
+		public BundleInfo(String symbolicName, Version version) {
+            super();
             this.symbolicName = symbolicName;
             this.version = version;
         }
-        
+
         public String getSymbolicName() {
             return symbolicName;
         }
@@ -163,5 +182,6 @@ public final class AriesHelper {
         public String getMvnVersion() {
             return toMvnVersion(version);
         }
+        
     }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/OSGiModuleHandler.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/OSGiModuleHandler.java?rev=1161034&r1=1161033&r2=1161034&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/OSGiModuleHandler.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/OSGiModuleHandler.java Wed Aug 24 10:05:12 2011
@@ -19,9 +19,6 @@ package org.apache.geronimo.st.v30.core.
 import java.io.File;
 import java.io.IOException;
 import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
 
 import javax.management.MBeanException;
 import javax.management.MBeanServerConnection;
@@ -33,6 +30,8 @@ import org.apache.geronimo.st.v30.core.A
 import org.apache.geronimo.st.v30.core.DeploymentUtils;
 import org.apache.geronimo.st.v30.core.GeronimoServerBehaviourDelegate;
 import org.apache.geronimo.st.v30.core.GeronimoUtils;
+import org.apache.geronimo.st.v30.core.ModuleArtifactMapper;
+import org.apache.geronimo.st.v30.core.base.Bundle;
 import org.apache.geronimo.st.v30.core.commands.DeploymentCommandFactory;
 import org.apache.geronimo.st.v30.core.internal.Messages;
 import org.apache.geronimo.st.v30.core.internal.Trace;
@@ -44,40 +43,61 @@ import org.eclipse.wst.server.core.IModu
 import org.eclipse.wst.server.core.IServer;
 
 public class OSGiModuleHandler extends AbstractModuleHandler {
-    
-    private Map<String, Long> bundleMap;
+    private ModuleArtifactMapper mapper;
     
     public OSGiModuleHandler(GeronimoServerBehaviourDelegate serverDelegate) {
         super(serverDelegate);
-        bundleMap = Collections.synchronizedMap(new HashMap<String, Long>());
+		mapper = ModuleArtifactMapper.getInstance();
+		OsgiConstants.BUNDLE_DEFAULT_START_LEVEL = mapper.getServerBundleDefaultStartLevel(getServer());
     }
 
-    @Override
-    public void serverStopped() {
-        bundleMap.clear();
+    
+    public Bundle getBundleInfo(IModule module) throws Exception {
+    	Trace.tracePoint("Entry", Activator.traceCore, "OSGiBundleHandler.getBundleInfo", module);
+    	Bundle bundle = null;
+    	if(module != null && module.getProject() != null) {
+    	    bundle = this.mapper.resolveBundle(getServer(), module);
+    		if(bundle == null) {// find the bundle in server side
+    			RemoteDeploymentManager dm = (RemoteDeploymentManager) DeploymentCommandFactory.getDeploymentManager(this.getServer());
+    			AriesHelper.BundleInfo bInfo = AriesHelper.getBundleInfo(module.getProject());
+    			
+                long id = dm.getBundleId(bInfo.getSymbolicName(), bInfo.getVersion().toString());
+                if (id != -1) {
+                    this.mapper.addBundleEntry(getServer(), module, id, this._getBundleStartLevelFromServer(id));
+                    bundle = this.mapper.resolveBundleById(getServer(), id);
+                }
+    		}
+    	}
+    	
+    	Trace.tracePoint("Exit", Activator.traceCore, "OSGiBundleHandler.getBundleId", module);
+    	return bundle;
+    }
+    
+    public long queryBundleIdFromServer(String symbolicName, String version) throws Exception {
+        RemoteDeploymentManager dm = (RemoteDeploymentManager) DeploymentCommandFactory.getDeploymentManager(this.getServer());
+        return dm.getBundleId(symbolicName, version);
     }
     
+    
     private long getBundleId(IModule module) throws Exception {
         Trace.tracePoint("Entry", Activator.traceCore, "OSGiBundleHandler.getBundleId", module);
-        Long id = bundleMap.get(module.getId());
-        if (id == null && module.getProject() != null) {
-            RemoteDeploymentManager dm = (RemoteDeploymentManager) DeploymentCommandFactory.getDeploymentManager(this.getServer());
-            AriesHelper.BundleInfo bundleInfo = AriesHelper.getBundleInfo(module.getProject());
-            id = dm.getBundleId(bundleInfo.getSymbolicName(), bundleInfo.getVersion().toString());
-            if (id != -1) {
-                bundleMap.put(module.getId(), id);
-            }
-        }
-        Trace.tracePoint("Exit", Activator.traceCore, "OSGiBundleHandler.getBundleId", id);
-        return id;
+        Bundle bundle = this.getBundleInfo(module);
+        Trace.tracePoint("Exit", Activator.traceCore, "OSGiBundleHandler.getBundleId", module);
+        return bundle == null ? -1 : bundle.getId();
     }
     
     public void doAdded(IModule module, IProgressMonitor monitor) throws Exception {
         Trace.tracePoint("Entry", Activator.traceCore, "OSGiBundleHandler.doAdded", module.getName());
         
+        this.doAdded(module, monitor, OsgiConstants.BUNDLE_DEFAULT_START_LEVEL);
+                
+        Trace.tracePoint("Exit", Activator.traceCore, "OSGiBundleHandler.doAdded", module.getName());
+    }
+    
+    protected void doAdded(IModule module, IProgressMonitor monitor, int startLevel) throws Exception {
         long bundleId = getBundleId(module);
         if (bundleId == -1) {
-            IStatus status = distributeBundle(module);
+            IStatus status = distributeBundle(module, startLevel);
             if (!status.isOK()) {
                 doFail(status, Messages.DISTRIBUTE_FAIL);
             }
@@ -91,24 +111,23 @@ public class OSGiModuleHandler extends A
         } else {
             doChanged(module, monitor);
         }
-                
-        Trace.tracePoint("Exit", Activator.traceCore, "OSGiBundleHandler.doAdded", bundleId);
     }
     
     public void doChanged(IModule module, IProgressMonitor monitor) throws Exception {
         Trace.tracePoint("Entry", Activator.traceCore, "OSGiBundleHandler.doChanged", module.getName());
-        
-        long bundleId = getBundleId(module);
-        if (bundleId != -1) {
+        Bundle bundle = getBundleInfo(module);
+        int startLevel = OsgiConstants.BUNDLE_DEFAULT_START_LEVEL;
+        if (bundle != null) {
+        	startLevel = bundle.getStartLevel();
             doRemoved(module, monitor);
         }
         
-        doAdded(module, monitor);       
+        doAdded(module, monitor, startLevel);       
 
-        Trace.tracePoint("Exit", Activator.traceCore, "OSGiBundleHandler.doChanged", bundleId);
+        Trace.tracePoint("Exit", Activator.traceCore, "OSGiBundleHandler.doChanged", module.getName());
     }
-    
-    public void doNoChange(IModule module, IProgressMonitor monitor) throws Exception {
+
+	public void doNoChange(IModule module, IProgressMonitor monitor) throws Exception {
         Trace.tracePoint("Entry", Activator.traceCore, "OSGiBundleHandler.doNoChange", module.getName());
         
         long bundleId = getBundleId(module);
@@ -128,12 +147,11 @@ public class OSGiModuleHandler extends A
         long bundleId = getBundleId(module);
         if (bundleId != -1) {
             IStatus status = _unInstallBundle(bundleId);
-            bundleMap.remove(module.getId());
+            this.mapper.removeBundleEntry(getServer(), module);
             if (!status.isOK()) {
                 doFail(status, Messages.UNDEPLOY_FAIL);
             }
         }
-
         Trace.tracePoint("Exit ", Activator.traceCore, "OSGiBundleHandler.doRemoved", bundleId);
     }
     
@@ -177,7 +195,7 @@ public class OSGiModuleHandler extends A
         Trace.tracePoint("Exit ", Activator.traceCore, "OSGiBundleHandler.doRestartModule");
     }
         
-    private IStatus distributeBundle(IModule module) throws Exception {
+    private IStatus distributeBundle(IModule module, int startLevel) throws Exception {
         RemoteDeploymentManager rDm = (RemoteDeploymentManager)DeploymentCommandFactory.getDeploymentManager(this.getServer());
         try {
             /* Get target file */
@@ -187,9 +205,8 @@ public class OSGiModuleHandler extends A
                         Messages.bind(Messages.moduleExportError, module.getProject().getName())));     
             }
             /* end here */
-            long bundleId = rDm.recordInstall(f, null, OsgiConstants.BUNDLE_DEFAULT_START_LEVEL);
-            
-            bundleMap.put(module.getId(), bundleId);
+            long bundleId = rDm.recordInstall(f, null, startLevel);
+            this.mapper.addBundleEntry(getServer(), module, bundleId, startLevel);
             
             return Status.OK_STATUS;
         } catch (Exception e) {
@@ -239,8 +256,18 @@ public class OSGiModuleHandler extends A
             return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not stop bundle", e);
         }
     }
+    private int _getBundleStartLevelFromServer(long bundleId) {
+        try {
+            MBeanServerConnection connection = getServerConnection();
+            return (Integer) connection.invoke(getFrameworkMBean(connection), "getStartLevel",
+                    new Object[] { bundleId }, new String[] { long.class.getName() });
+        } catch(Exception e) {
+            Trace.trace(Trace.ERROR, "Error stopping bundle " + bundleId, e, Activator.logCore);
+            return OsgiConstants.BUNDLE_DEFAULT_START_LEVEL;
+        }
+    }
     
-    private String getBundleState(long bundleId) throws Exception {
+    public String getBundleState(long bundleId) throws Exception {
         MBeanServerConnection connection = getServerConnection();
         return (String) connection.invoke(getBundleStateMBean(connection), "getState",
                 new Object[] { bundleId }, new String[] { long.class.getName() });

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/OsgiConstants.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/OsgiConstants.java?rev=1161034&r1=1161033&r2=1161034&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/OsgiConstants.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/osgi/OsgiConstants.java Wed Aug 24 10:05:12 2011
@@ -25,7 +25,7 @@ public final class OsgiConstants {
     public final static String BUNDLE = "osgi.bundle"; 
     public final static String BUNDLE_EXTENSION = ".jar";
     public final static String BUNDLE_DATAMODEL_PROVIDER_ID = "osgi.bundle.datamodelprovider";
-    public final static int BUNDLE_DEFAULT_START_LEVEL = 60;
+    public static int BUNDLE_DEFAULT_START_LEVEL = 70;
     
     public final static String FRAGMENT_BUNDLE = "osgi.fragment"; 
     public final static String FRAGMENT_BUNDLE_EXTENSION = ".jar"; 

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/PersistenceManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/PersistenceManager.java?rev=1161034&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/PersistenceManager.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/PersistenceManager.java Wed Aug 24 10:05:12 2011
@@ -0,0 +1,61 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.st.v30.core.persist;
+
+
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+public interface PersistenceManager<S, D> {
+    /**
+     * Load the value by key, if find nothing, the default Value will return;
+     * @param <K>
+     * @param <V>
+     * @param key
+     * @param defaultValue
+     * @return
+     * @throws Exception
+     */
+    <K, V> V load(K key, V defaultValue) throws Exception;
+    
+    /**
+     * Load the value which is type of V by key
+     * @param <K>
+     * @param <V>
+     * @param key
+     * @param clazz
+     * @return
+     * @throws Exception
+     */
+    <K, V> V load(K key, Class<V> clazz) throws Exception;
+    /**
+     * Save the value V to the destination
+     * @param <V>
+     * @param value
+     * @throws Exception
+     */
+    <V> void save(V value) throws Exception;
+    
+    S getSource();
+    void setSource(S src);
+    void setSource(String srcPath);
+    D getDestination();
+    void setDestination(D dst);
+    void setDestination(String dstPath);
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/PersistenceManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/PersistenceManager.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/PersistenceManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/PersistenceManagerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/PersistenceManagerFactory.java?rev=1161034&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/PersistenceManagerFactory.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/PersistenceManagerFactory.java Wed Aug 24 10:05:12 2011
@@ -0,0 +1,28 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.st.v30.core.persist.factory;
+
+import org.apache.geronimo.st.v30.core.persist.PersistenceManager;
+
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+public interface PersistenceManagerFactory<S, D> {
+    PersistenceManager<S, D> create(Object... objs) throws Exception;
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/PersistenceManagerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/PersistenceManagerFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/PersistenceManagerFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/impl/FilePersistenceManagerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/impl/FilePersistenceManagerFactory.java?rev=1161034&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/impl/FilePersistenceManagerFactory.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/impl/FilePersistenceManagerFactory.java Wed Aug 24 10:05:12 2011
@@ -0,0 +1,54 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.st.v30.core.persist.factory.impl;
+
+import java.io.File;
+
+import org.apache.geronimo.st.v30.core.Activator;
+import org.apache.geronimo.st.v30.core.persist.PersistenceManager;
+import org.apache.geronimo.st.v30.core.persist.factory.PersistenceManagerFactory;
+import org.apache.geronimo.st.v30.core.persist.impl.FilePersistenceManager;
+
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+public class FilePersistenceManagerFactory implements PersistenceManagerFactory<File, File> {
+    private static PersistenceManagerFactory<File, File> instance = new FilePersistenceManagerFactory();
+    private PersistenceManager<File, File> pMgr = null;
+    
+    private FilePersistenceManagerFactory(){};
+    
+    public synchronized static PersistenceManagerFactory<File, File> getInstance() {
+        if(instance == null) instance = new FilePersistenceManagerFactory();
+        return instance;
+    }
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.st.v30.core.persist.factory.PersistenceManagerFactory#create(java.lang.Object[])
+     */
+    @Override
+    public synchronized PersistenceManager<File, File> create(Object... objs) throws Exception {
+        if(objs == null || objs.length != 2 || !(objs[0] instanceof String) || !(objs[1] instanceof String)) throw new Exception("The parameters must be two Strings");
+        
+        File src = Activator.getDefault().getStateLocation().append((String) objs[0]).toFile();
+        File dst = Activator.getDefault().getStateLocation().append((String) objs[1]).toFile();
+        if(pMgr == null) pMgr = new FilePersistenceManager(src, dst);
+        return pMgr;
+    }
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/impl/FilePersistenceManagerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/impl/FilePersistenceManagerFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/factory/impl/FilePersistenceManagerFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/impl/FilePersistenceManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/impl/FilePersistenceManager.java?rev=1161034&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/impl/FilePersistenceManager.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/impl/FilePersistenceManager.java Wed Aug 24 10:05:12 2011
@@ -0,0 +1,141 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.st.v30.core.persist.impl;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutput;
+import java.io.ObjectOutputStream;
+
+import org.apache.geronimo.st.v30.core.Activator;
+import org.apache.geronimo.st.v30.core.internal.Trace;
+import org.apache.geronimo.st.v30.core.persist.PersistenceManager;
+
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+public class FilePersistenceManager implements PersistenceManager<File, File> {
+    private File source;
+    private File destination;
+    
+    public FilePersistenceManager(File src, File dst) {
+        this.source = src;
+        this.destination = dst;
+    }
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.st.v30.core.persist.PersistenceManager#load(java.lang.Object)
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public <K, V> V load(K key, V value) throws Exception {
+        if(this.source.exists()) {
+            ObjectInput oi = null;
+            try {
+                oi = new ObjectInputStream(new BufferedInputStream(new FileInputStream(this.source)));
+                return (V) oi.readObject();
+            } catch(IOException e) {
+                Trace.trace(Trace.ERROR, e.getMessage(), e, Activator.logCore);
+            } finally {
+                if(oi != null) {
+                    oi.close();
+                    oi = null;
+                }
+            }
+        }
+        return value;
+        
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.st.v30.core.persist.PersistenceManager#load(java.lang.Object, java.lang.Class)
+     */
+    @Override
+    public <K, V> V load(K key, Class<V> clazz) throws Exception {
+        // TODO Auto-generated method stub
+        return null;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.st.v30.core.persist.PersistenceManager#save(java.lang.Object)
+     */
+    @Override
+    public <V> void save(V value) throws Exception {
+        ObjectOutput oo = null;
+        try {
+            oo = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(this.destination)));
+            oo.writeObject(value);
+        } catch(IOException e) {
+            Trace.trace(Trace.ERROR, e.getMessage(), e, Activator.logCore);
+        } finally {
+            if(oo != null) {
+                oo.flush();
+                oo.close();
+                oo = null;
+            }
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.st.v30.core.persist.PersistenceManager#getSource()
+     */
+    @Override
+    public File getSource() {
+        return this.source;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.st.v30.core.persist.PersistenceManager#setSource(java.lang.Object)
+     */
+    @Override
+    public void setSource(File src) {
+        this.source = src;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.st.v30.core.persist.PersistenceManager#getDestination()
+     */
+    @Override
+    public File getDestination() {
+        return this.destination;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.st.v30.core.persist.PersistenceManager#setDestination(java.lang.Object)
+     */
+    @Override
+    public void setDestination(File dst) {
+        this.destination = dst;
+        
+    }
+    @Override
+    public void setSource(String srcPath) {
+        this.source = Activator.getDefault().getStateLocation().append(srcPath).toFile();
+    }
+    @Override
+    public void setDestination(String dstPath) {
+        this.destination = Activator.getDefault().getStateLocation().append(dstPath).toFile();
+    }
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/impl/FilePersistenceManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/impl/FilePersistenceManager.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/persist/impl/FilePersistenceManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/Utils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/Utils.java?rev=1161034&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/Utils.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/Utils.java Wed Aug 24 10:05:12 2011
@@ -0,0 +1,33 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.st.v30.core.util;
+
+import java.lang.reflect.Field;
+
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+public class Utils {
+    public static Object getValueByFieldName(String fieldName, Object instance) throws Exception {
+        Field f = instance.getClass().getDeclaredField(fieldName);
+        f.setAccessible(true);
+        return f.get(instance);
+    } 
+    
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/Utils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/Utils.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/Utils.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message