leosutic    2002/10/03 11:35:04

  Modified:    util/src/java/org/apache/excalibur/util MultiDelegate.java
  Log:
  Javadoc update.
  
  Revision  Changes    Path
  1.4       +8 -11     
jakarta-avalon-excalibur/util/src/java/org/apache/excalibur/util/MultiDelegate.java
  
  Index: MultiDelegate.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/util/src/java/org/apache/excalibur/util/MultiDelegate.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MultiDelegate.java        3 Oct 2002 18:10:26 -0000       1.3
  +++ MultiDelegate.java        3 Oct 2002 18:35:04 -0000       1.4
  @@ -64,15 +64,16 @@
    *         public void onEvent ();
    *     }
    *     
  - *     private final Listener eventDelegate = (Listener) 
MultiDelegateFactory.newMultiDelegate( Listener.class );
  + *     private final MultiDelegate event = Delegate.newMultiDelegate( 
Listener.class );
    *
  - *     // Expose the MultiDelegate's add and remove methods in a safe way.
  - *     // Make sure the field exposed is final.
  - *     public final MultiDelegate event = new MultiDelegateProxy( (MultiDelegate) 
eventDelegate );
  + *     public void registerListener( Listener listener )
  + *     {
  + *         event.add( listener );
  + *     }
    *
  - *     public void fireEvent () 
  + *     private void fireEvent () 
    *     {
  - *         eventDelegate.onEvent ();
  + *         ((Listener) event).onEvent ();
    *     }
    * }
    * </code></pre>
  @@ -82,10 +83,6 @@
    * <ul>
    * <li>We can cast the <code>MultiDelegate</code> instance to the interface given to
    * the <code>MultiDelegateFactory.newMultiDelegate</code> method. 
  - * <li>While we do expose a <code>MultiDelegate</code> interface to the client, we 
do so via a proxy. 
  - * This is because the <code>MultiDelegate</code> instance returned from the 
<code>MultiDelegateFactory</code> can 
  - * be cast to the delegate interface, meaning that a client can invoke 
<code>onEvent ()</code>
  - * on it.
    * </ul>
    * <p>
    * Subscribers/Listeners to the Publisher above can register themselves with:
  @@ -98,7 +95,7 @@
    *
    * public void registerWithPublisher( Publisher publisher )  
    * {
  - *    publisher.event.add( Delegate.newDelegate (this, "myEventHandler", 
Publisher.Listener.class) );
  + *    publisher.registerListener( (Listener) Delegate.newDelegate (this, 
"myEventHandler", Publisher.Listener.class) );
    * }
    * </code></pre>
    * <p>
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to