Author: taylor
Date: Fri Mar 27 23:11:51 2009
New Revision: 759387

URL: http://svn.apache.org/viewvc?rev=759387&view=rev
Log:
backport fix from 2.2 branch to PALM to fix leaving orphans on app delete, 
causing messy search results and other issues

Modified:
    
portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/applications/j2-admin/src/java/org/apache/jetspeed/portlets/palm/PortletApplicationLifecycleManager.java
    
portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java

Modified: 
portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/applications/j2-admin/src/java/org/apache/jetspeed/portlets/palm/PortletApplicationLifecycleManager.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/applications/j2-admin/src/java/org/apache/jetspeed/portlets/palm/PortletApplicationLifecycleManager.java?rev=759387&r1=759386&r2=759387&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/applications/j2-admin/src/java/org/apache/jetspeed/portlets/palm/PortletApplicationLifecycleManager.java
 (original)
+++ 
portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/applications/j2-admin/src/java/org/apache/jetspeed/portlets/palm/PortletApplicationLifecycleManager.java
 Fri Mar 27 23:11:51 2009
@@ -16,31 +16,32 @@
 */
 package org.apache.jetspeed.portlets.palm;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletRequest;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-import org.apache.jetspeed.CommonPortletServices;
-import org.apache.jetspeed.components.portletregistry.PortletRegistry;
-import org.apache.jetspeed.components.portletregistry.RegistryException;
-import org.apache.jetspeed.factory.PortletFactory;
-import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
-import 
org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManager;
-import 
org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManagerResult;
-import org.apache.portals.bridges.common.GenericServletPortlet;
-import org.apache.portals.gems.util.StatusMessage;
-import org.apache.portals.messaging.PortletMessaging;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletRequest;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.components.portletregistry.PortletRegistry;
+import org.apache.jetspeed.components.portletregistry.RegistryException;
+import org.apache.jetspeed.factory.PortletFactory;
+import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
+import org.apache.jetspeed.tools.pamanager.PortletApplicationManager;
+import 
org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManager;
+import 
org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManagerResult;
+import org.apache.portals.bridges.common.GenericServletPortlet;
+import org.apache.portals.gems.util.StatusMessage;
+import org.apache.portals.messaging.PortletMessaging;
 
 /**
  * PALM Portlet
@@ -52,7 +53,8 @@
 {
     private ApplicationServerManager asm;
     private PortletRegistry          registry;
-    private PortletFactory           portletFactory;
+    private PortletFactory           portletFactory;
+    private PortletApplicationManager pam;
     private boolean serverManagerAvailable;
     
     public void init(PortletConfig config)
@@ -62,7 +64,8 @@
         PortletContext context = getPortletContext();                
         registry = 
(PortletRegistry)context.getAttribute(CommonPortletServices.CPS_REGISTRY_COMPONENT);
         portletFactory = 
(PortletFactory)context.getAttribute(CommonPortletServices.CPS_PORTLET_FACTORY_COMPONENT);
-        asm = 
(ApplicationServerManager)context.getAttribute(CommonPortletServices.CPS_APPLICATION_SERVER_MANAGER_COMPONENT);
+        asm = 
(ApplicationServerManager)context.getAttribute(CommonPortletServices.CPS_APPLICATION_SERVER_MANAGER_COMPONENT);
+        pam = 
(PortletApplicationManager)context.getAttribute(CommonPortletServices.CPS_PORTLET_APPLICATION_MANAGER);
         if (null == registry)
         {
             throw new PortletException("Failed to find the Portlet Registry on 
portlet initialization");
@@ -70,7 +73,11 @@
         if (null == portletFactory)
         {
             throw new PortletException("Failed to find the Portlet Factory on 
portlet initialization");
-        }
+        }
+        if (null == pam)
+        {
+            throw new PortletException("Failed to find the Portlet Application 
Manager on portlet initialization");
+        }        
         serverManagerAvailable = (asm != null && asm.isConnected());
     }
            
@@ -261,7 +268,8 @@
         {
             try
             {
-                registry.removeApplication(pa);
+                pam.unregisterPortletApplication(pa.getName());
+                
             }
             catch (RegistryException e)
             {

Modified: 
portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java?rev=759387&r1=759386&r2=759387&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java
 (original)
+++ 
portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java
 Fri Mar 27 23:11:51 2009
@@ -55,4 +55,5 @@
     public final static String CPS_PORTLET_CACHE = "cps:portletContentCache";
     public final static String CPS_AUDIT_ACTIVITY = "cps:AuditActivity";
     public final static String CPS_JETSPEED_SERIALIZER_FACTORY = 
"cps:JetspeedSerializerFactory";
+    public final static String CPS_PORTLET_APPLICATION_MANAGER = "cps:PAM";    
   
 }
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to