portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager/containers pa-container.groovy
Date Mon, 01 Mar 2004 04:22:28 GMT
taylor      2004/02/29 20:22:28

  Added:       portal/src/java/org/apache/jetspeed/tools/pamanager/containers
                        pa-container.groovy
  Log:
  container for running PAM test
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager/containers/pa-container.groovy
  
  Index: pa-container.groovy
  ===================================================================
  import org.picocontainer.defaults.DefaultPicoContainer
  import org.picocontainer.defaults.ConstantParameter
  import org.picocontainer.ComponentAdapter
  import org.picocontainer.defaults.ConstructorComponentAdapter
  import org.picocontainer.Parameter
  import org.picocontainer.defaults.ConstantParameter
  import org.picocontainer.defaults.ComponentParameter
  import org.hsqldb.jdbcDriver
  import org.apache.jetspeed.components.jndi.JNDIComponent
  import org.apache.jetspeed.components.jndi.TyrexJNDIComponent
  import org.apache.jetspeed.components.datasource.BoundDBCPDatasourceComponent
  import org.apache.jetspeed.components.datasource.DatasourceComponent
  import org.apache.commons.pool.impl.GenericObjectPool
  import org.apache.jetspeed.components.persistence.store.ojb.OJBTypeIntializer
  import org.apache.jetspeed.components.persistence.store.ojb.otm.OTMStoreImpl
  import org.apache.jetspeed.components.persistence.store.impl.DefaultPersistenceStoreContainer
  import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer
  import org.apache.jetspeed.components.util.system.FSSystemResourceUtilImpl
  
  import org.apache.jetspeed.components.portletregsitry.PortletRegistryComponentImpl
  import org.apache.jetspeed.components.portletregsitry.PortletRegistryComponent
  
  import java.io.File
  
  // WARNING!!!!!!
  // DO NOT use {Class}.class as it appears to be broken in Groovy
  // You end getting a Class instance of the type java.lang.Class
  // instead of the requested type!  This causes AssignabilityExceptions
  // in pico.  You need to use Class.forName() instead.
  
  
  
  // create the root container
  container = new DefaultPicoContainer()
  
  
  
  
  // This JNDI component helps us publish the datasource
  Class jndiClass = JNDIComponent
  JNDIComponent jndiImpl = new TyrexJNDIComponent()
  container.registerComponentInstance(jndiClass, jndiImpl)
  
  String url = System.getProperty("org.apache.jetspeed.database.url")
  String driver = System.getProperty("org.apache.jetspeed.database.driver")
  String user = System.getProperty("org.apache.jetspeed.database.user")
  String password = System.getProperty("org.apache.jetspeed.database.password")
  
  if(url != null)
  {
  	container.registerComponentInstance(DatasourceComponent, new BoundDBCPDatasourceComponent(user,
password, driver, url, 20, 5000, GenericObjectPool.WHEN_EXHAUSTED_GROW, true, "jetspeed",
jndiImpl))
  }
  
  //
  // Persistence
  PersistenceContainer pContainer = new DefaultPersistenceStoreContainer(300000, 10000)
  
  ComponentAdapter ca = new ConstructorComponentAdapter("jetspeed", OTMStoreImpl, new Parameter[]
{new ConstantParameter("jetspeed")})
  
  pContainer.registerComponent(ca)
  
  container.registerComponentInstance(PersistenceStoreContainer, pContainer);
  
  //
  // Portlet Registry
  //
  container.registerComponentImplementation(PortletRegistryComponent, PortletRegistryComponentImpl,
new Parameter[] {new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")}
);
  
  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