| It seems to me a reasonable assumption that the resolution of the entity listener annotation in the entities would be identical to the resolution of the listener annotations within the listener classes. Use Case:
abstract class AbstractListener {
@PostPersist void onPostPersist(Object o){
Broadcaster.broadcast(getTopic(), o);
}
protected abstract String getTopic();
}
class MyListener extends AbstractListener {
protected String getTopic(){
return "my/listener";
}
}
class MyOtherListener extends AbstractListener {
protected String getTopic(){
return "my/otherlistener";
}
}
It also seems, after looking at the code, that the listener lookups in both cases could be optimized a bit. So feature it is! |