portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/webapp/WEB-INF/assembly jetspeed-spring.xml
Date Wed, 02 Feb 2005 03:22:05 GMT
rwatler     2005/02/01 19:22:05

  Modified:    portal/src/java/org/apache/jetspeed/deployment/impl
                        DeployPortletAppEventListener.java
               portal/src/test/org/apache/jetspeed/deployment
                        TestSimpleDeployment.java
               portal/src/test/org/apache/jetspeed/engine
                        TestSpringEngine.java
               portal/src/webapp/WEB-INF/assembly jetspeed-spring.xml
  Log:
  War Infusion PAM Implementation
  
  Revision  Changes    Path
  1.21      +24 -98    jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/impl/DeployPortletAppEventListener.java
  
  Index: DeployPortletAppEventListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/impl/DeployPortletAppEventListener.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- DeployPortletAppEventListener.java	3 Dec 2004 09:37:59 -0000	1.20
  +++ DeployPortletAppEventListener.java	2 Feb 2005 03:22:05 -0000	1.21
  @@ -20,11 +20,8 @@
   import org.apache.jetspeed.deployment.DeploymentEventListener;
   import org.apache.jetspeed.deployment.DeploymentException;
   import org.apache.jetspeed.deployment.DeploymentObject;
  -import org.apache.jetspeed.factory.PortletFactory;
  -import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
   import org.apache.jetspeed.tools.pamanager.PortletApplicationManagement;
   import org.apache.jetspeed.util.DirectoryHelper;
  -import org.apache.jetspeed.util.FileSystemHelper;
   import org.apache.jetspeed.util.descriptor.PortletApplicationWar;
   import org.apache.pluto.om.portlet.PortletApplicationDefinition;
   import org.jdom.Document;
  @@ -49,8 +46,6 @@
       private PortletApplicationManagement pam;
       private Map appNameToFile;
       protected PortletRegistry registry;
  -    private PortletFactory portletFactory;
  -
   
       /**
        * 
  @@ -61,10 +56,9 @@
        *             the <code>webAppDir</code> directory does not exist.
        */
       public DeployPortletAppEventListener( String webAppDir, PortletApplicationManagement
pam,
  -            PortletRegistry registry, PortletFactory portletFactory  ) throws FileNotFoundException
  +                                          PortletRegistry registry) throws FileNotFoundException
       {
           File checkFile = new File(webAppDir);
  -        this.portletFactory = portletFactory;
   
           if (checkFile.exists())
           {
  @@ -202,95 +196,45 @@
   
               PortletApplicationWar paWar = new PortletApplicationWar(deploymentObj.getFileObject(),
id, "/" + id );
   
  -            if (registry.getPortletApplicationByIdentifier(id) != null
  -                    && !event.getEventType().equals(DeploymentEvent.EVENT_TYPE_REDEPLOY))
  +            if ((registry.getPortletApplicationByIdentifier(id) != null) &&
  +                event.getEventType().equals(DeploymentEvent.EVENT_TYPE_DEPLOY))
               {
                   log.info("Portlet application \"" + id + "\""
  -                        + " already been registered.  Skipping initial deployment.");
  -                // still need to register the filename to the app name so
  -                // undeploy works correctly
  -                appNameToFile.put(deploymentObj.getPath(), id);
  -                if (isLocal)
  -                {                
  -                    portletFactory.addClassLoader(
  -                        registry.getPortletApplicationByIdentifier(id).getId().toString(),
  -                        paWar.createClassloader(getClass().getClassLoader()));
  -                }
  -                else
  -                {
  -                    try
  -                    {
  -                        ClassLoader classloader = createPortletClassloader(getClass().getClassLoader(),
id);
  -                        if (classloader != null)
  -                        {
  -                            portletFactory.addClassLoader(
  -                                registry.getPortletApplicationByIdentifier(id).getId().toString(),
  -                                classloader);
  -                        }
  -                    }
  -                    catch (IOException e1)
  -                    {
  -                        log.info("Could not add Portlet Class Loader: " + id);
  -                    }
  -                }
  -                return;
  +                         + " already been registered.  Skipping initial deployment.");
  +                pam.register(paWar);
               }
  -
  -            log.info("Preparing to (re) deploy portlet app \"" + id + "\"");
  -
  -            if (event.getEventType().equals(DeploymentEvent.EVENT_TYPE_DEPLOY))
  +            else
               {
  -
  -                if (isLocal)
  +                log.info("Preparing to (re) deploy portlet app \"" + id + "\"");
  +                
  +                if (event.getEventType().equals(DeploymentEvent.EVENT_TYPE_DEPLOY))
                   {
  -                    log.info(fileName + " will be registered as a local portlet applicaiton.");
                   
  -                    pam.register(paWar);
  -                    MutablePortletApplication mpa = registry.getPortletApplicationByIdentifier(id);
  -                    if (mpa != null)
  +                    if (isLocal)
  +                    {
  +                        log.info(fileName + " will be registered as a local portlet application.");
                   
  +                        pam.register(paWar);
  +                    }
  +                    else
                       {
  -                        portletFactory.addClassLoader(
  -                            mpa.getId().toString(),
  -                            paWar.createClassloader(getClass().getClassLoader()));
  +                        log.info("Deploying portlet application WAR " + fileName);
  +                        pam.deploy(paWar);
                       }
                   }
  -                else
  +                else if (event.getEventType().equals(DeploymentEvent.EVENT_TYPE_REDEPLOY))
                   {
  -                    log.info("Deploying portlet applicaion WAR " + fileName);
  -                    pam.deploy(paWar);
  -                    try
  +                    if (isLocal)
                       {
  -                        ClassLoader classloader = createPortletClassloader(getClass().getClassLoader(),
id);
  -                        if (classloader != null)
  -                        {
  -                            MutablePortletApplication mpa = registry.getPortletApplicationByIdentifier(id);
  -                            if (mpa != null)
  -                            {
  -                                portletFactory.addClassLoader(mpa.getId().toString(), classloader);
  -                            }
  -                        }
  +                        //TODO: get this working                    
                       }
  -                    catch (IOException e1)
  +                    else
                       {
  -                        log.info("Could not add Portlet Class Loader: " + id);
  +                        log.info("Re-deploying portlet application WAR " + fileName);
  +                        pam.redeploy(paWar);
                       }
                   }
               }
  -            else if (event.getEventType().equals(DeploymentEvent.EVENT_TYPE_REDEPLOY))
  -            {
  -                if (isLocal)
  -                {
  -                    //TODO: get this working
  -                    
  -                }
  -                else
  -                {
  -                    log.info("Re-deploying portlet applicaion WAR " + fileName);
  -                    pam.redeploy(paWar);
  -                }
  -                
  -            }
  -
               appNameToFile.put(deploymentObj.getPath(), id);
  +
               log.info("Portlet app \"" + id + "\" " + "successfuly (re)deployed.");
           }
           catch (Exception e)
  @@ -327,22 +271,4 @@
       {
           doDeploy(event);
       }
  -    
  -    /**
  -     * <p>
  -     * createPortletClassloader
  -     * </p>
  -     * 
  -     * @param parent
  -     * @param id
  -     * @return
  -     * @throws IOException
  -     */
  -    private ClassLoader createPortletClassloader(ClassLoader parent, String id) throws
