brianchandotcom/liferay-portal — pull request #18138 by matethurzo (2014-04-24 14:05:04+00:00)
Title: LPS-46227 Refactoring SystemEvents a bit

Hey Brian,

We have come across some problems with the system events and I've been performing some changes regarding it.

The primary concern is that the API is not straightforward for a developer, for example the send attribute in the annotation does not mean it's won't send an event because if it has an associated asset entry it will send anyway.

Also due to this asset entry side effect we had to hack with the SystemEventHierarcheEntryThreadLocal in several cases. Now in this pull I've removed these hacks where I could (in some cases we still need these in weird situations)

The third concern is that the SystemEvent annotation is providing a clear, declarative approach to this programming problem, but these hackings and the asset entry side effect is mixing the picture. In some cases we did not have the declaration on a service that is should throw events but it did due to the side effect.

The changes in the pull making the code a bit easier to understand, and maintain.

Thanks,

Máté

reviewed by @danielkocsis