This is not a new idea, because the main functionallity already exists.
BUT, There is one part missing. The extension manager that triggers the events.
According to the documentstion:
<!ELEMENT task (run)*>
class CDATA #REQUIRED
id IDREF #REQUIRED
description CDATA #IMPLIED
runOnStart (true | false)
triggered (true | false)
filter CDATA #IMPLIED>
•class - Fully qualified class name, must extend com.ibm.dots.task.AbstractServerTask.
•id - Unique id for this task
•description - Task description
•runOnStart - Indicates if the task should be run once when the javaddin task starts. True by default
•triggered - If true, this task will be triggered by extension manager event. RunWhen contains the information about the event.
•filter - Optional class that must implement the com.ibm.dots.task.ITaskFilterITaskFilter interface to dynamically prevent this task from loading in the container.