IOException
  -    {
  -        String portletAppDirectory = pam.getDeploymentPath(id);
  -        FileSystemHelper target = new DirectoryHelper(new File(portletAppDirectory));
  -        PortletApplicationWar targetWar = new PortletApplicationWar(target, id, "/" + id);
  -        return targetWar.createClassloader(parent);
  -    }
   }
  
  
  
  1.22      +4 -4      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/deployment/TestSimpleDeployment.java
  
  Index: TestSimpleDeployment.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/deployment/TestSimpleDeployment.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- TestSimpleDeployment.java	3 Dec 2004 09:37:59 -0000	1.21
  +++ TestSimpleDeployment.java	2 Feb 2005 03:22:05 -0000	1.22
  @@ -141,7 +141,7 @@
                   .getAbsolutePath());
   
           DeployPortletAppEventListener dpal = new DeployPortletAppEventListener(webAppsDir,
new FileSystemPAM(
  -                webAppsDir, portletRegistry, entityAccess, windowAccess, portletCache,
manager), portletRegistry, portletFactory );
  +                webAppsDir, portletRegistry, entityAccess, windowAccess, portletCache,
portletFactory, manager), portletRegistry );
           ArrayList eventListeners = new ArrayList(2);
           eventListeners.add(ddel);
           eventListeners.add(dpal);
  @@ -239,7 +239,7 @@
           manager = new TomcatManager("", "", 0, "", 0, "", "");
           
           DeployPortletAppEventListener dpal = new DeployPortletAppEventListener(webAppsDir,
new FileSystemPAM(
  -                webAppsDir, portletRegistry, entityAccess, windowAccess, portletCache,
manager), portletRegistry, portletFactory );
  +                webAppsDir, portletRegistry, entityAccess, windowAccess, portletCache,
