listener disables other listener in different bundle

I have a contribution that declares a listener as disabled. This declartion wants to disable a listener with the same name in another bundle:

in my bundle “A”: <listener name="..." class="..." enabled="false"/> in other bundle “Z”: <listener name="..." class="..."/>

The problem is that the bundle that contributes the listener that I'm trying to disable loads after my bundle. I've traced the framework code from FrameworkBootstrap.initialize and NuxeoStarter.contextInitialized all the way to EventListenerList.mergeDescriptor. The bundles are sorted in alpha order and so bundle “A” can't contribute a listener that disables a listener contributed in bundle “Z” if “Z”'s listener is defined as active. Last one registered wins.

Is there a way to register a callback after all the listeners are loaded and initialized to make any final adjustments such as what I'm trying to accomplish? Or what would be the recommended way to solve this? Thanks.

0 votes

2 answers



Never mind - I had the <require> tag in the wrong place and so the RegistrationInfoImpl instance was not initialized with the dependency … :-(

0 votes

Hi Eric,

In order to deploy your component after another one, you just need to add a require xml element with the component name you want to deploy before. In your case the component holding the enabled listener.

Let me know if you have trouble

0 votes