Package org.glassfish.api.event
Interface Events
@Contract
public interface Events
Contract to register/unregister events listener.
This implementation is not meant to be used for performance sensitive message delivery.
- Author:
- Jerome Dochez
-
Method Summary
Modifier and TypeMethodDescriptionvoidregister(EventListener listener) Registers a new listener for global events.voidsend(EventListener.Event<?> event) Sends an event asynchronously.voidsend(EventListener.Event<?> event, boolean asynchronously) Sends an event to all listener synchronously or asynchronously.booleanunregister(EventListener listener) Unregisters a listener.
-
Method Details
-
register
Registers a new listener for global events.- Parameters:
listener- the new listener
-
unregister
Unregisters a listener.- Parameters:
listener- the register to remove- Returns:
trueif the removal was successful
-
send
Sends an event asynchronously.- Parameters:
event- event to send
-
send
Sends an event to all listener synchronously or asynchronously.- Parameters:
event- event to sendasynchronously-trueif the event should be sent asynchronously
-