jmesnil/jboss-as — pull request #1 by jmesnil (2013-04-05 08:36:11+00:00)
Title: [AS7-370] Add Notification support to the domain management API

The features of this PR is described at https://community.jboss.org/wiki/AddNotificationSupportToTheDomainManagementAPI (HTML5 server-sent events are not implemented yet).

I'd like a code review of this PR as it touches many packages (model controller client + server handler, management service, resource registration, operation context, etc.)

1. This PR added global notifications every time a resource is added/removed or one of its attribute is written
1. As a POC, I also added notifications for server's lifecycle in domain mode (`server-{ started | stopped | restarted | killed | destroyed }`)
1. I've also added `started | stopped` notification to one messaging resource to show how any resource can emit notifications
1. the HTTP API is leveraging Undertow-based management service.
1. Notifications are buffered for every operation step and emitted only when the step completes.

Open questions:

1. The PR adds notification registration/unregistration in `ModelControllerClient API`. I have added types to the `ModelControllerProtocol`. I am not sure if I should also bump up the management protocol version...
1. A resource can describe the notifications it emits but there is no enforcement that when a notification is emitted it has properly described it. Ideally I want to enforce it but I need a way to access the resource registration from the operation context.