geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r1082079 - in /geronimo/server/trunk/plugins/console/console-base-portlets/src/main: java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java webapp/WEB-INF/view/bundlemanager/BundleManager.jsp
Date Wed, 16 Mar 2011 07:27:54 GMT
Author: rwonly
Date: Wed Mar 16 07:27:53 2011
New Revision: 1082079

URL: http://svn.apache.org/viewvc?rev=1082079&view=rev
Log:
GERONIMO-5847 add refresh bundle functionality and some importing wired improvements

Modified:
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/bundlemanager/BundleManager.jsp

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java?rev=1082079&r1=1082078&r2=1082079&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
Wed Mar 16 07:27:53 2011
@@ -81,6 +81,8 @@ public class BundleManagerPortlet extend
 
     private static final String UPDATE_OPERATION = "update";
     
+    private static final String REFRESH_OPERATION = "refresh";
+    
     private static final String UNINSTALL_OPERATION = "uninstall";
 
     private PortletRequestDispatcher helpView;
@@ -198,6 +200,11 @@ public class BundleManagerPortlet extend
                     } else if (UPDATE_OPERATION.equals(operation)) {
                         bundle.update();
                         addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg19"));
+                    } else if (REFRESH_OPERATION.equals(operation)) {
+                        ServiceReference reference = bundleContext.getServiceReference(PackageAdmin.class.getName());
+                        PackageAdmin packageAdmin = (PackageAdmin) bundle.getBundleContext().getService(reference);
+                        packageAdmin.refreshPackages(new Bundle[]{bundle});
+                        addInfoMessage(actionRequest, "bundle refreshed");
                     } else {
                         addWarningMessage(actionRequest, getLocalizedString(actionRequest,
"consolebase.warnMsg01") + action + "<br />");
                         throw new PortletException("Invalid value for changeState: " + action);
@@ -654,17 +661,20 @@ public class BundleManagerPortlet extend
         
         Set<PackageBundlePair> importingPairs = new HashSet<PackageBundlePair>();
 
-        // handle static wire via Import-Package
-        List<BundleDescription.ImportPackage> imports = description.getExternalImports();
+
+        // description.getExternalImports() only shows the packages from other bundles. This
will exclude the packages
+        // which are exported by itself, but may actually import from others during resolve.
+        List<BundleDescription.ImportPackage> imports = description.getImportPackage();
         for (BundleDescription.ImportPackage packageImport : imports) {
             //find the packages that we are importing
             ExportedPackage[] exportedPackages = packageAdmin.getExportedPackages(packageImport.getName());
             if (exportedPackages!=null){
                 for (ExportedPackage exportedPackage : exportedPackages) {
+                    Bundle exportingBundle = exportedPackage.getExportingBundle();
                     Bundle[] importingBundles = exportedPackage.getImportingBundles();
                     if (importingBundles != null) {
                         for (Bundle importingBundle : importingBundles) {
-                            if (importingBundle == bundle) {
+                            if (exportingBundle != bundle && importingBundle == bundle)
{
                                 importingPairs.add(new PackageBundlePair(exportedPackage,
exportedPackage.getExportingBundle()));
                             }
                         }
@@ -728,7 +738,6 @@ public class BundleManagerPortlet extend
         
         Set<PackageBundlePair> dynamicImportingPairs = new HashSet<PackageBundlePair>();
         
-        // handle dynamic wire via DynamicImport-Package
         if (!description.getDynamicImportPackage().isEmpty()) {
             for (Bundle b : bundle.getBundleContext().getBundles()) {
                 

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/bundlemanager/BundleManager.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/bundlemanager/BundleManager.jsp?rev=1082079&r1=1082078&r2=1082079&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/bundlemanager/BundleManager.jsp
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/bundlemanager/BundleManager.jsp
Wed Mar 16 07:27:53 2011
@@ -153,7 +153,7 @@ function uninstallPrompt(target, bundleI
             <th scope="col" width="100">Blueprint State</th>
         </c:if>
         <c:if test="${listTypeValue != 'system' && listTypeValue != 'configuration'}"
>
-            <th scope="col" width="80">Actions</th>
+            <th scope="col" width="100">Actions</th>
         </c:if>
         <th scope="col" width="100">Utilities</th>
     </tr>
@@ -236,6 +236,11 @@ function uninstallPrompt(target, bundleI
                     <span> 
                         <a href="<portlet:actionURL><portlet:param name='bundleId'
value='${bundleInfo.bundleId}'/><portlet:param name='action' value='bundle'/><portlet:param
name='operation' value='update'/></portlet:actionURL>"><img border="0" src="<%=request.getContextPath()%>/images/bundle_update.png"
title="update"/></a>&nbsp;
                     </span>
+                	
+                	<!-- Refresh action -->
+                    <span> 
+                        <a href="<portlet:actionURL><portlet:param name='bundleId'
value='${bundleInfo.bundleId}'/><portlet:param name='action' value='bundle'/><portlet:param
name='operation' value='refresh'/></portlet:actionURL>"><img border="0" src="<%=request.getContextPath()%>/images/bundle_refresh.png"
title="refresh"/></a>&nbsp;
+                    </span>
                 
                     <!-- Uninstall action -->
                     <span> 



Mime
View raw message