Module it.rebirthproject.ufoeb
Class PriorityEventsRegistrationsMap
java.lang.Object
it.rebirthproject.ufoeb.dto.registrations.maps.interfaces.EventsRegistrationsMap
it.rebirthproject.ufoeb.dto.registrations.maps.PriorityEventsRegistrationsMap
The map used to add a
Registration using its priority. The priority
is relative to a precise event and higher priority listeners will be served
before. So, listeners that listen for a precise event using priority will be
ordered inside the registration list.
example: Listener A listen for event E1 with priority 5 Listener B listen for event E1 with priority 1 Listener C listen for event E2 with priority 0 if event E1 is posted to the bus then execution will be - First to be served is A with event E1 (since 5 is greater than 1) - Second to be server is B with event E1 - Listener C does not receive anything because it is listening to E2
- See Also:
-
Field Summary
Fields inherited from class it.rebirthproject.ufoeb.dto.registrations.maps.interfaces.EventsRegistrationsMap
registrations -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRegistration(BusEventKey eventKey, Registration registration) The method that adds a newRegistrationto theRegistrations map by priority.private voidaddRegistrationToTheListByPriority(List<Registration> registrationsList, Registration registration) Private helper method that inserts by priority aRegistrationin theRegistrations list.Methods inherited from class it.rebirthproject.ufoeb.dto.registrations.maps.interfaces.EventsRegistrationsMap
clear, containsKey, get, isEmpty, keySet, size
-
Constructor Details
-
PriorityEventsRegistrationsMap
public PriorityEventsRegistrationsMap()
-
-
Method Details
-
addRegistration
The method that adds a newRegistrationto theRegistrations map by priority.- Specified by:
addRegistrationin classEventsRegistrationsMap- Parameters:
eventKey- TheBusEventKeyused to add a newRegistration.registration- TheRegistrationto add.
-
addRegistrationToTheListByPriority
private void addRegistrationToTheListByPriority(List<Registration> registrationsList, Registration registration) Private helper method that inserts by priority aRegistrationin theRegistrations list.
-