Plugin is not initialized when related servlet is created

Hi, I just noticed that Plugin#initialize is not called (not not fully complete) when related servlet class loaded. In my case, plugin class is responsible for setup whole environement during initialization and servlet needs some resources created by the plugin.

My question is: what is the correct approach here? I wanted to get some resources from plugin via PluginManager but unfortunetly, initialize method is not yet done. Here is my example

Servlet’s contructor:

public PushServiceServlet() {
        plugin = (PushServicePlugin) XMPPServer.getInstance().getPluginManager().getPlugin("push-service");
        //plugin.snsClient <-snsClient is NULL at this point,          mapper = new ObjectMapper();

as you can see, I can get my plugin via plugin manager, however snsClient field is not yet initialized, and this will happen in Plugin#initialize method block. Shouldn servlet be loaded after plugin initialization? Part of plugin class code:

AmazonSNSClient snsClient;
    public void initializePlugin(PluginManager manager, File pluginDirectory) {
        credProvider = new PropertiesCredentialsProvider();
        snsClient = new AmazonSNSClient(credProvider);