cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r219049 [1/2] - in /cocoon/branches/BRANCH_2_1_X/src/blocks/portal: conf/ java/org/apache/cocoon/portal/ java/org/apache/cocoon/portal/acting/ java/org/apache/cocoon/portal/coplet/adapter/impl/ java/org/apache/cocoon/portal/coplets/basket/ ...
Date Thu, 14 Jul 2005 15:11:55 GMT
Author: cziegeler
Date: Thu Jul 14 08:11:52 2005
New Revision: 219049

URL: http://svn.apache.org/viewcvs?rev=219049&view=rev
Log:
Add easier to use event handling mechanism by introducing the new Receiver interface.
Deprecated Publisher, Subscriber, Filter and Register.

Added:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Receiver.java   (with props)
Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.xconf
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/LinkService.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalComponentManager.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/PreparePortalAction.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketManagerImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ActionEvent.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ComparableEvent.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ConvertableEvent.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/CopletDataEvent.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/CopletInstanceEvent.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/EventManager.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Filter.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/LayoutEvent.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Publisher.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Register.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/RequestEvent.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Subscriber.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspectContext.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/AbstractContentEventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ActionCounterEventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ConvertableEventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FullScreenCopletEventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/LinkEventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/NoClientCachingEventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/PageLabelEventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/RequestParameterEventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/CopletStatusEvent.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/DefaultEventAspectContext.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/DefaultEventManager.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEvent.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/subscriber/impl/DefaulCopletDataEventSubscriber.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/subscriber/impl/DefaultChangeAspectDataEventSubscriber.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/subscriber/impl/DefaultJXPathEventSubscriber.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortletPortalManagerAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/CompositeLayout.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractActionAspect.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.xconf
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.xconf?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.xconf (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.xconf Thu Jul 14 08:11:52 2005
@@ -59,14 +59,24 @@
     </event-aspects>
     <!-- add a new instance of each class as a subscriber: -->
     <subscriber-classes>
-        <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaultChangeAspectDataEventSubscriber"/>
-        <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaultJXPathEventSubscriber"/>
-        <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaulCopletDataEventSubscriber"/>
+      <!-- Please note that Subcribers are deprecated. Please use receivers instead. -->
+      <!-- class name="CLASSNAME"/> -->
     </subscriber-classes>
     <!-- add each component as a subscriber (the component should be thread safe): -->
     <subscriber-roles>
-        <!-- <role name="AVALON-ROLE"/> -->
+      <!-- Please note that Subcribers are deprecated. Please use receivers instead. -->
+      <!-- <role name="AVALON-ROLE"/> -->
     </subscriber-roles>
+    <!-- add a new instance of each class as a receiver: -->
+    <receiver-classes>
+        <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaulCopletDataEventSubscriber"/>
+        <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaultChangeAspectDataEventSubscriber"/>
+        <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaultJXPathEventSubscriber"/>
+    </receiver-classes>
+    <!-- add each component as a receiver (the component should be thread safe): -->
+    <receiver-roles>
+        <!-- <role name="AVALON-ROLE"/> -->
+    </receiver-roles>
   </component>
 
   <!-- Event Factory configuration -->

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/LinkService.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/LinkService.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/LinkService.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/LinkService.java Thu Jul 14 08:11:52 2005
@@ -115,10 +115,9 @@
     boolean isSecure();
 
     /**
-     * @see javax.servlet.http.ServletResponse#encodeURL(String url).
      * @param url The url to encode.
      * @return The enocoded URL.
+     * @see javax.servlet.http.ServletResponse#encodeURL(String).
      */
     String encodeURL(String url);
-
-}
+}
\ No newline at end of file

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalComponentManager.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalComponentManager.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalComponentManager.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalComponentManager.java Thu Jul 14 08:11:52 2005
@@ -26,34 +26,34 @@
  * throughout the portal.
  * Any component in the portal should never lookup these components
  * itself, but use this component manager instead.
- * 
+ *
  * This manager allows to run differently configured portals in Cocoon
  * at the same time. This component can't be looked up using the
  * usual Avalon mechanisms, it has to be get by the {@link PortalService}.