portletFactory, manager), portletRegistry );
           ArrayList eventListeners = new ArrayList(1);
           
           eventListeners.add(dpal);
  @@ -454,7 +454,7 @@
       public void tearDown() throws Exception
       {
           manager = new TomcatManager("", "", 0, "", 0, "", "");
  -        FileSystemPAM pam = new FileSystemPAM(webAppsDir, portletRegistry, entityAccess,
windowAccess, portletCache, manager);
  +        FileSystemPAM pam = new FileSystemPAM(webAppsDir, portletRegistry, entityAccess,
windowAccess, portletCache, portletFactory, manager);
   
           try
           {
  
  
  
  1.6       +3 -4      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/engine/TestSpringEngine.java
  
  Index: TestSpringEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/engine/TestSpringEngine.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestSpringEngine.java	8 Nov 2004 15:13:53 -0000	1.5
  +++ TestSpringEngine.java	2 Feb 2005 03:22:05 -0000	1.6
  @@ -30,7 +30,6 @@
   import org.apache.jetspeed.security.SecurityProvider;
   import org.apache.jetspeed.security.UserManager;
   import org.apache.jetspeed.security.impl.RdbmsPolicy;
  -import org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManager;
   import org.apache.jetspeed.userinfo.UserInfoManager;
   import org.apache.pluto.services.information.StaticInformationProvider;
   
  @@ -56,7 +55,7 @@
                                        Profiler.class, Capabilities.class, PropertyManager.class,
PreferencesProvider.class, UserManager.class,
                                        GroupManager.class, RoleManager.class, PermissionManager.class,
RdbmsPolicy.class, SecurityProvider.class,
                                        UserInfoManager.class, NavigationalStateComponent.class,
RequestContextComponent.class, PortletWindowAccessor.class,
  -                                     PortletRenderer.class, PageAggregator.class, PortletAggregator.class,
ApplicationServerManager.class, "PAM",
  +                                     PortletRenderer.class, PageAggregator.class, PortletAggregator.class,
"PAM",
                                        "deploymentManager", "portletCache", "portletFactory",
"portletFactoryProxy", ServletConfig.class, 
                                        StaticInformationProvider.class};
       }
  @@ -80,4 +79,4 @@
           return SpringEngine.class;
       }
   
  -}
  \ No newline at end of file
  +}
  
  
  
  1.41      +22 -1     jakarta-jetspeed-2/portal/src/webapp/WEB-INF/assembly/jetspeed-spring.xml
  
  Index: jetspeed-spring.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/webapp/WEB-INF/assembly/jetspeed-spring.xml,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- jetspeed-spring.xml	27 Jan 2005 21:27:52 -0000	1.40
  +++ jetspeed-spring.xml	2 Feb 2005 03:22:05 -0000	1.41
  @@ -666,6 +666,7 @@
     	   Provides hooks into the application server to help us deploy portlet applications
     	   as web application into that server.  This manager is for Tomcat 4/5
     	-->
  +  <!--
     <bean id="org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManager"

     	   class="org.apache.jetspeed.tools.pamanager.servletcontainer.TomcatManager" 
     	   init-method="start" destroy-method="stop"
  @@ -678,6 +679,7 @@
     	   <constructor-arg index="5"><value>${autodeployment.user}</value></constructor-arg>
     	   <constructor-arg index="6"><value>${autodeployment.password}</value></constructor-arg>
     </bean>
  +  --> 
     <!--
     	Application Server Manager for JBoss.
     	To support deployment in JBoss, comment the Tomcat app server definition above
  @@ -695,6 +697,7 @@
     	   and to application server Jetspeed is using to process the web application
     	   portion of the portlet application.  
     	-->
  +  <!-- 
      <bean id="PAM" 
     	   class="org.apache.jetspeed.tools.pamanager.ApplicationServerPAM" 
     	   init-method="start" destroy-method="stop"
  @@ -705,6 +708,25 @@
     	   <constructor-arg ><ref bean="org.apache.jetspeed.container.window.PortletWindowAccessor"
