You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2005/06/06 11:14:32 UTC

svn commit: r180271 - in /cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event: Filter.java Publisher.java Receiver.java Register.java Subscriber.java

Author: cziegeler
Date: Mon Jun  6 02:14:29 2005
New Revision: 180271

URL: http://svn.apache.org/viewcvs?rev=180271&view=rev
Log:
Update javadocs

Modified:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Filter.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Publisher.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Receiver.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Register.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Subscriber.java

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Filter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Filter.java?rev=180271&r1=180270&r2=180271&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Filter.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Filter.java Mon Jun  6 02:14:29 2005
@@ -16,10 +16,11 @@
 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>
@@ -30,15 +31,13 @@
  * @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/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Publisher.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Publisher.java?rev=180271&r1=180270&r2=180271&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Publisher.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Publisher.java Mon Jun  6 02:14:29 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.
@@ -28,7 +27,7 @@
  * @version CVS $Id$
  */
 public interface Publisher {
-    
+
     /**
      *  Publishes an event for subscribers to be informed of.
      *

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Receiver.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Receiver.java?rev=180271&r1=180270&r2=180271&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Receiver.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Receiver.java Mon Jun  6 02:14:29 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
+ * 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.
@@ -18,9 +18,22 @@
 /**
  * A receiver registers its interest in a class
  * of events through the {@link org.apache.cocoon.portal.event.EventManager}.
- * When such an event occurs, the receiver is invoked via a
- * inform(Event, PortalService)} method.
- * TODO: Describe reflection!
+ * 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>
  *

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Register.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Register.java?rev=180271&r1=180270&r2=180271&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Register.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Register.java Mon Jun  6 02:14:29 2005
@@ -19,31 +19,31 @@
 /**
  * <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
- * @deprecated Use {@link org.apache.cocoon.portal.event.EventManager#subscribe(Class, Receiver)} instead.
- * 
+ * @deprecated Use {@link org.apache.cocoon.portal.event.EventManager#subscribe(Receiver)} instead.
+ *
  * @version CVS $Id$
  */
 public interface Register {
-    
-     /**
-      * Subscribes a Subscriber to the EventManager.  
-      * The Subscriber abstracts all the information needed for the subscription.
-      * @param subscriber the Subscriber
-      * @see Subscriber
-      */
-     void subscribe( Subscriber subscriber );
-    
-     /**
-      * Unsubscribes an Subscriber from the EventManager.
-      * @param subscriber the Subscriber 
-      * @see Subscriber
-      */
-     void unsubscribe( Subscriber subscriber );
-     
+
+    /**
+     * Subscribes a Subscriber to the EventManager.
+     * The Subscriber abstracts all the information needed for the subscription.
+     * @param subscriber the Subscriber
+     * @see Subscriber
+     */
+    void subscribe( Subscriber subscriber );
+
+    /**
+     * Unsubscribes an Subscriber from the EventManager.
+     * @param subscriber the Subscriber
+     * @see Subscriber
+     */
+    void unsubscribe( Subscriber subscriber );
+
 } 
 
 

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Subscriber.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Subscriber.java?rev=180271&r1=180270&r2=180271&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Subscriber.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/Subscriber.java Mon Jun  6 02:14:29 2005
@@ -51,4 +51,3 @@
      */
     void inform( Event event );
 }
-