home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 July / Chip_1998-07_cd.bin / zkuste / JBuilder / BDK / Win / bdk_sep97.exe / _SETUP.1 / EncapsulatedEventManager.java < prev    next >
Encoding:
Java Source  |  1997-09-10  |  4.3 KB  |  142 lines

  1. /*
  2.  *
  3.  * @(#) EncapsulatedEventManager.java 1.4@(#)
  4.  *
  5.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  6.  * 
  7.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  8.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  9.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  10.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  11.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  12.  * THIS SOFTWARE OR ITS DERIVATIVES.
  13.  * 
  14.  */
  15.  
  16. /**
  17.  * <p>
  18.  * sunw.demo.encapsulatedEvents.EncapsulatedEventManager
  19.  * </p>
  20.  *
  21.  * @version 1.0
  22.  * @author Laurence P. G. Cable.
  23.  * 
  24.  */
  25.  
  26. package sunw.demo.encapsulatedEvents;
  27.  
  28. import sunw.demo.encapsulatedEvents.EncapsulatedEvent;
  29. import sunw.demo.encapsulatedEvents.EncapsulatedEventListener;
  30.  
  31. /**
  32.  * <p>
  33.  * Containers or other "manager"-like objects wishing to offer an encapsulated
  34.  * event stream from its "set" of containees or "managed" objects, should 
  35.  * implement this interface to expose this facility.
  36.  * </p>
  37.  * <p>
  38.  * Arbitrary objects wishing to observe the event stream from a particular
  39.  * event source, should locate that event sources EncapsulatedEventManager
  40.  * and use this interface on that instance to obtain such an event stream.
  41.  * </p>
  42.  * @seealso sunw.demo..encapsulatedEvents.EncapsulatedEvent
  43.  * @seealso sunw.demo..encapsulatedEvents.EncapsulatedEventListener
  44.  * @seealso sunw.demo..encapsulatedEvents.EncapsulatedEventAdaptor
  45.  */
  46.  
  47. public interface EncapsulatedEventManager {
  48.  
  49.     /**
  50.      * <p>
  51.      * Called to determine the events that a particular source emits. Will throw
  52.      * IllegalArgumentException if s is not managed by this
  53.      * EncapsulatedEventManager.
  54.      * </p>
  55.      *
  56.      * @param s the event source
  57.      *
  58.      * @return list of java.util.EventListener sub-interfaces that s sources or null.
  59.      *
  60.      * @throws IllegalArgumentException
  61.      * @throws NullPointerException
  62.      */
  63.  
  64.     Class[] getSourceEventListenerInterfaces(Object s);
  65.  
  66.     /**
  67.      * <p>
  68.      * Adds the listener eel to the source s to receive ALL events s emits
  69.      * as encpasulated events. Will throw IllegalArgumentException if s is
  70.      * not managed by this EncapsulatedEventManager.
  71.      * </p>
  72.      *
  73.      * @param s        the event source
  74.      * @param eel    the listener
  75.      *
  76.      * @throws IllegalArgumentException
  77.      * @throws NullPointerException
  78.      */
  79.  
  80.     void addEncapsulatedEventListener(Object s, EncapsulatedEventListener eel);
  81.  
  82.     /**
  83.      * <p>
  84.      * Removes the listener eel from the source s, thus unregistering eel from
  85.      * receiving encapsulated events for all the events that s emits.
  86.      * Will throw IllegalArgumentException if s is not managed by this
  87.      * EncapsulatedEventManager.
  88.      * </p>
  89.      *
  90.      * @param s        the event source
  91.      * @param eel    the listener
  92.      *
  93.      * @throws IllegalArgumentException
  94.      * @throws NullPointerException
  95.      */
  96.  
  97.     void removeEncapsulatedEventListener(Object s, EncapsulatedEventListener eel);
  98.  
  99.     /**
  100.      * <p>
  101.      * Adds the listener eel to the source s to receive the events enumerated
  102.      * by lc that s emits. Will throw IllegalArgumentException if s is not
  103.      * managed by this EncapsulatedEventManager or if lc contains a reference
  104.      * to a Class that s does not emit events on.
  105.      * </p>
  106.      *
  107.      * @param s        the event source
  108.      * @param eel    the listener
  109.      * @param lc    the list of events to register the eel to receive.
  110.      *
  111.      * @throws IllegalArgumentException
  112.      * @throws NullPointerException
  113.      */
  114.  
  115.     void addEncapsulatedEventListener(Object                s,
  116.                                EncapsulatedEventListener eel,
  117.                                Class[]              lc
  118.     );
  119.  
  120.     /**
  121.      * <p>
  122.      * Removes the listener eel from the source s, thus unregistering for 
  123.      * encapsulated events from s enumerated by lc. Will throw
  124.      * IllegalArgumentException if s is not managed by this
  125.      * EncapsulatedEventManager or if lc contains a reference
  126.      * to a Class that s does not emit events on. 
  127.      * </p>
  128.      *
  129.      * @param s        the event source
  130.      * @param eel    the listener
  131.      * @param lc    the list of events to unregister the eel from receiving.
  132.      *
  133.      * @throws IllegalArgumentException
  134.      * @throws NullPointerException
  135.      */
  136.  
  137.     void removeEncapsulatedEventListener(Object                    s,
  138.                      EncapsulatedEventListener eel,
  139.                              Class[]           lc
  140.     );
  141. }
  142.