Registering Event Emitter
The RegisteringEventEmitter allows developers to constrain which events their Components are intended to listen for and emit. If a component attempts to emit or listen for an event that it hasn't explicitly listed, an exception will be thrown.
Registration occurs by creating a new instance of RegisteringEventEmitter, using a shared EventEmitter (typically EventEmitterImpl), and the class to be registered. The class in question MUST be decorated with two annotations: ListensFor and Emits. Each takes a String[], populated with EventType strings, attached to their 'events' property. Each annotation MUST be included, even if the component has no intention of listening or emitting any events.
For example, the following component class declartion:
@Emits(events = {EventType.PLAY, EventType.STOP})@ListensFor(events = {EventType.PLAY}) public class SampleComponent implements Component