/></constructor-arg>
     	   <constructor-arg ><ref bean="org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManager"
/></constructor-arg>
     	   <constructor-arg ><ref bean="portletCache" /></constructor-arg>
 
  +  	   <constructor-arg ><ref bean="portletFactory" /></constructor-arg>
 	      
  +  	   <property name="searchEngine"><ref bean="org.apache.jetspeed.search.SearchEngine"/></property>
  +  </bean>
  +  -->
  +  <bean id="deployFactory" class="org.apache.jetspeed.tools.deploy.JetspeedDeployFactory"/>
  +  <bean id="PAM" 
  +  	   class="org.apache.jetspeed.tools.pamanager.WarInfusionPAM"
  +  >  	   
  +  	   <constructor-arg><value>${autodeployment.target.dir}</value></constructor-arg>
  +  	   <constructor-arg><ref bean="org.apache.jetspeed.components.portletregistry.PortletRegistry"/></constructor-arg>
  +  	   <constructor-arg><ref bean="org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent"/></constructor-arg>
  +  	   <constructor-arg><ref bean="org.apache.jetspeed.container.window.PortletWindowAccessor"/></constructor-arg>
  +  	   <constructor-arg><ref bean="portletCache"/></constructor-arg> 

  +  	   <constructor-arg><ref bean="portletFactory"/></constructor-arg>
  +  	   <constructor-arg><ref bean="deployFactory"/></constructor-arg>
  +       <!-- force deployment to use expanded wars, (i.e. Tomcat 4.X), default = not
specified - inspect webapps to determine -->
  +  	   <!-- <constructor-arg type="boolean"><value>true</value></constructor-arg>
-->
  +       <!-- force deployment to use war files, (i.e. Tomcat 5.X), default = not specified
- inspect webapps to determine -->
  +  	   <!-- <constructor-arg type="boolean"><value>false</value></constructor-arg>
-->
     	   <property name="searchEngine"><ref bean="org.apache.jetspeed.search.SearchEngine"/></property>
     </bean>
   
  @@ -715,7 +737,6 @@
          <constructor-arg ><value>${autodeployment.staging.dir}</value></constructor-arg>
     	   <constructor-arg ><ref bean="PAM" /></constructor-arg>
     	   <constructor-arg ><ref bean="org.apache.jetspeed.components.portletregistry.PortletRegistry"
/></constructor-arg>
  -  	   <constructor-arg><ref bean="portletFactory"/></constructor-arg>
     </bean>
     <bean id="decoratorDeploymentRegistry" 
     	   class="org.apache.jetspeed.deployment.simpleregistry.impl.InMemoryRegistryImpl"
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message