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/prefs/containers prefs.container.groovy
Date Wed, 10 Mar 2004 22:34:43 GMT
dlestrat    2004/03/10 14:34:43

  Modified:    components/prefs/src/java/org/apache/jetspeed/prefs/containers
                        prefs.container.groovy
  Log:
  Modified prefs container to be able to instantiate PreferencesProvider during
  assembly.
  
  Revision  Changes    Path
  1.3       +17 -7     jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/containers/prefs.container.groovy
  
  Index: prefs.container.groovy
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/prefs/src/java/org/apache/jetspeed/prefs/containers/prefs.container.groovy,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- prefs.container.groovy	10 Mar 2004 06:03:17 -0000	1.2
  +++ prefs.container.groovy	10 Mar 2004 22:34:43 -0000	1.3
  @@ -4,6 +4,8 @@
   import org.picocontainer.defaults.ComponentParameter
   import org.picocontainer.defaults.ConstructorComponentAdapter
   
  +import org.apache.jetspeed.components.persistence.store.ojb.pb.PBStore
  +import org.apache.jetspeed.components.persistence.store.impl.DefaultPersistenceStoreContainer
   import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer
   
   import org.apache.jetspeed.prefs.PropertyManager
  @@ -21,22 +23,30 @@
    * and use it as the container for the Preferences.
    */
   
  -// Prior to this, you will need to have an Implementation
  -// of org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer
  -// registered.
  +pContainer = new DefaultPersistenceStoreContainer(15000, 10000)
  +if (parent != null) 
  +{
  +	pContainer.setParent(parent);
  +}
  +
  +ComponentAdapter ca = new ConstructorComponentAdapter("jetspeed", PBStore, new Parameter[]
{new ConstantParameter("jetspeed")})
  +pContainer.registerComponent(ca)
  +
   if(parent != null)
   {
   	container = new DefaultPicoContainer(parent)
  +	parent.registerComponentInstance(PersistenceStoreContainer, pContainer);
   	parent.registerComponentImplementation(PropertyManager, PropertyManagerImpl, new Parameter[]
{new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")} )
  -	ComponentAdapter ca = new ConstructorComponentAdapter(PreferencesProvider, PreferencesProviderImpl,
new Parameter[] {new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed"),
new ConstantParameter("org.apache.jetspeed.prefs.impl.PreferencesFactoryImpl")})
  -	parent.registerComponent(ca)
  +	//parent.registerComponentImplementation(PreferencesProvider, PreferencesProviderImpl,
new Parameter[] {new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed"),
new ConstantParameter("org.apache.jetspeed.prefs.impl.PreferencesFactoryImpl")})
  +	parent.registerComponentInstance(PreferencesProvider, new PreferencesProviderImpl(pContainer,
"jetspeed", "org.apache.jetspeed.prefs.impl.PreferencesFactoryImpl"))	
   }
   else
   {
   	container = new DefaultPicoContainer()
  +	container.registerComponentInstance(PersistenceStoreContainer, pContainer);
       container.registerComponentImplementation(PropertyManager, PropertyManagerImpl, new
Parameter[] {new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed")}
)
  -	ComponentAdapter ca = new ConstructorComponentAdapter(PreferencesProvider, PreferencesProviderImpl,
new Parameter[] {new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed"),
new ConstantParameter("org.apache.jetspeed.prefs.impl.PreferencesFactoryImpl")})
  -	container.registerComponent(ca)
  +	//container.registerComponentImplementation(PreferencesProvider, PreferencesProviderImpl,
new Parameter[] {new ComponentParameter(PersistenceStoreContainer), new ConstantParameter("jetspeed"),
new ConstantParameter("org.apache.jetspeed.prefs.impl.PreferencesFactoryImpl")})
  +	container.registerComponentInstance(PreferencesProvider, new PreferencesProviderImpl(pContainer,
"jetspeed", "org.apache.jetspeed.prefs.impl.PreferencesFactoryImpl"))
   }	
   	
   // This will be an empty container if "parent" was not null
  
  
  

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