- * 
+ *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * 
+ *
  * @version CVS $Id$
  */
 public interface PortalComponentManager {
 
     /**
-     * Get the link service
+     * Get the link service.
      */
     LinkService getLinkService();
-    
+
     /**
-     * Get the current profile manager
+     * Get the current profile manager.
      */
     ProfileManager getProfileManager();
-    
+
     /**
-     * Get the renderer 
+     * Get the renderer.
      */
     Renderer getRenderer(String hint);
-    
+
     /**
-     * Get the coplet factory
+     * Get the coplet factory.
      */
     CopletFactory getCopletFactory();
     

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java Thu Jul 14 08:11:52 2005
@@ -28,7 +28,7 @@
 import org.apache.cocoon.portal.Constants;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.event.Event;
-import org.apache.cocoon.portal.event.Publisher;
+import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.event.impl.CopletJXPathEvent;
 
 /**
@@ -69,7 +69,7 @@
             // if the value is null or empty, the value is not set!
             final String[] names = parameters.getNames();
             if ( names != null ) {
-                final Publisher publisher = portalService.getComponentManager().getEventManager().getPublisher();
+                final EventManager publisher = portalService.getComponentManager().getEventManager();
                 for(int i=0; i<names.length; i++) {
                     final String path = names[i];
                     final String value = parameters.getParameter(path, null );
@@ -77,7 +77,7 @@
                         final Event event = new CopletJXPathEvent(portalService.getComponentManager().getProfileManager().getCopletInstanceData(copletId),
                                 path,
                                 value);
-                        publisher.publish(event);
+                        publisher.send(event);
                     }
                 }
             }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/PreparePortalAction.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/PreparePortalAction.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/PreparePortalAction.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/PreparePortalAction.java Thu Jul 14 08:11:52 2005
@@ -27,12 +27,12 @@
 import org.apache.cocoon.portal.PortalService;
 
 /**
- * Prepare the portal by setting the portal name
+ * Prepare the portal by setting the portal name.
  *
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version CVS $Id: PreparePortalAction.java,v 1.1 2005/01/07 10:21:45 cziegeler Exp $
+ * @version CVS $Id$
  */
-public class PreparePortalAction 
+public class PreparePortalAction
 extends ServiceableAction {
 
 	/* (non-Javadoc)
@@ -51,7 +51,7 @@
                 portalService.setPortalName(portalName);
             }
             return EMPTY_MAP;
-        
+
         } catch (ServiceException e) {
             throw new ProcessingException("Unable to lookup portal service.", e);
         } finally {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java Thu Jul 14 08:11:52 2005
@@ -27,7 +27,7 @@
 import org.apache.cocoon.portal.PortalService;
 
 /**
- * This action saves the profile
+ * This action saves the profile.
  *
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  * @version CVS $Id$

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java Thu Jul 14 08:11:52 2005
@@ -27,7 +27,7 @@
 import org.apache.cocoon.portal.coplet.CopletData;
 import org.apache.cocoon.portal.coplet.CopletFactory;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
-import org.apache.cocoon.portal.event.Event;
+import org.apache.cocoon.portal.event.CopletInstanceEvent;
 import org.apache.cocoon.portal.event.impl.CopletLinkEvent;
 import org.apache.cocoon.portal.layout.CompositeLayout;
 import org.apache.cocoon.portal.layout.Item;
@@ -73,7 +73,7 @@
      * There is a special CopletLinkEvent with the uri "createNewCopletInstance", which is the
      * trigger to create a new instance of the one that is the target of the event.
      */
-    public void handleCopletInstanceEvent(Event e) {
+    public void handleCopletInstanceEvent(CopletInstanceEvent e) {
         super.handleCopletInstanceEvent(e);
         
         if ( e instanceof CopletLinkEvent ) {
@@ -198,9 +198,8 @@
      * @return True if the error content has been rendered, otherwise false
      * @throws SAXException
      */
-    protected boolean renderErrorContent(
-        CopletInstanceData coplet,
-        ContentHandler handler)
+    protected boolean renderErrorContent(CopletInstanceData coplet,
+                                         ContentHandler handler)
     throws SAXException {
         handler.startDocument();
         XMLUtils.startElement(handler, "p");

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java Thu Jul 14 08:11:52 2005
@@ -19,9 +19,9 @@
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.cocoon.components.sax.XMLByteStreamCompiler;
 import org.apache.cocoon.components.sax.XMLByteStreamInterpreter;
+import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.event.CopletInstanceEvent;
-import org.apache.cocoon.portal.event.Event;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 
@@ -184,25 +184,21 @@
         coplet.setAttribute(CACHE_VALIDITY, CACHE_INVALID);
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
+    /**
+     * @see org.apache.cocoon.portal.event.Receiver
      */
-    public void inform(Event e) {
-        if (e instanceof CopletInstanceEvent) {
-            if ( this.getLogger().isInfoEnabled() ) {
-                this.getLogger().info("CopletInstanceEvent " + e + " caught by CachingURICopletAdapter");
-            }
-            this.handleCopletInstanceEvent(e);
+    public void inform(CopletInstanceEvent e, PortalService service) {
+        if ( this.getLogger().isInfoEnabled() ) {
+            this.getLogger().info("CopletInstanceEvent " + e + " caught by CachingURICopletAdapter");
         }
-        super.inform(e);
+        this.handleCopletInstanceEvent(e);
+        super.inform(e, service);
     }
 
     /**
      * This adapter listens for CopletInstanceEvents. Each event sets the cache invalid.
      */
-    public void handleCopletInstanceEvent(Event e) {
-        final CopletInstanceEvent event = (CopletInstanceEvent) e;
-
+    public void handleCopletInstanceEvent(CopletInstanceEvent event) {
         final CopletInstanceData coplet = (CopletInstanceData) event.getTarget();
 
         this.setCacheInvalid(coplet);

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.java Thu Jul 14 08:11:52 2005
@@ -38,10 +38,8 @@
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.event.CopletInstanceEvent;
-import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.EventManager;
-import org.apache.cocoon.portal.event.Filter;
-import org.apache.cocoon.portal.event.Subscriber;
+import org.apache.cocoon.portal.event.Receiver;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.xml.sax.ContentHandler;
@@ -57,7 +55,7 @@
  */
 public class URICopletAdapter 
     extends AbstractCopletAdapter
-    implements Disposable, Subscriber, Initializable, Contextualizable {
+    implements Disposable, Receiver, Initializable, Contextualizable {
 	
     /** The source resolver */
     protected SourceResolver resolver;
@@ -80,6 +78,9 @@
         this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE);
     }
     
+    /**
+     * @see org.apache.cocoon.portal.coplet.adapter.impl.AbstractCopletAdapter#streamContent(org.apache.cocoon.portal.coplet.CopletInstanceData, org.xml.sax.ContentHandler)
+     */
     public void streamContent(CopletInstanceData coplet, ContentHandler contentHandler)
     throws SAXException {
         final String uri = (String)coplet.getCopletData().getAttribute("uri");
@@ -90,8 +91,8 @@
     }
 
     public void streamContent(final CopletInstanceData coplet, 
-                               final String uri,
-                               final ContentHandler contentHandler)
+                              final String uri,
+                              final ContentHandler contentHandler)
     throws SAXException {
 		Source copletSource = null;
 		PortalService portalService = null;
@@ -138,8 +139,8 @@
 			this.manager.release(portalService);
 		}
     }
-    
-    /* (non-Javadoc)
+
+    /**
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose() {
@@ -147,7 +148,7 @@
             EventManager eventManager = null;
             try { 
                 eventManager = (EventManager)this.manager.lookup(EventManager.ROLE);
-                eventManager.getRegister().unsubscribe( this );
+                eventManager.unsubscribe(this);
             } catch (Exception ignore) {
                 // ignore
             } finally {
@@ -160,49 +161,28 @@
         }
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.event.Subscriber#getEventType()
-     */
-    public Class getEventType() {
-        return CopletInstanceEvent.class;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.event.Subscriber#getFilter()
-     */
-    public Filter getFilter() {
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
+    /**
+     * @see Receiver
      */
-    public void inform(Event e) {
-        CopletInstanceEvent event = (CopletInstanceEvent)e;
-        PortalService service = null;
-        try {
-            service = (PortalService)this.manager.lookup(PortalService.ROLE);
-            List list = (List)service.getTemporaryAttribute(URICopletAdapter.class.getName());
-            if ( list == null ) {
-                list = new ArrayList();
-            }
+    public void inform(CopletInstanceEvent event, PortalService service) {
+        List list = (List)service.getTemporaryAttribute(URICopletAdapter.class.getName());
+        if ( list == null ) {
+            list = new ArrayList();
+        }
+        if ( !list.contains(event.getTarget()) ) {
             list.add(event.getTarget());
-            service.setTemporaryAttribute(URICopletAdapter.class.getName(), list);
-        } catch (ServiceException ignore ) {            
-            // ignore
-        } finally {
-            this.manager.release(service);
         }
+        service.setTemporaryAttribute(URICopletAdapter.class.getName(), list);
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() throws Exception {
         EventManager eventManager = null;
         try { 
             eventManager = (EventManager)this.manager.lookup(EventManager.ROLE);
-            eventManager.getRegister().subscribe( this );
+            eventManager.subscribe( this );
         } finally {
             this.manager.release( eventManager );
         }
@@ -260,5 +240,4 @@
         }
         return false;
     }
-
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketManagerImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketManagerImpl.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketManagerImpl.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketManagerImpl.java Thu Jul 14 08:11:52 2005
@@ -64,10 +64,8 @@
 import org.apache.cocoon.portal.coplets.basket.events.ShowBasketEvent;
 import org.apache.cocoon.portal.coplets.basket.events.ShowItemEvent;
 import org.apache.cocoon.portal.coplets.basket.events.UploadItemEvent;
-import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.EventManager;
-import org.apache.cocoon.portal.event.Filter;
-import org.apache.cocoon.portal.event.Subscriber;
+import org.apache.cocoon.portal.event.Receiver;
 import org.apache.cocoon.portal.layout.impl.CopletLayout;
 import org.apache.cocoon.servlet.multipart.Part;
 import org.apache.cocoon.servlet.multipart.PartOnDisk;
@@ -82,7 +80,7 @@
  */
 public class BasketManagerImpl
 extends AbstractLogEnabled
-implements BasketManager, Serviceable, Subscriber, Contextualizable, Initializable, Disposable, Parameterizable, ThreadSafe, Component  {
+implements BasketManager, Serviceable, Receiver, Contextualizable, Initializable, Disposable, Parameterizable, ThreadSafe, Component  {
     
     /** The service manager */
     protected ServiceManager manager;
@@ -173,30 +171,16 @@
         EventManager eventManager = null;
         try {
             eventManager = (EventManager) this.manager.lookup(EventManager.ROLE);
-            eventManager.getRegister().subscribe(this);
+            eventManager.subscribe(this);
         } finally {
             this.manager.release(eventManager);
         }
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.event.Subscriber#getEventType()
-     */
-    public Class getEventType() {
-        return ContentStoreEvent.class;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.event.Subscriber#getFilter()
-     */
-    public Filter getFilter() {
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
+    /**
+     * @see Receiver
      */
-    public void inform(Event event) {
+    public void inform(ContentStoreEvent event, PortalService service) {
         // dispatch
         final Session session = ContextHelper.getRequest(this.context).getSession();
         if ( event instanceof AddItemEvent ) {
@@ -420,7 +404,7 @@
                             while ( i.hasNext() ) {
                                 Map.Entry entry = (Map.Entry)i.next();
                                 attributes.put(entry.getKey(), entry.getValue());
-                        }
+                            }
                             i = cid.getCopletData().getAttributes().entrySet().iterator();
                             while ( i.hasNext() ) {
                                 Map.Entry entry = (Map.Entry)i.next();
@@ -472,7 +456,7 @@
             store.addItem(ci);
         } else { 
             store.addItem(item);
-            }
+        }
         this.saveContentStore(store);
     }
 
@@ -526,13 +510,13 @@
             store = this.loadContentStore(type, user);
         }
         if ( store == null && user != null ) {
-        try {
+            try {
                 final String clazzName;
                 if ( BRIEFCASE_KEY.equals(type) ) {
                     clazzName = this.briefcaseClassName;
                 } else {
                     clazzName = this.folderClassName;
-        }
+                }
                 
                 final Class clazz = ClassUtils.loadClass(clazzName);
                 final Constructor constructor = clazz.getConstructor(new Class[] {String.class});
@@ -543,7 +527,7 @@
                     store = new Briefcase(user);
                 } else {
                     store = new Folder(user);
-            }
+                }
             }
         }
         return store;
@@ -762,7 +746,7 @@
             }
         }
         return null;
-            }
+    }
     
     protected static final class BatchInfo {
         public ContentItem item;
@@ -779,8 +763,8 @@
             final ActionInfo current = (ActionInfo)i.next();
             if ( current.name.equals(name) ) {
                 return current;
+            }
         }
-    }
         return null;
     }
     
@@ -838,13 +822,13 @@
                     buffer.append('=');
                     buffer.append(current.getValue().toString());
                 }
-        }
+            }
             this.url = buffer.toString();
-    }
-   
-    /* (non-Javadoc)
+        }    
+    
+        /* (non-Javadoc)
          * @see org.apache.cocoon.components.cron.CronJob#execute(java.lang.String)
-     */
+         */
         public void execute(String jobname) {
             SourceResolver resolver = null;
             Source source = null;
@@ -873,7 +857,7 @@
                 }
             }
         }
-    }    
+    }
     
     
     /* (non-Javadoc)

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ActionEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ActionEvent.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ActionEvent.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ActionEvent.java Thu Jul 14 08:11:52 2005
@@ -16,15 +16,15 @@
 package org.apache.cocoon.portal.event;
 
 /**
- * This event is performed "on" a target
+ * This event is performed "on" a target.
  * 
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: ActionEvent.java,v 1.3 2004/03/05 13:02:11 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public interface ActionEvent extends Event {
 
     Object getTarget();
-    
+
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ComparableEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ComparableEvent.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ComparableEvent.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ComparableEvent.java Thu Jul 14 08:11:52 2005
@@ -16,15 +16,15 @@
 package org.apache.cocoon.portal.event;
 
 /**
- * Marker interface for portal event that is comparable
+ * Marker interface for portal event that is comparable.
  *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
- * 
- * @version CVS $Id: ComparableEvent.java,v 1.2 2004/03/05 13:02:11 bdelacretaz Exp $
+ *
+ * @version CVS $Id$
  */
