For Observers maybe we can find another way to achieve OPENEJB-2082 without 
binding one observer directly to another:

   public void observe(final @Observes(after = SimpleObserver.class) 
SimpleEvent event)

I can see that creating just as much of a mess as having too many events.  
Having to sort each event is not exactly optimal for speed either.

If we were to take a sorting based approach, maybe we can take a page from the 
interceptor ordering of Java EE 7, based on unix start orders:

   @Priority(5)
   public void observe(final @Observes SimpleEvent event)

Default priority for all observers would be say, 5, like it is for a thread.  
We would recommend 1-10 as the range and use a float rather than an int so it 
can be easy to break a tie without complex hacking.

Also as an optimization, we don't actually call the sort method unless one of 
the Observers actually has a priority.

Thoughts?


-David

Reply via email to