portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlest...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/containers prefs.container.groovy
Date Sat, 28 Feb 2004 16:33:56 GMT
dlestrat    2004/02/28 08:33:56

  Modified:    components/prefs/src/java/org/apache/jetspeed/containers
                        prefs.container.groovy
  Log:
  Updated to use BoundDataSource
  
  Revision  Changes    Path
  1.3       +10 -22    jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/containers/prefs.container.groovy
  
  Index: prefs.container.groovy
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/containers/prefs.container.groovy,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- prefs.container.groovy	27 Feb 2004 18:31:16 -0000	1.2
  +++ prefs.container.groovy	28 Feb 2004 16:33:56 -0000	1.3
  @@ -6,11 +6,9 @@
   import org.picocontainer.defaults.ConstantParameter
   import org.picocontainer.defaults.ComponentParameter
   import org.hsqldb.jdbcDriver
  -import org.apache.jetspeed.components.hsql.HSQLServerComponent
  -import org.apache.jetspeed.components.hsql.HSQLServerComponent
   import org.apache.jetspeed.components.jndi.JNDIComponent
   import org.apache.jetspeed.components.jndi.TyrexJNDIComponent
  -import org.apache.jetspeed.components.datasource.DBCPDatasourceComponent
  +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
  @@ -36,7 +34,11 @@
   container = new DefaultPicoContainer()
   
   
  -Class dsClass = Class.forName("org.apache.jetspeed.components.datasource.DatasourceComponent")
  +// 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")
  @@ -44,36 +46,22 @@
   
   if(url != null)
   {
  -	container.registerComponentInstance(dsClass, new DBCPDatasourceComponent(user, password,
driver, url, 20, 5000, GenericObjectPool.WHEN_EXHAUSTED_GROW, true))
  +	container.registerComponentInstance(DatasourceComponent, new BoundDBCPDatasourceComponent(user,
password, driver, url, 20, 5000, GenericObjectPool.WHEN_EXHAUSTED_GROW, true, "jetspeed",
jndiImpl))
   }
   
  -// This JNDI component helps us publish the datasource
  -Class jndiClass = Class.forName("org.apache.jetspeed.components.jndi.JNDIComponent")
  -Class tyrexJndiClass = Class.forName("org.apache.jetspeed.components.jndi.TyrexJNDIComponent")
  -container.registerComponentImplementation(jndiClass, tyrexJndiClass)
  -
  -
   //
   // Persistence
   PersistenceContainer pContainer = new DefaultPersistenceStoreContainer(300000, 10000)
  -Class pContainerClass = Class.forName("org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer")
  -
  -// Parameter[] storeParams = new Parameter[] {new ConstantParameter("jetspeed")}
   
  -
  -Class OTMStoreClass = Class.forName("org.apache.jetspeed.components.persistence.store.ojb.otm.OTMStoreImpl")
  -ComponentAdapter ca = new ConstructorComponentAdapter("jetspeed", OTMStoreClass, new Parameter[]
{new ConstantParameter("jetspeed")})
  +ComponentAdapter ca = new ConstructorComponentAdapter("jetspeed", OTMStoreImpl, new Parameter[]
{new ConstantParameter("jetspeed")})
   
   pContainer.registerComponent(ca)
   
  -container.registerComponentInstance(pContainerClass, pContainer);
  +container.registerComponentInstance(PersistenceStoreContainer, pContainer);
   
   //
   // Property Manager
   //
  -
  -Class propMgrClass = Class.forName("org.apache.jetspeed.prefs.PropertyManager")
  -Class propMgrImplClass = Class.forName("org.apache.jetspeed.prefs.impl.PropertyManagerImpl")
  -container.registerComponentImplementation(propMgrClass, propMgrImplClass, new Parameter[]
{new ComponentParameter(pContainerClass), new ConstantParameter("jetspeed")} );
  +container.registerComponentImplementation(PropertyManager, PropertyManagerImpl, 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