-public interface ComparableEvent 
+public interface ComparableEvent
     extends Event {
-    
+
     boolean equalsEvent(ComparableEvent event);
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ConvertableEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ConvertableEvent.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ConvertableEvent.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/ConvertableEvent.java Thu Jul 14 08:11:52 2005
@@ -16,10 +16,10 @@
 package org.apache.cocoon.portal.event;
 
 /**
- * Marker interface for portal event 
+ * Marker interface for portal event .
  *
  * @author <a href="mailto:rgoers@apache.org">Ralph Goers/a>
- * 
+ *
  * @version SVN $Id: $
  */
 public interface ConvertableEvent extends Event {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/CopletDataEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/CopletDataEvent.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/CopletDataEvent.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/CopletDataEvent.java Thu Jul 14 08:11:52 2005
@@ -21,7 +21,7 @@
  * for all coplet instance datas).
  *
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * 
+ *
  * @version CVS $Id$
  */
 public interface CopletDataEvent 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/CopletInstanceEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/CopletInstanceEvent.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/CopletInstanceEvent.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/CopletInstanceEvent.java Thu Jul 14 08:11:52 2005
@@ -20,11 +20,11 @@
  * This interface marks an event as an event for a coplet instance.
  *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * 
+ *
  * @version CVS $Id$
  */
-public interface CopletInstanceEvent 
+public interface CopletInstanceEvent
     extends ActionEvent {
-        
+
     // just a marker interface
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/EventManager.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/EventManager.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/EventManager.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/EventManager.java Thu Jul 14 08:11:52 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
+ * Copyright 1999-2002,2004-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,15 +19,20 @@
 import org.apache.cocoon.ProcessingException;
 
 /**
- * <p>Service to manage event notification. The designed has been inspired by the paper by 
+ * This component manages the event handling mechanism in the portal.
+ * The event mechanism is based on the publisher/subscriber principle.
+ * An interested component (a {@link org.apache.cocoon.portal.event.Receiver}
+ * can subscribe itself for a specific class (or classes) of events.
+ * All Events have a common ancestor type {@link Event} and the event types are 
+ * identified by a (sub)class
+ * 
+ * The old design which is now deprecated has been inspired by the paper by 
  * Gupta, S., J. M. Hartkopf, and S. Ramaswamy, in Java Report, Vol. 3, No. 7, July 1998, 19-36,
- * "Event Notifier: A Pattern for Event Notification".</p>  
+ * "Event Notifier: A Pattern for Event Notification".  
  * 
- * <p>EventManager brokers events between a <tt>Publisher</tt>, which produces events,
+ * EventManager brokers events between a <tt>Publisher</tt>, which produces events,
  * and a <tt>Subscriber</tt>, which handles the notification of events.
  * A <tt>Filter</tt> discards events not of interest to a subscriber.
- * All Events have a common ancestor type <tt>Event</tt> and the event types are 
- * identified by a <tt>Class</tt>.</p>
  * 
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
@@ -38,18 +43,20 @@
 public interface EventManager extends Component {
  
     /**
-     * Represents Role of the service
+     * Represents the role of the service
      */
     String ROLE = EventManager.class.getName(); 
     
      /**
       *  Returns the Publisher with which events can be published.
+      *  @deprecated Use {@link #send(Event)} instead.
       */
     Publisher getPublisher();
     
      /**
       *  Returns the Register with which subscribers can 
       *  subscribe and unsubscribe interest to given Events.
+      *  @deprecated Use {@link #subscribe(Receiver)} and {@link #unsubscribe(Receiver)}.
       */
     Register getRegister();
 
@@ -58,9 +65,21 @@
      */
     void processEvents()
     throws ProcessingException;
-     
 
-}
+    /**
+     * Publish an event. All registered receivers get notified.
+     * @param event The event to broadcast.
+     */
+    void send(Event event);
 
+    /**
+     * Subscribes a receiver for a specific type of event.  
+     */
+    void subscribe(Receiver receiver);
 
+    /**
+     * Unsubscribes a receiver for all events.
+     */
+    void unsubscribe(Receiver receiver);
 
+}

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Filter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Filter.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Filter.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Filter.java Thu Jul 14 08:11:52 2005
@@ -16,28 +16,28 @@
 package org.apache.cocoon.portal.event;
 
 import java.io.Serializable;
