incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mnutt...@apache.org
Subject svn commit: r959892 - in /incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl: AriesApplicationImpl.java AriesApplicationManagerImpl.java
Date Fri, 02 Jul 2010 07:40:42 GMT
Author: mnuttall
Date: Fri Jul  2 07:40:42 2010
New Revision: 959892

URL: http://svn.apache.org/viewvc?rev=959892&view=rev
Log:
ARIES-344: BundleConverter interface returns one-use-only inputstream

Modified:
    incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationImpl.java
    incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationManagerImpl.java

Modified: incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationImpl.java?rev=959892&r1=959891&r2=959892&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationImpl.java
(original)
+++ incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationImpl.java
Fri Jul  2 07:40:42 2010
@@ -35,6 +35,7 @@ import org.apache.aries.application.Appl
 import org.apache.aries.application.Content;
 import org.apache.aries.application.DeploymentMetadata;
 import org.apache.aries.application.management.AriesApplication;
+import org.apache.aries.application.management.BundleConversion;
 import org.apache.aries.application.management.BundleInfo;
 import org.apache.aries.application.management.LocalPlatform;
 import org.apache.aries.application.utils.AppConstants;
@@ -52,7 +53,7 @@ public class AriesApplicationImpl implem
   private LocalPlatform _localPlatform;
   
   // Placeholders for information we'll need for store()
-  private Map<String, InputStream> _modifiedBundles = null;
+  private Map<String, BundleConversion> _modifiedBundles = null;
   
   public AriesApplicationImpl(ApplicationMetadata meta, Set<BundleInfo> bundleInfo,
       LocalPlatform lp) {
@@ -88,11 +89,11 @@ public class AriesApplicationImpl implem
     _deploymentMetadata = dm;
   }
 
-  public Map<String, InputStream> getModifiedBundles() {
+  public Map<String, BundleConversion> getModifiedBundles() {
     return _modifiedBundles;
   }
 
-  public void setModifiedBundles (Map<String, InputStream> modifiedBundles) {
+  public void setModifiedBundles (Map<String, BundleConversion> modifiedBundles) {
     _modifiedBundles = modifiedBundles;
   }
   
@@ -177,10 +178,10 @@ public class AriesApplicationImpl implem
 
     // Write the migrated bundles out
     if (_modifiedBundles != null) { 
-      for (Map.Entry<String, InputStream> modifiedBundle : _modifiedBundles.entrySet())
{
+      for (Map.Entry<String, BundleConversion> modifiedBundle : _modifiedBundles.entrySet())
{
         try { 
           out = IOUtils.getOutputStream(dir, modifiedBundle.getKey());
-          IOUtils.copy(modifiedBundle.getValue(), out);
+          IOUtils.copy(modifiedBundle.getValue().getInputStream(), out);
         } finally { 
           IOUtils.close(out);
         }

Modified: incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationManagerImpl.java?rev=959892&r1=959891&r2=959892&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationManagerImpl.java
(original)
+++ incubator/aries/trunk/application/application-management/src/main/java/org/apache/aries/application/management/impl/AriesApplicationManagerImpl.java
Fri Jul  2 07:40:42 2010
@@ -46,6 +46,7 @@ import org.apache.aries.application.mana
 import org.apache.aries.application.management.AriesApplicationListener;
 import org.apache.aries.application.management.AriesApplicationManager;
 import org.apache.aries.application.management.AriesApplicationResolver;
+import org.apache.aries.application.management.BundleConversion;
 import org.apache.aries.application.management.BundleConverter;
 import org.apache.aries.application.management.BundleInfo;
 import org.apache.aries.application.management.ConversionException;
@@ -61,7 +62,6 @@ import org.apache.aries.application.util
 import org.apache.aries.application.utils.manifest.BundleManifest;
 import org.apache.aries.application.utils.manifest.ManifestDefaultsInjector;
 import org.apache.aries.application.utils.manifest.ManifestProcessor;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.ServiceException;
 import org.slf4j.Logger;
@@ -110,7 +110,7 @@ public class AriesApplicationManagerImpl
   public AriesApplication createApplication(IDirectory ebaFile) throws ManagementException
{
     ApplicationMetadata applicationMetadata = null;
     DeploymentMetadata deploymentMetadata = null;
-    Map<String, InputStream> modifiedBundles = new HashMap<String, InputStream>();
+    Map<String, BundleConversion> modifiedBundles = new HashMap<String, BundleConversion>();
     AriesApplicationImpl application = null;
     
     try { 
@@ -149,7 +149,7 @@ public class AriesApplicationManagerImpl
             throw new ManagementException (MessageUtil.getMessage("APPMANAGEMENT0003E", f.getName(),
ebaFile.getName()));
           } else { 
             // We have a jar that needs converting to a bundle, or a war to migrate to a
WAB
-            InputStream convertedBinary = null;
+            BundleConversion convertedBinary = null;
             Iterator<BundleConverter> converters = _bundleConverters.iterator();
             List<ConversionException> conversionExceptions = Collections.emptyList();
             while (converters.hasNext() && convertedBinary == null) { 



Mime
View raw message