@Override
    public void initialize(XMPPServer server) {
        super.initialize(server);
        TaskEngine.getInstance().scheduleAtFixedRate(new TimeoutTask(), Duration.ofSeconds(5), Duration.ofSeconds(5));
        serverName = server.getServerInfo().getXMPPDomain();
        routingTable = server.getRoutingTable();
        multicastRouter = server.getMulticastRouter();
        iqHandlers.addAll(server.getIQHandlers());
        sessionManager = server.getSessionManager();
        userManager = server.getUserManager();
    }
Adds an {@link IQResultListener} that will be invoked when an IQ result
is sent to the server itself and is of type result or error. This is a
nice way for the server to send IQ packets to other XMPP entities and be
waked up when a response is received back.<p>

Once an IQ result was received, the listener will be invoked and removed
from the list of listeners.<p>

If no result was received within the specified amount of milliseconds,
the timeout method of the listener will be invoked and the listener will
be removed from the list of listeners.<p>

Note that the listener will remain active for <em>at least</em> the
specified timeout value. The listener will not be removed at the exact
moment it times out. Instead, purging of timed out listeners is a
periodic scheduled job.

@param id
           the id of the IQ packet being sent from the server to an XMPP
           entity.
@param listener
           the IQResultListener that will be invoked when an answer is
           received.
@param timeoutmillis
           The amount of milliseconds after which waiting for a response
           should be stopped.
xmppserver/src/main/java/org/jivesoftware/openfire/IQRouter.java