Menu

#1 event notifications

open
nobody
None
9
2013-03-23
2013-03-23
No

Event notification functionality it needed.
A component or user of the framework shall be able to send event notifications. A component shall be able to register for receiving event notifications.
There will be 2 modes: confirmed and unconfirmed
- in unconfirmed mode, the event will be a "fire and forget" event. The sender will send the event and immediately continue its processing.
- in confirmed mode, the sender will block until all clients of the event have processed it. This is useful in case some critical processing is linked to the firing of the event and the sender wants to make sure it has been processed before proceeding.

== What is an "Event" ==

An event will essentially be an immutable object carrying some information belonging
to a class of events associated with a name.

== How to send an event ==

The container shall offer a method for sending events. Components and users of the framework will be able to
use this method. The method will look like:
void sendEvent(Object event, String eventName, boolean confirmed)

== How will components receive events ==

Components will specify that are event listeners in the application description file.
inside the component definition there will be another element:
<receive eventName="xxx"/>

Components implementations will then need to annotate a method for receiving events,

@EventReceiver(Type="xxx")
public void methodName(Object event)

Discussion


Log in to post a comment.