Package net.sf.mmm.util.event.api

Provides the API for a generic event-handling.

See:
          Description

Interface Summary
ChangeEvent A ChangeEvent is an Event that informs about something that has been added, updated or removed.
Event This is the interface for a generic event.
EventListener<E extends Event> This is the interface for a generic event listener.
EventSource<E extends Event,L extends EventListener<E>> This interface allows listeners to be registered and unregistered.
 

Enum Summary
ChangeType This enum contains the available types of a ChangeEvent.
 

Package net.sf.mmm.util.event.api Description

Provides the API for a generic event-handling.

Event-Util API

It is a common pattern to register a listener for events that notify of a specific situation. This pattern has been re-implemented thousands of times. Java generics allow to stop to re-invent the wheel and implement the pattern once in a generic way. This prevents you from typical mistakes as dead-locks in listeners that want to de-register themselves during event-handling.
Create your custom event by implementing the marker interface
Event or if suitable implementing ChangeEvent. Then the producer of the events only needs to extend AbstractEventSource or one of its sub-classes.



Copyright © 2001-2010 mmm-Team. All Rights Reserved.