How to instantiate modules in a specific order?

In a plugin, I need to instantiate module A before module B.

This doesn’t seem to allow for that: https://developer.atlassian.com/server/framework/atlassian-sdk/creating-plugin-module-instances/

What type of module are we talking about?

Can you pull out your logic so that it’s in a separate component that you can then inject into things? Or perhaps use lifecycleaware to call things yourself?

So A is just a component that functions as an event listener. It needs a custom-field type to write certain values in it. I can’t find a way how to instantiate the custom-field type directly inside the afterPropertiesSet life-cycle method of A.

Right now the custom-field type is created in a module B. It is referenced in atlassian-plugin.xml and the implementing class is not a component and and therefore doesn’t have life-cycle methods. My understanding is that the custom-field-type class is instantiated by the atlassian plugin framework based on the entries atlassian-plugin.xml.

Try having A implement the Lifycycleaware interface from SAL. The onStart method will be called once your app has been completely started…

It was worth a try, but it seems onStart is called right after the plugin is enabled. At this point the custom-field-type is not yet yet created :confused: