You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2004/07/11 16:04:35 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/persistence RequestDataStoreImpl.java RequestDataStore.java

cziegeler    2004/07/11 07:04:35

  Modified:    src/blocks/portal/java/org/apache/cocoon/portal/impl
                        PortalServiceImpl.java
               src/java/org/apache/cocoon/components/persistence
                        RequestDataStoreImpl.java RequestDataStore.java
  Log:
  Deprecate request data store and remove it's use in the portal
  
  Revision  Changes    Path
  1.12      +5 -12     cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
  
  Index: PortalServiceImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PortalServiceImpl.java	7 Jun 2004 09:53:34 -0000	1.11
  +++ PortalServiceImpl.java	11 Jul 2004 14:04:34 -0000	1.12
  @@ -33,7 +33,7 @@
   import org.apache.avalon.framework.service.Serviceable;
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.components.ContextHelper;
  -import org.apache.cocoon.components.persistence.RequestDataStore;
  +import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.portal.PortalComponentManager;
   import org.apache.cocoon.portal.PortalService;
   
  @@ -61,8 +61,6 @@
   
       protected Map portalComponentManagers = new HashMap();
       
  -    protected RequestDataStore dataStore;
  -    
       final protected String key = this.getClass().getName();
       
       /* (non-Javadoc)
  @@ -70,15 +68,15 @@
        */
       public void service(ServiceManager serviceManager) throws ServiceException {
           this.manager = serviceManager;
  -        this.dataStore = (RequestDataStore) this.manager.lookup(RequestDataStore.ROLE);
       }
   
       protected PortalServiceInfo getInfo() {
  -        PortalServiceInfo info = (PortalServiceInfo) this.dataStore.getGlobalRequestData(this.key);
  +        final Request request = ContextHelper.getRequest( this.context );
  +        PortalServiceInfo info = (PortalServiceInfo) request.getAttribute(this.key, Request.GLOBAL_SCOPE);
           if ( info == null ) {
               info = new PortalServiceInfo();
               info.setup(ContextHelper.getObjectModel(this.context), this.portalComponentManagers);
  -            this.dataStore.setGlobalRequestData(this.key, info);
  +            request.setAttribute(this.key, info, Request.GLOBAL_SCOPE);
           }
           return info;
       }
  @@ -141,11 +139,6 @@
        * @see org.apache.avalon.framework.activity.Disposable#dispose()
        */
       public void dispose() {
  -        if ( this.manager != null ) {
  -            this.manager.release( this.dataStore );
  -            this.manager = null;
  -            this.dataStore = null;
  -        }
           final Iterator i = this.portalComponentManagers.values().iterator();
           while ( i.hasNext() ) {
               ContainerUtil.dispose( i.next() );
  
  
  
  1.5       +3 -1      cocoon-2.1/src/java/org/apache/cocoon/components/persistence/RequestDataStoreImpl.java
  
  Index: RequestDataStoreImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/persistence/RequestDataStoreImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RequestDataStoreImpl.java	5 Mar 2004 13:02:50 -0000	1.4
  +++ RequestDataStoreImpl.java	11 Jul 2004 14:04:35 -0000	1.5
  @@ -34,6 +34,8 @@
    * 
    * @version CVS $Id$
    * @since 2.1.1
  + * @deprecated Use the scoped attributes on the Request object instead.
  + *             This component will be removed with Cocoon 2.3.
    */
   public class RequestDataStoreImpl
       extends AbstractLogEnabled
  
  
  
  1.4       +3 -1      cocoon-2.1/src/java/org/apache/cocoon/components/persistence/RequestDataStore.java
  
  Index: RequestDataStore.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/persistence/RequestDataStore.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RequestDataStore.java	5 Mar 2004 13:02:50 -0000	1.3
  +++ RequestDataStore.java	11 Jul 2004 14:04:35 -0000	1.4
  @@ -33,6 +33,8 @@
    * 
    * @version CVS $Id$
    * @since 2.1.1
  + * @deprecated Use the scoped attributes on the Request object instead.
  + *             This component will be removed with Cocoon 2.3.
    */
   public interface RequestDataStore {