Browse Prior Art Database

Improved Event Listener Registration Interface

IP.com Disclosure Number: IPCOM000122899D
Original Publication Date: 1998-Jan-01
Included in the Prior Art Database: 2005-Apr-04
Document File: 4 page(s) / 119K

Publishing Venue

IBM

Related People

Feigenbaum, BA: AUTHOR

Abstract

Disclosed is an improvement to the Event Listener interface defined by Java 1.1.x (hereafter known as Java). This improvement allows for an easier-to-program-to and more extendable interface than the current Java defined approach.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 34% of the total text.

Improved Event Listener Registration Interface

      Disclosed is an improvement to the Event Listener interface
defined by Java 1.1.x (hereafter known as Java).  This improvement
allows for an easier-to-program-to and more extendable interface than
the current Java defined approach.

Key claims:
  1.  Easier to program than standard Java 1.1 event model.
  2.  More dynamic than Java 1.1 event model.
  3.  More object-oriented (and thus more extendable) than
       Java 1.1 event model.
  4.  Applicable to event processing situations beyond the Java
       language.

      In Java, events represent asynchronous (i.e., order and
inter-arrival time cannot be predicted) activities.  Examples are
either hardware related (such as key presses, mouse movements,
timeouts, etc.)  or software related (such as the user selecting a
choice from a menu or  pressing a Graphical User Interface (GUI)
button).  Events are defined  in a hierarchy (i.e., using Java
inheritance from an Event top level class).  Listeners are also
defined in a hierarchy (again using inheritance from a Listener top
level class).

      Java defines a registered Listener and call-back approach to
handling events.  Any unit of code that needs to know when a
particular event occurs registers a listener (another piece of code
such as a service or method) for the event with the event source.
When the event  actually occurs, the event source then calls a
"call-back" (a predefined  method) in the listener to signal the
event's occurrence.  See the example below.

      Assume a Source can generate three event types (Event1, Event2
and Event3).  Also, assume a Listener wants to handle each of them.

(time increases downward):
  Event Source (called S)        Event Listener (called L)
  --------------------------- ----------------------------
            º         addEventsListener(L)   º
            º<-------------------------------º
            º         registerListener       º
            º                                º
            º             :                  º
            º                                º
            º         event1(S, E1)          º
            º------------------------------->º
            º         signal Event 1         º
            º                                º
            º             :                  º
            º                                º
            º         event1(S, E1')         º
            º------------------------------->º
          ...