cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl PortalManagerImpl.java PortalServiceImpl.java DefaultPortalComponentManager.java DefaultLinkService.java
Date Mon, 20 Oct 2003 13:36:56 GMT
cziegeler    2003/10/20 06:36:56

  Modified:    src/blocks/portal/java/org/apache/cocoon/portal/impl
                        PortalManagerImpl.java PortalServiceImpl.java
                        DefaultPortalComponentManager.java
                        DefaultLinkService.java
  Log:
  Changing to Serviceable
  
  Revision  Changes    Path
  1.6       +13 -13    cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
  
  Index: PortalManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PortalManagerImpl.java	18 Jul 2003 14:41:46 -0000	1.5
  +++ PortalManagerImpl.java	20 Oct 2003 13:36:56 -0000	1.6
  @@ -50,11 +50,11 @@
   */
   package org.apache.cocoon.portal.impl;
   
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.Serviceable;
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.portal.PortalManager;
  @@ -72,11 +72,11 @@
    * 
    * @version CVS $Id$
    */
  -public final class PortalManagerImpl
  +public class PortalManagerImpl
   	extends AbstractLogEnabled
  -	implements PortalManager, Composable, ThreadSafe {
  +	implements PortalManager, Serviceable, ThreadSafe {
   
  -    private ComponentManager manager;
  +    protected ServiceManager manager;
           
       public void process()
       throws ProcessingException {
  @@ -84,7 +84,7 @@
           try {
               eventManager = (EventManager)this.manager.lookup(EventManager.ROLE);
               eventManager.processEvents();
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               throw new ProcessingException("Unable to lookup portal service.", ce);
           } finally {
               this.manager.release(eventManager);
  @@ -109,7 +109,7 @@
               contentHandler.startDocument();
               portalLayoutRenderer.toSAX(portalLayout, service, contentHandler);
               contentHandler.endDocument();
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               throw new SAXException("Unable to lookup portal service.", ce);
           } finally {
               this.manager.release(service);
  @@ -117,11 +117,11 @@
   	}
   
   	/**
  -	 * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
  +	 * @see org.apache.avalon.framework.service.Serviceable#service(ServiceManager)
   	 */
  -	public void compose(ComponentManager componentManager)
  -		throws ComponentException {
  -        this.manager = componentManager;
  +	public void service(ServiceManager serviceManager)
  +    throws ServiceException {
  +        this.manager = serviceManager;
   	}
   
   }
  
  
  
  1.9       +13 -11    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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PortalServiceImpl.java	21 Aug 2003 06:41:19 -0000	1.8
  +++ PortalServiceImpl.java	20 Oct 2003 13:36:56 -0000	1.9
  @@ -55,10 +55,6 @@
   import java.util.Map;
   
   import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  @@ -67,6 +63,9 @@
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
  +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;
  @@ -84,7 +83,7 @@
    */
   public class PortalServiceImpl
       extends AbstractLogEnabled
  -    implements Composable,
  +    implements Serviceable,
                   ThreadSafe, 
                   PortalService, 
                   Contextualizable,
  @@ -93,7 +92,7 @@
   
       protected Context context;
       
  -    protected ComponentManager manager;
  +    protected ServiceManager manager;
   
       protected Map portalComponentManagers = new HashMap();
       
  @@ -101,8 +100,11 @@
       
       final protected String key = this.getClass().getName();
       
  -    public void compose(ComponentManager componentManager) throws ComponentException {
  -        this.manager = componentManager;
  +    /* (non-Javadoc)
  +     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
  +     */
  +    public void service(ServiceManager serviceManager) throws ServiceException {
  +        this.manager = serviceManager;
           this.dataStore = (RequestDataStore) this.manager.lookup(RequestDataStore.ROLE);
       }
   
  @@ -175,7 +177,7 @@
        */
       public void dispose() {
           if ( this.manager != null ) {
  -            this.manager.release( (Component)this.dataStore );
  +            this.manager.release( this.dataStore );
               this.manager = null;
               this.dataStore = null;
           }
  @@ -199,7 +201,7 @@
                   this.portalComponentManagers.put( name, c );
                   ContainerUtil.enableLogging( c, this.getLogger() );
                   ContainerUtil.contextualize( c, this.context );
  -                ContainerUtil.compose( c, this.manager );
  +                ContainerUtil.service( c, this.manager );
                   ContainerUtil.configure( c, current );
                   ContainerUtil.initialize( c );
               } catch (Exception e) {
  
  
  
  1.3       +20 -21    cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultPortalComponentManager.java
  
  Index: DefaultPortalComponentManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultPortalComponentManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultPortalComponentManager.java	6 Oct 2003 15:22:36 -0000	1.2
  +++ DefaultPortalComponentManager.java	20 Oct 2003 13:36:56 -0000	1.3
  @@ -56,15 +56,14 @@
   
   import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.ComponentSelector;
  -import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.ServiceSelector;
  +import org.apache.avalon.framework.service.Serviceable;
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.portal.LinkService;
   import org.apache.cocoon.portal.PortalComponentManager;
  @@ -86,9 +85,9 @@
    */
   public class DefaultPortalComponentManager
       extends AbstractLogEnabled
  -    implements PortalComponentManager, Composable, Disposable, ThreadSafe, Configurable
{
  +    implements PortalComponentManager, Serviceable, Disposable, ThreadSafe, Configurable
{
   
  -    protected ComponentManager manager;
  +    protected ServiceManager manager;
   
       protected LinkService linkService;
   
  @@ -100,7 +99,7 @@
       
       protected String rendererSelectorRole;
       
  -    protected ComponentSelector rendererSelector;
  +    protected ServiceSelector rendererSelector;
       
       protected Map renderers;
       
  @@ -113,9 +112,9 @@
       protected LayoutFactory layoutFactory;
       
       /* (non-Javadoc)
  -     * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
  +     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
        */
  -    public void compose(ComponentManager manager) throws ComponentException {
  +    public void service(ServiceManager manager) throws ServiceException {
           this.manager = manager;
       }
   
  @@ -126,7 +125,7 @@
           if ( null == this.linkService ) {
               try {
                   this.linkService = (LinkService)this.manager.lookup( this.linkServiceRole
);
  -            } catch (ComponentException e) {
  +            } catch (ServiceException e) {
                   throw new CascadingRuntimeException("Unable to lookup link service with
role " + this.linkServiceRole, e);
               }
           }
  @@ -140,7 +139,7 @@
           if ( null == this.profileManager ) {
               try {
                   this.profileManager = (ProfileManager)this.manager.lookup( this.profileManagerRole
);
  -            } catch (ComponentException e) {
  +            } catch (ServiceException e) {
                   throw new CascadingRuntimeException("Unable to lookup profile manager with
role " + this.profileManagerRole, e);
               }
           }
  @@ -155,7 +154,7 @@
               if ( this.rendererSelector != null) {
                   Iterator i = this.renderers.values().iterator();
                   while (i.hasNext()) {
  -                    this.rendererSelector.release((Component) i.next());
  +                    this.rendererSelector.release(i.next());
                   }
                   this.manager.release( this.rendererSelector );
                   this.rendererSelector = null;
  @@ -165,8 +164,8 @@
               this.manager.release( this.linkService );
               this.profileManager = null;
               this.linkService = null;
  -            this.manager.release((Component)this.copletFactory);
  -            this.manager.release((Component)this.layoutFactory);
  +            this.manager.release(this.copletFactory);
  +            this.manager.release(this.layoutFactory);
               this.copletFactory = null;
               this.layoutFactory = null;
               this.manager = null;
  @@ -190,8 +189,8 @@
       public Renderer getRenderer(String hint) {
           if ( rendererSelector == null ) {
               try {
  -                this.rendererSelector = (ComponentSelector)this.manager.lookup( this.rendererSelectorRole
);
  -            } catch (ComponentException e) {
  +                this.rendererSelector = (ServiceSelector)this.manager.lookup( this.rendererSelectorRole
);
  +            } catch (ServiceException e) {
                   throw new CascadingRuntimeException("Unable to lookup renderer selector
with role " + this.rendererSelectorRole, e);
               }
               this.renderers = new HashMap();
  @@ -201,7 +200,7 @@
               try {
                   o = (Renderer) this.rendererSelector.select( hint );
                   this.renderers.put( hint, o );
  -            } catch (ComponentException e) {
  +            } catch (ServiceException e) {
                   throw new CascadingRuntimeException("Unable to lookup renderer with hint
" + hint, e);
               }
           }
  @@ -215,7 +214,7 @@
           if ( null == this.copletFactory ) {
               try {
                   this.copletFactory = (CopletFactory)this.manager.lookup( this.copletFactoryRole);
  -            } catch (ComponentException e) {
  +            } catch (ServiceException e) {
                   throw new CascadingRuntimeException("Unable to lookup coplet factory with
role " + this.copletFactoryRole, e);
               }
           }
  @@ -229,7 +228,7 @@
           if ( null == this.layoutFactory ) {
               try {
                   this.layoutFactory = (LayoutFactory)this.manager.lookup( this.layoutFactoryRole);
  -            } catch (ComponentException e) {
  +            } catch (ServiceException e) {
                   throw new CascadingRuntimeException("Unable to lookup layout factory with
role " + this.copletFactoryRole, e);
               }
           }
  
  
  
  1.7       +14 -15    cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultLinkService.java
  
  Index: DefaultLinkService.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultLinkService.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultLinkService.java	17 Jun 2003 19:59:31 -0000	1.6
  +++ DefaultLinkService.java	20 Oct 2003 13:36:56 -0000	1.7
  @@ -55,13 +55,13 @@
   import java.util.List;
   
   import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.Serviceable;
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.components.ContextHelper;
   import org.apache.cocoon.environment.Request;
  @@ -81,7 +81,7 @@
    */
   public class DefaultLinkService 
       extends AbstractLogEnabled
  -    implements ThreadSafe, LinkService, Composable, Disposable, Contextualizable {
  +    implements ThreadSafe, LinkService, Serviceable, Disposable, Contextualizable {
   
   
       class Info {
  @@ -92,9 +92,17 @@
       
       
       protected EventConverter   converter;
  -    protected ComponentManager manager;
  +    protected ServiceManager manager;
       protected Context context;
       
  +    /* (non-Javadoc)
  +     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
  +     */
  +    public void service(ServiceManager manager) throws ServiceException {
  +        this.manager = manager;
  +        this.converter = (EventConverter)this.manager.lookup(EventConverter.ROLE);
  +    }
  +
       protected Info getInfo() {
           final Request request = ContextHelper.getRequest( this.context );
           Info info = (Info)request.getAttribute(DefaultLinkService.class.getName());
  @@ -222,15 +230,6 @@
           return info.linkBase.toString();
       }
       
  -    /* (non-Javadoc)
  -     * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
  -     */
  -    public void compose(ComponentManager manager)
  -    throws ComponentException {
  -        this.manager = manager;
  -        this.converter = (EventConverter)this.manager.lookup(EventConverter.ROLE);
  -    }
  -
       /* (non-Javadoc)
        * @see org.apache.avalon.framework.activity.Disposable#dispose()
        */
  
  
  

Mime
View raw message