org.omnaest.utils.events
Interface EventHandler<EVENT,RESULT>


public interface EventHandler<EVENT,RESULT>

Declares the consumer of events.
Subclasses will get references to EventProducer instances and will register their EventListener to these. This gives the control to the EventHandler at holding the references to the EventProducer, too. The EventHandler can so decide to unregister at any given time.
Since the EventHandler is often used to hold controlling business logic this kind of component referencing will better reflect the logic requirements.

Author:
Omnaest

Method Summary
 EventHandler<EVENT,RESULT> registerAtEventProducers()
          Registers itself via EventListener instances at the internally hold references to EventProducer instances
 EventHandler<EVENT,RESULT> setEventProducers(Iterable<? extends EventProducer> eventProducers)
          Sets a ordered List of EventProducer references to the EventHandler.
 EventHandler<EVENT,RESULT> unregisterAtEventProducers()
          Unregisters all its EventListener from the EventProducer instances
 

Method Detail

setEventProducers

EventHandler<EVENT,RESULT> setEventProducers(Iterable<? extends EventProducer> eventProducers)
Sets a ordered List of EventProducer references to the EventHandler.

Parameters:
eventProducers -
Returns:
See Also:
registerAtEventProducers(), unregisterAtEventProducers()

registerAtEventProducers

EventHandler<EVENT,RESULT> registerAtEventProducers()
Registers itself via EventListener instances at the internally hold references to EventProducer instances

Returns:
this
See Also:
unregisterAtEventProducers()

unregisterAtEventProducers

EventHandler<EVENT,RESULT> unregisterAtEventProducers()
Unregisters all its EventListener from the EventProducer instances

Returns:
See Also:
registerAtEventProducers()


Copyright © 2013. All Rights Reserved.