geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r1089352 - in /geronimo/server/trunk: framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/eba/ framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ plugins/...
Date Wed, 06 Apr 2011 08:38:35 GMT
Author: rwonly
Date: Wed Apr  6 08:38:35 2011
New Revision: 1089352

URL: http://svn.apache.org/viewvc?rev=1089352&view=rev
Log:
GERONIMO-5861 changes based on Jarek's comments, thanks

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/eba/EBADeploymentManager.java
    geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
    geronimo/server/trunk/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationGBean.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/eba/EBADeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/eba/EBADeploymentManager.java?rev=1089352&r1=1089351&r2=1089352&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/eba/EBADeploymentManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/eba/EBADeploymentManager.java
Wed Apr  6 08:38:35 2011
@@ -33,7 +33,7 @@ public interface EBADeploymentManager {
     
     public String getEBAContentBundleSymbolicName(AbstractName applicationGBeanName, long
bundleId) throws GBeanNotFoundException, NoSuchOperationException, Exception;
     
-    public void updateEBAContent(AbstractName applicationGBeanName, long bundleId, File newfile)
throws GBeanNotFoundException, NoSuchOperationException, Exception;
+    public void updateEBAContent(AbstractName applicationGBeanName, long bundleId, File bundleFile)
throws GBeanNotFoundException, NoSuchOperationException, Exception;
     
     public AbstractName getApplicationGBeanName(Artifact configurationId);
     

Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java?rev=1089352&r1=1089351&r2=1089352&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
Wed Apr  6 08:38:35 2011
@@ -301,8 +301,8 @@ public abstract class ExtendedDeployment
     /**
      * Only support local bundle update
      */
-    public void updateEBAContent(AbstractName applicationGBeanName, long bundleId, File newfile)
throws GBeanNotFoundException, NoSuchOperationException, Exception{
-        kernel.invoke(applicationGBeanName, "updateApplicationContent", new Object[]{bundleId,
newfile.toURI()}, new String[]{long.class.getName(), newfile.toURI().getClass().getName()});
+    public void updateEBAContent(AbstractName applicationGBeanName, long bundleId, File bundleFile)
throws GBeanNotFoundException, NoSuchOperationException, Exception{
+        kernel.invoke(applicationGBeanName, "updateApplicationContent", new Object[]{bundleId,
bundleFile}, new String[]{long.class.getName(), bundleFile.getClass().getName()});
     }
     
     public AbstractName getApplicationGBeanName(Artifact configurationId) {

Modified: geronimo/server/trunk/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationGBean.java?rev=1089352&r1=1089351&r2=1089352&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationGBean.java
(original)
+++ geronimo/server/trunk/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationGBean.java
Wed Apr  6 08:38:35 2011
@@ -18,9 +18,7 @@ package org.apache.geronimo.aries;
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.net.URI;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -43,8 +41,8 @@ import org.apache.geronimo.gbean.annotat
 import org.apache.geronimo.gbean.annotation.ParamSpecial;
 import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.xbean.osgi.bundle.util.BundleUtils;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
@@ -135,7 +133,7 @@ public class ApplicationGBean implements
         return null;
     }
     
-    public void updateApplicationContent(long bundleId, URI uri) throws FileNotFoundException,
BundleException{
+    public void updateApplicationContent(long bundleId, File bundleFile) throws IOException,
BundleException{
         Bundle targetBundle = null;
         for (Bundle content : applicationBundles){
             if (content.getBundleId()==bundleId){
@@ -146,18 +144,23 @@ public class ApplicationGBean implements
         
         if (targetBundle!=null){
             BundleContext context = bundle.getBundleContext();
-            ServiceReference reference = context.getServiceReference(PackageAdmin.class.getName());
-            FileInputStream fi;
+            ServiceReference reference = null;
+            FileInputStream fi = null;
             try {
-                // create file object from local uri
-                fi = new FileInputStream(new File(uri));
+                fi = new FileInputStream(bundleFile);
                 // update bundle
                 targetBundle.update(fi);
                 // refresh bundle
+                reference = context.getServiceReference(PackageAdmin.class.getName());
                 PackageAdmin packageAdmin = (PackageAdmin) context.getService(reference);
                 packageAdmin.refreshPackages(new Bundle[]{targetBundle});
             } finally{
-                context.ungetService(reference);
+                if (reference!=null){
+                    context.ungetService(reference);
+                }
+                if (fi!=null){
+                    fi.close();
+                }
             }
         } else {
             throw new IllegalArgumentException("Could not find the bundle with id: " + bundleId
+ "in the Application content");



Mime
View raw message