1. package Events.Listeners is 
  2.  
  3.     -- Any class can implement the Event_Listener interface so it can register 
  4.     -- with an event corral to receive events. Handle_Event will be called on 
  5.     -- the listener when an event that the listener was registered for, fires. 
  6.     type Event_Listener is limited interface; 
  7.     type A_Event_Listener is access all Event_Listener'Class; 
  8.  
  9.     -- Handles an event the Event_Listener registered for. If 'evt' is returned 
  10.     -- null then the event was consumed and will not be passed on to other 
  11.     -- listeners. 'resp' is the handler's response to synchronous events that 
  12.     -- will be returned to a caller that triggered a synchronous event. 
  13.     procedure Handle_Event( this : access Event_Listener; 
  14.                             evt  : in out A_Event; 
  15.                             resp : out Response_Type ) is abstract; 
  16.  
  17.     -- Returns a string that identifies the Event_Listener object. 
  18.     function To_String( this : access Event_Listener ) return String is abstract; 
  19.  
  20. end Events.Listeners;