geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r915557 - in /geronimo/server/trunk/framework/modules: geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
Date Tue, 23 Feb 2010 22:26:53 GMT
Author: gawor
Date: Tue Feb 23 22:26:52 2010
New Revision: 915557

URL: http://svn.apache.org/viewvc?rev=915557&view=rev
Log:
use the environment to create manifest for the temporary bundle

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=915557&r1=915556&r2=915557&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
Tue Feb 23 22:26:52 2010
@@ -220,7 +220,7 @@
             dependenciees.add(DependencyType.newDependencyType(dependency));
         }
         pluginType.getPluginArtifact().add(instance);
-        File metaInf = new File(baseDir, "META-INF");
+        File metaInf = new File(getConfigurationDir(), "META-INF");
         metaInf.mkdirs();
         OutputStream out = new FileOutputStream(new File(metaInf, "geronimo-plugin.xml"));
         try {
@@ -231,17 +231,20 @@
     }
 
     private void createTempManifest() throws DeploymentException, IOException {
-        Manifest manifest = new Manifest();
+        Environment env = new Environment(environment);        
+        Artifact id = env.getConfigId();
+        env.setConfigId(new Artifact(id.getGroupId(), id.getArtifactId() + "-DEPLOYMENT",
id.getVersion(), id.getType()));
+        env.addToBundleClassPath(classPath);
+        env.setBundleActivator(null);
+        
+        Manifest manifest;
         try {
-            manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_MANIFESTVERSION,
"2"));
-            manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_SYMBOLICNAME,
getBundleSymbolicName()));
-            manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_VERSION,
"0.0.0.0"));
-            manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_CLASSPATH,
getBundleClassPath()));
-            manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.DYNAMICIMPORT_PACKAGE,
"*"));
+            manifest = env.getManifest();
         } catch (ManifestException e) {
             throw new DeploymentException(e);
         }
-        File metaInf = new File(baseDir, "META-INF");
+        
+        File metaInf = new File(getConfigurationDir(), "META-INF");
         metaInf.mkdirs();
         FileWriter fw = new FileWriter(new File(metaInf, "MANIFEST.MF"));
         PrintWriter pw = new PrintWriter(fw);
@@ -253,24 +256,10 @@
         }
     }
 
-    private String getBundleClassPath() {
-        if (classPath.isEmpty()) {
-            return ".";
-        }
-        StringBuilder buf = new StringBuilder();
-        String sep = "";
-        for (String path: classPath) {
-            buf.append(sep).append(path);
-            sep = ",";
-        }
-        return buf.toString();
-    }
-
-    private String getBundleSymbolicName() {
-        Artifact id = environment.getConfigId();
-        return id.getGroupId() + "." + id.getArtifactId() + "-DEPLOYMENT";
+    private File getConfigurationDir() {
+        return (inPlaceConfigurationDir == null) ? baseDir : inPlaceConfigurationDir;   
    
     }
-
+    
     public ConfigurationManager getConfigurationManager() {
         return configurationManager;
     }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java?rev=915557&r1=915556&r2=915557&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
Tue Feb 23 22:26:52 2010
@@ -184,7 +184,6 @@
 
         if (bundleActivator != null) {
             manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_ACTIVATOR,
bundleActivator));
-//            imports.add("org.apache.geronimo.system.osgi");
         }
 
         if (!imports.isEmpty()) {



Mime
View raw message