cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r429324 - in /cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl: PortalManagerAspectChain.java PortalManagerImpl.java
Date Mon, 07 Aug 2006 12:55:48 GMT
Author: cziegeler
Date: Mon Aug  7 05:55:47 2006
New Revision: 429324

URL: http://svn.apache.org/viewvc?rev=429324&view=rev
Log:
Don't use selectors

Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalManagerAspectChain.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalManagerAspectChain.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalManagerAspectChain.java?rev=429324&r1=429323&r2=429324&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalManagerAspectChain.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalManagerAspectChain.java
Mon Aug  7 05:55:47 2006
@@ -24,7 +24,7 @@
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceSelector;
+import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.portal.PortalManagerAspect;
 import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
 
@@ -39,8 +39,7 @@
 
     protected List configs = new ArrayList(3);
 
-    public void configure(ServiceSelector     aspectSelector,
-                          ServiceSelector     adapterSelector,
+    public void configure(ServiceManager      manager,
                           Configuration       conf,
                           PortalManagerAspect endAspect,
                           Properties          endAspectProperties) 
@@ -52,11 +51,8 @@
                 final String role = current.getAttribute("type", null);
                 PortalManagerAspect pAspect;
                 if ( role != null ) {
-                    if ( aspectSelector == null ) {
-                        throw new ConfigurationException("No selector for aspects defined.");
-                    }
                     try {
-                        pAspect = (PortalManagerAspect) aspectSelector.select(role);    
                   
+                        pAspect = (PortalManagerAspect) manager.lookup(PortalManagerAspect.ROLE
+ '/' + role);                        
                     } catch (ServiceException se) {
                         throw new ConfigurationException("Unable to lookup aspect " + role,
current, se);
                     }
@@ -66,7 +62,7 @@
                         throw new ConfigurationException("Aspect configuration requires either
a type or an adapter attribute.", current);
                     }
                     try {
-                        pAspect = (PortalManagerAspect)adapterSelector.select(adapterName);
+                        pAspect = (PortalManagerAspect)manager.lookup(CopletAdapter.ROLE
+ '/' + adapterName);
                     } catch (ServiceException se) {
                         throw new ConfigurationException("Unable to lookup coplet adapter
" + adapterName, current, se);
                     }
@@ -88,15 +84,11 @@
         return this.configs.iterator();
     }
 
-    public void dispose(ServiceSelector aspectSelector, ServiceSelector adapterSelector)
{
+    public void dispose(ServiceManager manager) {
         Iterator i = this.aspects.iterator();
         while (i.hasNext()) {
             final Object component = i.next();
-            if ( component instanceof CopletAdapter ) {
-                adapterSelector.release(component);
-            } else {
-                aspectSelector.release(component);
-            }
+            manager.release(component);
         }
         this.aspects.clear();
         this.configs.clear();

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java?rev=429324&r1=429323&r2=429324&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
Mon Aug  7 05:55:47 2006
@@ -22,11 +22,6 @@
 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.context.Context;
-import org.apache.avalon.framework.context.ContextException;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.ServiceSelector;
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.ajax.AjaxHelper;
 import org.apache.cocoon.components.ContextHelper;
@@ -39,7 +34,6 @@
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletInstance;
 import org.apache.cocoon.portal.coplet.CopletInstanceFeatures;
-import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
 import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutFeatures;
@@ -61,33 +55,14 @@
 
     protected PortalManagerAspectChain chain;
 
-    protected ServiceSelector aspectSelector;
-    protected ServiceSelector adapterSelector;
-
-    /**
-     * @see org.apache.avalon.framework.service.Serviceable#service(ServiceManager)
-     */
-    public void service(ServiceManager serviceManager)
-    throws ServiceException {
-        super.service(serviceManager);
-        if ( this.manager.hasService(PortalManagerAspect.ROLE+"Selector") ) {
-            this.aspectSelector = (ServiceSelector) this.manager.lookup( PortalManagerAspect.ROLE+"Selector");
-        }
-        this.adapterSelector = (ServiceSelector)this.manager.lookup(CopletAdapter.ROLE+"Selector");
-    }
-
     /**
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose() {
         if ( this.manager != null ) {
             if ( this.chain != null) {
-                this.chain.dispose( this.aspectSelector, this.adapterSelector );
+                this.chain.dispose( this.manager );
             }
-            this.manager.release( this.aspectSelector );
-            this.aspectSelector = null;
-            this.manager.release( this.adapterSelector );
-            this.adapterSelector = null;
         }
         super.dispose();
     }
@@ -121,18 +96,10 @@
      */
     public void configure(Configuration conf) throws ConfigurationException {
         this.chain = new PortalManagerAspectChain();
-        this.chain.configure(this.aspectSelector, 
-                             this.adapterSelector, 
+        this.chain.configure(this.manager, 
                              conf.getChild("aspects"), 
                              this, 
                              new Properties());
-    }
-
-    /**
-     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
-     */
-    public void contextualize(Context aContext) throws ContextException {
-        this.context = aContext;
     }
 
     /**



Mime
View raw message