cancel
Showing results for 
Search instead for 
Did you mean: 

listener disables other listener in different bundle

Eric_Ace
Confirmed Champ
Confirmed Champ

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.

2 REPLIES 2

Kevin_Leturc
Star Contributor
Star Contributor

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

Eric_Ace
Confirmed Champ
Confirmed Champ

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

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.