portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/webapp/WEB-INF/assembly jetspeed.groovy
Date Wed, 23 Jun 2004 18:44:01 GMT
weaver      2004/06/23 11:44:01

  Modified:    portal/src/webapp/WEB-INF/assembly jetspeed.groovy
  Log:
  auto deployment moved from being a CPS serverice to a component.
  Now registering "PAM" component
  
  Revision  Changes    Path
  1.43      +71 -14    jakarta-jetspeed-2/portal/src/webapp/WEB-INF/assembly/jetspeed.groovy
  
  Index: jetspeed.groovy
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/webapp/WEB-INF/assembly/jetspeed.groovy,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- jetspeed.groovy	18 Jun 2004 20:50:34 -0000	1.42
  +++ jetspeed.groovy	23 Jun 2004 18:44:01 -0000	1.43
  @@ -16,7 +16,7 @@
   import org.picocontainer.defaults.DefaultPicoContainer
   import org.picocontainer.defaults.ConstantParameter
   import org.picocontainer.ComponentAdapter
  -import org.picocontainer.defaults.ConstructorComponentAdapter
  +import org.picocontainer.defaults.ConstructorInjectionComponentAdapter
   import org.picocontainer.defaults.CachingComponentAdapter
   import org.picocontainer.Parameter
   import org.picocontainer.defaults.ComponentParameter
  @@ -36,6 +36,8 @@
   import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent
   import org.apache.jetspeed.components.portletregistry.PortletRegistryComponent
   
  +import java.util.Locale;
  +
   import org.apache.jetspeed.cache.file.FileCache
   import org.apache.jetspeed.profiler.Profiler
   import org.apache.jetspeed.profiler.impl.JetspeedProfiler
  @@ -111,6 +113,10 @@
   
   import org.apache.jetspeed.om.common.portlet.MutablePortletEntity
   import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite
  +
  +// Autodeploy
  +import org.apache.jetspeed.deployment.impl.CatalinaAutoDeploymentServiceImpl
  +import org.apache.jetspeed.tools.pamanager.CatalinaPAM
          
   /* **********************************************************
    *  U T I L L I T Y   C L O S U R E S                       *
  @@ -121,17 +127,17 @@
   { 
     key, clazz, parameters | return new CachingComponentAdapter(
                     new InterceptorAdapter( 
  -                   new ConstructorComponentAdapter(key, clazz, parameters),
  +                   new ConstructorInjectionComponentAdapter(key, clazz, parameters),
                      ThreadLocalDelegationStrategy
                      )
                    )
   }
   
   // Shorthand for creating a ConstantParameter
  -cstParam = { key | return  new ConstantParameter(key) }
  +def cstParam(key){ return  new ConstantParameter(key) }
   
   // Shorthand for creating a ComponentParameter
  -cmpParam = { key | return  new ComponentParameter(key) }
  +def cmpParam(key) { return  new ComponentParameter(key) }
   
   // Closure to perform easy building of Parameter[]
   doParams = 
  @@ -145,6 +151,26 @@
                         }
                         return paramArray
   }
  +
  +// Shorthand for a ConstructorInjectionComponentAdapter
  +def constructorAdapter(key, clazz, parameters)
  +{   
  +    
  +	return new ConstructorInjectionComponentAdapter(key, clazz, parameters)
  +}
  +
  +// Shorthand for a CachingComponentAdapter
  +def cachingAdapter(delegate) 
  +{       
  +	return new CachingComponentAdapter(delegate)
  +}
  +
  +// Combine CachingComponentAdapter and ConstructorInjectionComponentAdapter 
  +// to create Singletons
  +def singletonAdapter(key, clazz, parameters)
  +{
  +    return cachingAdapter(constructorAdapter(key, clazz, parameters))
  +}
                      
    
    /* ******************************************************* */
  @@ -160,7 +186,7 @@
   FSSystemResourceUtilImpl resourceUtil = new FSSystemResourceUtilImpl(applicationRoot)
   
   // create the root container
  -container = new DefaultPicoContainer()
  +container = new DefaultPicoContainer(parent)
   
   /* **********************************************************
    *  Portlet Services                                        *
  @@ -233,12 +259,14 @@
   
   
   /* **********************************************************
  - *  Porlet Registry                                         *
  + *  Portlet Registry                                         *
    * ******************************************************** */
  - container.registerComponentImplementation(
  -                            PortletRegistryComponent, 
  -                            PortletRegistryComponentImpl, 
  -                            doParams([cmpParam(PersistenceStore)])
  + 
  + container.registerComponent(singletonAdapter(
  +                              PortletRegistryComponent, 
  +                              PortletRegistryComponentImpl, 
  +                              doParams([cmpParam(PersistenceStore)])                  
      
  +                            )
   )
   
   services.addPortletService("PortletRegistryComponent", container.getComponentInstance(PortletRegistryComponent))
  @@ -246,10 +274,13 @@
   /* **********************************************************
    *  Portlet Entity                                          *
    * ******************************************************** */
  -container.registerComponentImplementation(
  -                           PortletEntityAccessComponent, 
  -                           PortletEntityAccessComponentImpl,
  -                           doParams([cmpParam(PersistenceStore), cmpParam(PortletRegistryComponent)])
  +container.registerComponent(singletonAdapter(
  +                             PortletEntityAccessComponent, 
  +                             PortletEntityAccessComponentImpl,
  +                             doParams([cmpParam(PersistenceStore), 
  +                                     cmpParam(PortletRegistryComponent)]
  +                             )
  +                          )
   )
   
   /* **********************************************************
  @@ -428,5 +459,31 @@
                         PortletAggregatorImpl,
                         doParams([cmpParam(PortletRenderer)])
   )
  +
  +/* **********************************************************
  + *  Autodeployment                                          *
  + * ******************************************************** */
  +
  +container.registerComponent(singletonAdapter(
  +                             "PAM", 
  +                             CatalinaPAM,
  +                             doParams([cmpParam(PortletRegistryComponent),
  +                                       cstParam(Locale.getDefault())                  
                    
  +                                       ]
  +                             )
  +                          )
  +)
  +
  +container.registerComponent(singletonAdapter(
  +                             "autodeployment", 
  +                             CatalinaAutoDeploymentServiceImpl,
  +                             doParams([cmpParam("portal_configuration"), 
  +                                       cstParam(Locale.getDefault()),                 
                      
  +                                       cmpParam(PortletRegistryComponent),
  +                                       cmpParam("PAM")]
  +                             )
  +                          )
  +)
  +
   
   return container
  
  
  

---------------------------------------------------------------------
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