+
 /**
  * A Filter allows subscribers to specify which events
- * they should be informed of.  
- * It is Serializable to allow events to be published and received 
+ * they should be informed of.
+ * It is Serializable to allow events to be published and received
  * in a distributed architecture.
  *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * @author Mauro Talevi
- * 
- * @version CVS $Id: Filter.java,v 1.2 2004/03/05 13:02:11 bdelacretaz Exp $
+ * @deprecated Use the receiver instead.
+ *
+ * @version CVS $Id$
  */
 public interface Filter extends Serializable {
-     /**
-      * Filters event, discarding those not of interest to the subscriber.
-      * 
-      * @param event the <tt>Event</tt>
-      * @return boolean <code>true</code> if Event passes filter
-      */
-     boolean filter( Event event );
-
-}
-
 
+    /**
+     * Filters event, discarding those not of interest to the subscriber.
+     *
+     * @param event the <tt>Event</tt>
+     * @return boolean <code>true</code> if Event passes filter
+     */
+    boolean filter( Event event );
 
+}

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/LayoutEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/LayoutEvent.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/LayoutEvent.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/LayoutEvent.java Thu Jul 14 08:11:52 2005
@@ -16,15 +16,15 @@
 package org.apache.cocoon.portal.event;
 
 /**
- * This interface marks an {@link ActionEvent} as targetted at a 
- * {@link org.apache.cocoon.portal.layout.Layout} object
- * 
+ * This interface marks an {@link ActionEvent} as targetted at a
+ * {@link org.apache.cocoon.portal.layout.Layout} object.
+ *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
- * 
+ *
  * @version CVS $Id$
  */
 public interface LayoutEvent extends ActionEvent {
-    
+
     // just a marker interface
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Publisher.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Publisher.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Publisher.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Publisher.java Thu Jul 14 08:11:52 2005
@@ -15,7 +15,6 @@
  */
 package org.apache.cocoon.portal.event;
 
-
 /**
  * <tt>Publisher</tt> produces or publishes events that are brokered by <tt>EventManager</tt>
  * and of which the appropriate subscribers are informed of.
@@ -23,11 +22,11 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * @author Mauro Talevi
- * 
- * @version CVS $Id: Publisher.java,v 1.2 2004/03/05 13:02:11 bdelacretaz Exp $
+ *
+ * @version CVS $Id$
  */
 public interface Publisher {
-    
+
     /**
      *  Publishes an event for subscribers to be informed of.
      *

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Receiver.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Receiver.java?rev=219049&view=auto
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Receiver.java (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Receiver.java Thu Jul 14 08:11:52 2005
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.event;
+
+/**
+ * A receiver registers its interest in a class
+ * of events through the {@link org.apache.cocoon.portal.event.EventManager}.
+ * An event is an object of the interface {@link org.apache.cocoon.portal.event.Event}
+ * or a subclass/interface of it. Usually a receiver is not interested in
+ * every event but only for some specific event types. These types are represented
+ * by an own subclass/interface.
+ * When a receiver subscribes itself at the event manager, the manager checks (using
+ * reflection) for occurances of the method "inform" on the receiver. The signature
+ * of the method consists of two parameters, where the first one is the event subclass
+ * and the second one the PortalService.
+ * If for example a receiver is interested in all {@link org.apache.cocoon.portal.event.CopletInstanceEvent}s
+ * then it subscribes using the event manager and should provide an inform method
+ * with the following signature:
+ * public void inform(CopletInstanceEvent event, PortalService).
+ *
+ * If a receiver is interested in more than one event type, then it can implement
+ * several inform methods each with the corresponding event class as the first
+ * parameter.
+ *
+ * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
+ *
+ * @version CVS $Id$
+ */
+public interface Receiver {
+
+    // THIS IS JUST A MARKER INTERFACE!
+}

Propchange: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Receiver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Receiver.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Register.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Register.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Register.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Register.java Thu Jul 14 08:11:52 2005
@@ -19,12 +19,13 @@
 /**
  * <tt>Register</tt> allows a <tt>Subscriber</tt> to subscribe to 
  * and unsubscribe from <tt>EventManager</tt>.
- *  
+ *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * @author Mauro Talevi
- * 
- * @version CVS $Id: Register.java,v 1.2 2004/03/05 13:02:11 bdelacretaz Exp $
+ * @deprecated Use {@link org.apache.cocoon.portal.event.EventManager#subscribe(Receiver)} instead.
+ *
+ * @version CVS $Id$
  */
 public interface Register {
     

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/RequestEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/RequestEvent.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/RequestEvent.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/RequestEvent.java Thu Jul 14 08:11:52 2005
@@ -16,12 +16,12 @@
 package org.apache.cocoon.portal.event;
 
 /**
- * Marker interface for portal event 
+ * Marker interface for portal event.
  *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
- * 
- * @version CVS $Id: RequestEvent.java,v 1.2 2004/03/05 13:02:11 bdelacretaz Exp $
+ *
+ * @version CVS $Id$
  */
 public interface RequestEvent 
     extends Event {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Subscriber.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Subscriber.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Subscriber.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/Subscriber.java Thu Jul 14 08:11:52 2005
@@ -16,39 +16,38 @@
 package org.apache.cocoon.portal.event;
 
 /**
- * <tt>Subscriber</tt> registers its interest in a class of events and 
+ * <tt>Subscriber</tt> registers its interest in a class of events and
  * filters the events of which it should be notified.
  *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * @author Mauro Talevi
- * 
- * @version CVS $Id: Subscriber.java,v 1.2 2004/03/05 13:02:11 bdelacretaz Exp $
+ * @deprecated Use the {@link org.apache.cocoon.portal.event.Receiver} instead.
+ *
+ * @version CVS $Id$
  */
 public interface Subscriber {
-    
+
     /**
      *  Returns the event type of the event on which the Subscriber is interested.
      *  The event type is encoded by a <tt>Class</tt>.
      *
-     *  @return the <tt>Class</tt> encoding the event type  
+     *  @return the <tt>Class</tt> encoding the event type
      */
-     Class getEventType();
+    Class getEventType();
 
     /**
-     *  Returns the filter used to select the events in which the subscriber is 
+     *  Returns the filter used to select the events in which the subscriber is
      *  interested.
      *
-     *  @return the <tt>Filter</tt> 
+     *  @return the <tt>Filter</tt>
      */
-     Filter getFilter();
-     
+    Filter getFilter();
+
     /**
      * Callback method informing the Subscriber of the occurence of an event.
      *
      * @param event the <tt>Event</tt> of which the <tt>Subscriber</tt> is informed
      */
-     void inform( Event event );
+    void inform( Event event );
 }
-
-

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspect.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspect.java Thu Jul 14 08:11:52 2005
@@ -23,12 +23,12 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: EventAspect.java,v 1.2 2004/03/05 13:02:12 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public interface EventAspect extends Component {
 
     String ROLE = EventAspect.class.getName();
-    
+
     void process(EventAspectContext context,
-                  PortalService  service);
+                 PortalService  service);
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspectContext.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspectContext.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspectContext.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspectContext.java Thu Jul 14 08:11:52 2005
@@ -27,7 +27,7 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: EventAspectContext.java,v 1.2 2004/03/05 13:02:12 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public interface EventAspectContext {
     
@@ -47,10 +47,11 @@
     EventConverter getEventConverter();
     
     /**
-     * Get the publisher
+     * Get the publisher.
+     * @deprecated The aspect can use the portal service to publish events.
      */
     Publisher getEventPublisher();
-    
+
     /**
      * Get the object model
      */

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/AbstractContentEventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/AbstractContentEventAspect.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/AbstractContentEventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/AbstractContentEventAspect.java Thu Jul 14 08:11:52 2005
@@ -26,7 +26,7 @@
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.event.Event;
-import org.apache.cocoon.portal.event.Publisher;
+import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.event.aspect.EventAspect;
 import org.apache.cocoon.portal.event.aspect.EventAspectContext;
 import org.apache.cocoon.portal.layout.Layout;
@@ -62,7 +62,7 @@
      * @param layout  The corresponding layout
      * @param values  The values contained in the request
      */
-    protected abstract void publish(Publisher publisher, Layout layout, String[] values);
+    protected abstract void publish(EventManager publisher, Layout layout, String[] values);
     
     /**
      * Publish the event.
@@ -70,7 +70,7 @@
      * values and invokes {@link #publish(Publisher, Layout, String[])}.
      * @param values The values contained in the request
      */
-    protected void publish( PortalService service, Publisher publisher, String[] values) {
+    protected void publish( PortalService service, EventManager publisher, String[] values) {
         Layout layout = service.getComponentManager().getProfileManager().getPortalLayout(values[0], values[1] );
         if ( layout != null ) {
             this.publish( publisher, layout, values);
@@ -84,7 +84,7 @@
         final Request request = ObjectModelHelper.getRequest(context.getObjectModel());
         String[] values = request.getParameterValues(this.getRequestParameterName());
         if (values != null) {
-            final Publisher publisher = context.getEventPublisher();
+            final EventManager publisher = service.getComponentManager().getEventManager();
             for (int i = 0; i < values.length; i++) {
                 // first try to make an event out of the value of the parameter
                 final String value = values[i];
@@ -92,7 +92,7 @@
                 try {
                     e = context.getEventConverter().decode(value);
                     if (null != e) {
-                        publisher.publish(e);
+                        publisher.send(e);
                     }
                 } catch (Exception ignore) {
                     // ignroe it

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ActionCounterEventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ActionCounterEventAspect.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ActionCounterEventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ActionCounterEventAspect.java Thu Jul 14 08:11:52 2005
@@ -36,15 +36,15 @@
  */
 public class ActionCounterEventAspect
 	extends AbstractLogEnabled
-	implements EventAspect, 
-                ThreadSafe,
-                Parameterizable {
+	implements EventAspect,
+               ThreadSafe,
+               Parameterizable {
+
     protected final static String ATTRIBUTE_NAME = ActionCounterEventAspect.class.getName();
-    
 
     /** The name of the parameter to check */
     protected String parameterName;
-    
+
 	/* (non-Javadoc)
 	 * @see org.apache.cocoon.portal.event.aspect.EventAspect#process(org.apache.cocoon.portal.event.aspect.EventAspectContext, org.apache.cocoon.portal.PortalService)
 	 */
@@ -52,7 +52,7 @@
         final String requestParameterName = context.getAspectParameters().getParameter("parameter-name", this.parameterName);
 
         int actionCount;
-        
+
         Integer actionValue = (Integer) service.getAttribute(ATTRIBUTE_NAME);
         if (null == actionValue) {
             actionValue = new Integer(0);
@@ -73,7 +73,7 @@
             } catch (Exception ignore) {
                 number = -1;
             }
-            
+
             if ( number == actionCount - 1) {
                 // and invoke next one
                 context.invokeNext( service );
@@ -88,7 +88,6 @@
         response.setHeader("Expires", "Thu, 01 Jan 2000 00:00:00 GMT");
 	}
 
-
     /* (non-Javadoc)
      * @see org.apache.avalon.framework.parameters.Parameterizable#parameterize(org.apache.avalon.framework.parameters.Parameters)
      */
@@ -96,5 +95,4 @@
     throws ParameterException {
         this.parameterName = parameters.getParameter("parameter-name", "cocoon-portal-action");
     }
-
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ConvertableEventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ConvertableEventAspect.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ConvertableEventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ConvertableEventAspect.java Thu Jul 14 08:11:52 2005
@@ -49,8 +49,10 @@
 
     protected ServiceManager manager;
 
-    public void service(ServiceManager manager) throws ServiceException
-    {
+    /**
+     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+     */
+    public void service(ServiceManager manager) throws ServiceException {
         this.manager = manager;
     }
 
@@ -110,4 +112,4 @@
         }
         return event;
     }
-}
\ No newline at end of file
+}

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java Thu Jul 14 08:11:52 2005
@@ -16,7 +16,7 @@
 package org.apache.cocoon.portal.event.aspect.impl;
 
 import org.apache.cocoon.portal.event.Event;
-import org.apache.cocoon.portal.event.Publisher;
+import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.event.impl.ChangeAspectDataEvent;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.impl.FrameLayout;
@@ -27,7 +27,7 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: FrameEventAspect.java,v 1.9 2004/03/05 13:02:12 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class FrameEventAspect extends AbstractContentEventAspect {
 
@@ -43,12 +43,12 @@
     /* (non-Javadoc)
      * @see org.apache.cocoon.portal.event.aspect.impl.AbstractContentEventAspect#publish(org.apache.cocoon.portal.event.Publisher, org.apache.cocoon.portal.layout.Layout, java.lang.String[])
      */
-    protected void publish(Publisher publisher,
+    protected void publish(EventManager publisher,
                              Layout layout,
                              String[] values) {
         if (layout instanceof FrameLayout) {
             final Event e = new ChangeAspectDataEvent(layout, "frame", values[2]);
-            publisher.publish(e);
+            publisher.send(e);
         } else {
             this.getLogger().warn(
                 "the configured layout: "

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FullScreenCopletEventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FullScreenCopletEventAspect.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FullScreenCopletEventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FullScreenCopletEventAspect.java Thu Jul 14 08:11:52 2005
@@ -27,9 +27,7 @@
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.EventManager;
-import org.apache.cocoon.portal.event.Filter;
-import org.apache.cocoon.portal.event.Publisher;
-import org.apache.cocoon.portal.event.Subscriber;
+import org.apache.cocoon.portal.event.Receiver;
 import org.apache.cocoon.portal.event.aspect.EventAspect;
 import org.apache.cocoon.portal.event.aspect.EventAspectContext;
 import org.apache.cocoon.portal.event.impl.FullScreenCopletEvent;
@@ -51,7 +49,7 @@
                 ThreadSafe, 
                 Serviceable,
                 Disposable, 
-                Subscriber, 
+                Receiver, 
                 Initializable {
 
     protected ServiceManager manager;
@@ -71,12 +69,12 @@
         final Request request = ObjectModelHelper.getRequest( context.getObjectModel() );
         String[] values = request.getParameterValues( requestParameterName );
         if ( values != null ) {
-            final Publisher publisher = context.getEventPublisher();
+            final EventManager publisher = service.getComponentManager().getEventManager();
             for(int i=0; i<values.length; i++) {
                 final String current = values[i];
                 Event e = context.getEventConverter().decode(current);
                 if ( null != e ) {
-                    publisher.publish(e);
+                    publisher.send(e);
                     FullScreenCopletEvent fsce = (FullScreenCopletEvent)e;
                     if ( fsce.getLayout() != null) {
                         service.getComponentManager().getLinkService().addEventToLink( e );
@@ -85,17 +83,14 @@
             }
         } else {
             List list = (List) request.getAttribute("org.apache.cocoon.portal." + requestParameterName);
-            if (list != null)
-            {
+            if (list != null) {
                 FullScreenCopletEvent[] events =
                     (FullScreenCopletEvent[]) list.toArray(new FullScreenCopletEvent[0]);
-                final Publisher publisher = context.getEventPublisher();
-                for (int i = 0; i < events.length; i++)
-                {
+                final EventManager publisher = service.getComponentManager().getEventManager();
+                for (int i = 0; i < events.length; i++) {
                     FullScreenCopletEvent e = events[i];
-                    publisher.publish(e);
-                    if (e.getLayout() != null)
-                    {
+                    publisher.send(e);
+                    if (e.getLayout() != null) {
                         service.getComponentManager().getLinkService().addEventToLink(e);
                     }
                 }
@@ -105,26 +100,11 @@
         context.invokeNext( service );
 	}
 
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.event.Subscriber#getEventType()
-     */
-    public Class getEventType() {
-        return FullScreenCopletEvent.class;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.event.Subscriber#getFilter()
+    /**
+     * @see Receiver
      */
-    public Filter getFilter() {
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
-     */
-    public void inform(Event event) {
-        FullScreenCopletEvent e = (FullScreenCopletEvent) event;
-        final Layout startingLayout = (CopletLayout)e.getLayout();
+    public void inform(FullScreenCopletEvent event, PortalService service) {
+        final Layout startingLayout = (CopletLayout)event.getLayout();
         PortalService portalService = null;
         try {
             portalService = (PortalService) this.manager.lookup(PortalService.ROLE);
@@ -151,18 +131,21 @@
         EventManager eventManager = null;
         try {
             eventManager = (EventManager) this.manager.lookup( EventManager.ROLE );
-            eventManager.getRegister().subscribe( this );
+            eventManager.subscribe( this );
         } finally {
             this.manager.release( eventManager );
         }
     }
 
+    /**
+     * @see org.apache.avalon.framework.activity.Disposable#dispose()
+     */
     public void dispose() {
         if ( this.manager != null ) {
             EventManager eventManager = null;
             try {
                 eventManager = (EventManager) this.manager.lookup( EventManager.ROLE );
-                eventManager.getRegister().unsubscribe( this );
+                eventManager.unsubscribe( this );
             } catch (Exception ignore) {
                 // ignore this here
             } finally {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/LinkEventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/LinkEventAspect.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/LinkEventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/LinkEventAspect.java Thu Jul 14 08:11:52 2005
@@ -16,7 +16,7 @@
 package org.apache.cocoon.portal.event.aspect.impl;
 
 import org.apache.cocoon.portal.event.Event;
-import org.apache.cocoon.portal.event.Publisher;
+import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.event.impl.ChangeAspectDataEvent;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.impl.LinkLayout;
@@ -25,7 +25,7 @@
  *
  * @author <a href="mailto:juergen.seitz@basf-it-services.com">J&uuml;rgen Seitz</a>
  * 
- * @version CVS $Id: LinkEventAspect.java,v 1.3 2004/03/05 13:02:12 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class LinkEventAspect extends AbstractContentEventAspect {
 
@@ -41,7 +41,7 @@
     /* (non-Javadoc)
      * @see org.apache.cocoon.portal.event.aspect.impl.AbstractContentEventAspect#publish(org.apache.cocoon.portal.event.Publisher, org.apache.cocoon.portal.layout.Layout, java.lang.String[])
      */
-    protected void publish(Publisher publisher,
+    protected void publish(EventManager publisher,
                              Layout layout,
                               String[] values) {
         if (layout instanceof LinkLayout) {
@@ -49,11 +49,11 @@
             Event e = new ChangeAspectDataEvent(linkLayout,
                                                 "link-layout-key",
                                                 values[2]);
-            publisher.publish(e);
+            publisher.send(e);
             e = new ChangeAspectDataEvent(linkLayout,
                                           "link-layout-id",
                                           values[3]);
-            publisher.publish(e);
+            publisher.send(e);
         } else {
             this.getLogger().warn(
                 "the configured layout: "

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/NoClientCachingEventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/NoClientCachingEventAspect.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/NoClientCachingEventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/NoClientCachingEventAspect.java Thu Jul 14 08:11:52 2005
@@ -27,17 +27,17 @@
  * This aspect implementation sets some headers on the response that tell
  * clients/proxies to not cache. This "disables" the back button on the
  * client.
- * 
+ *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * 
- * @version CVS $Id: NoClientCachingEventAspect.java,v 1.2 2004/04/07 12:03:46 cziegeler Exp $
+ * @version CVS $Id$
  */
 public class NoClientCachingEventAspect
 	extends AbstractLogEnabled
-	implements EventAspect, 
-                ThreadSafe {
+	implements EventAspect,
+               ThreadSafe {
 
-    /* (non-Javadoc)
+    /**
 	 * @see org.apache.cocoon.portal.event.aspect.EventAspect#process(org.apache.cocoon.portal.event.aspect.EventAspectContext, org.apache.cocoon.portal.PortalService)
 	 */
 	public void process(EventAspectContext context, PortalService service) {
@@ -47,9 +47,7 @@
         response.addHeader("Cache-Control", "no-store");
         response.setHeader("Pragma", "no-cache");
         response.setHeader("Expires", "Thu, 01 Jan 2000 00:00:00 GMT");
-        
+
         context.invokeNext(service);
 	}
-
-
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/PageLabelEventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/PageLabelEventAspect.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/PageLabelEventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/PageLabelEventAspect.java Thu Jul 14 08:11:52 2005
@@ -28,7 +28,7 @@
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.impl.PageLabelManager;
 import org.apache.cocoon.portal.event.Event;
-import org.apache.cocoon.portal.event.Publisher;
+import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.event.aspect.EventAspect;
 import org.apache.cocoon.portal.event.aspect.EventAspectContext;
 
@@ -41,21 +41,26 @@
  *
  * @version CVS $Id:  $
  */
-public class PageLabelEventAspect extends AbstractLogEnabled
+public class PageLabelEventAspect
+    extends AbstractLogEnabled
 	implements EventAspect, ThreadSafe, Serviceable, Disposable {
 
     protected ServiceManager manager;
 
     protected PageLabelManager labelManager;
 
-    public void service(ServiceManager manager) throws ServiceException
-    {
+    /**
+     * @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.labelManager = (PageLabelManager)manager.lookup(PageLabelManager.ROLE);
     }
 
-    public void dispose()
-    {
+    /**
+     * @see org.apache.avalon.framework.activity.Disposable#dispose()
+     */
+    public void dispose() {
         if (this.manager != null) {
             if (this.labelManager != null) {
                 this.manager.release(this.labelManager);
@@ -65,12 +70,12 @@
         }
     }
 
-	/* (non-Javadoc)
+	/**
 	 * @see org.apache.cocoon.portal.event.aspect.EventAspect#process(org.apache.cocoon.portal.event.aspect.EventAspectContext, org.apache.cocoon.portal.PortalService)
 	 */
 	public void process(EventAspectContext context, PortalService service) {
         if (this.labelManager != null) {
-            final Publisher publisher = context.getEventPublisher();
+            final EventManager publisher = service.getComponentManager().getEventManager();
             final Request request = ObjectModelHelper.getRequest(context.getObjectModel());
             final String parameterName = this.labelManager.getRequestParameterName();
 
@@ -85,7 +90,7 @@
                     // Publish all the events for this page label.
                     while (iter.hasNext()) {
                         Event event = (Event) iter.next();
-                        publisher.publish(event);
+                        publisher.send(event);
                     }
             //        return;
                 }
@@ -94,4 +99,4 @@
 
         context.invokeNext( service );
 	}
-}
\ No newline at end of file
+}

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/RequestParameterEventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/RequestParameterEventAspect.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/RequestParameterEventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/RequestParameterEventAspect.java Thu Jul 14 08:11:52 2005
@@ -26,7 +26,7 @@
 import org.apache.cocoon.portal.LinkService;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.event.Event;
-import org.apache.cocoon.portal.event.Publisher;
+import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.event.aspect.EventAspect;
 import org.apache.cocoon.portal.event.aspect.EventAspectContext;
 
@@ -41,24 +41,26 @@
 	extends AbstractLogEnabled
 	implements EventAspect, ThreadSafe {
 
-    protected void process(EventAspectContext context, Request request, String parameterName) {
+    protected void process(EventAspectContext context,
+                           PortalService      service,
+                           Request            request, 
+                           String             parameterName) {
         String[] values = request.getParameterValues( parameterName );
+        final EventManager publisher = service.getComponentManager().getEventManager();
         if ( values != null ) {
-            final Publisher publisher = context.getEventPublisher();
             for(int i=0; i<values.length; i++) {
                 final String current = values[i];
                 final Event e = context.getEventConverter().decode(current);
                 if ( null != e) {
-                    publisher.publish(e);
+                    publisher.send(e);
                 }
             }
         } else {
             List list = (List) request.getAttribute("org.apache.cocoon.portal." + parameterName);
             if (list != null) {
                 Event[] events = (Event[]) list.toArray(new Event[0]);
-                final Publisher publisher = context.getEventPublisher();
                 for (int i = 0; i < events.length; i++) {
-                    publisher.publish(events[i]);
+                    publisher.send(events[i]);
                 }
             }
         }
@@ -76,13 +78,13 @@
         StringTokenizer tokenizer = new StringTokenizer(requestParameterNames, ", ");
         while ( tokenizer.hasMoreTokens() ) {
             final String currentName = tokenizer.nextToken();
-            this.process(context, request, currentName);
+            this.process(context, service, request, currentName);
             if ( LinkService.DEFAULT_REQUEST_EVENT_PARAMETER_NAME.equals(currentName) ) {
                 processedDefault = true;
             }
         }
         if ( !processedDefault ) {
-            this.process( context, request, LinkService.DEFAULT_REQUEST_EVENT_PARAMETER_NAME );
+            this.process( context, service, request, LinkService.DEFAULT_REQUEST_EVENT_PARAMETER_NAME );
         }
         context.invokeNext( service );        
 	}

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/CopletStatusEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/CopletStatusEvent.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/CopletStatusEvent.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/CopletStatusEvent.java Thu Jul 14 08:11:52 2005
@@ -25,21 +25,21 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: CopletStatusEvent.java,v 1.3 2004/03/05 13:02:12 bdelacretaz Exp $
+ * @version CVS $Id$
  */
-public abstract class CopletStatusEvent 
+public abstract class CopletStatusEvent
     implements Event, ComparableEvent {
 
     protected CopletInstanceData coplet;
-    
+
     public CopletInstanceData getCopletInstanceData() {
         return this.coplet;
     }
-    
+
     public void setCopletInstanceData(CopletInstanceData data) {
         this.coplet = data;
     }
-    
+
     public boolean equalsEvent(ComparableEvent event) {
         if (event instanceof CopletStatusEvent) {
             return ((CopletStatusEvent)event).getCopletInstanceData().getId().equals( this.coplet.getId() );

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/DefaultEventAspectContext.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/DefaultEventAspectContext.java?rev=219049&r1=219048&r2=219049&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/DefaultEventAspectContext.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/DefaultEventAspectContext.java Thu Jul 14 08:11:52 2005
@@ -24,13 +24,14 @@
 import org.apache.cocoon.portal.event.Publisher;
 import org.apache.cocoon.portal.event.aspect.EventAspect;
 import org.apache.cocoon.portal.event.aspect.EventAspectContext;
+import org.apache.cocoon.util.Deprecation;
 
 /**
  *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: DefaultEventAspectContext.java,v 1.3 2004/03/05 13:02:12 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public final class DefaultEventAspectContext 
     implements EventAspectContext {
@@ -77,7 +78,8 @@
     /**
      * Get the publisher
      */
-    public Publisher getEventPublisher(){
+    public Publisher getEventPublisher() {
+        Deprecation.logger.info("The getEventPublisher() method in the EventAspectContext is deprecated.");
         return this.publisher;
     }
     



Mime
View raw message