@Override
            public void run() {
                try {
                    // Sleep for 5 seconds before starting to work. This is required because
                    // this module has a dependency on the PluginManager, which is loaded
                    // after all other modules.
                    Thread.sleep(5000);
                    // Load last saved information (if any)
                    loadSavedInfo();
                    while (isServiceEnabled()) {
                        waitForNextCheck();
                        // Check if the service is still enabled
                        if (isServiceEnabled()) {
                            try {
                                // Check for server updates
                                checkForServerUpdate(true);
                                // Refresh list of available plugins and check for plugin updates
                                checkForPluginsUpdates(true);
                            }
                            catch (Exception e) {
                                Log.error("Error checking for updates", e);
                                if (e instanceof InterruptedException) {
                                    Thread.currentThread().interrupt();
                                }
                            }
                            // Keep track of the last time we checked for updates.
                            // Openfire SystemProperties store as truncated to millis
                            final Instant lastUpdate = Instant.now().truncatedTo(ChronoUnit.MILLIS);
                            LAST_UPDATE_CHECK.setValue(lastUpdate);
                            // As an extra precaution, make sure that that the value
                            // we just set is saved. If not, return to make sure that
                            // no additional update checks are performed until Openfire
                            // is restarted.
                            if(!lastUpdate.equals(LAST_UPDATE_CHECK.getValue())) {
                                Log.error("Error: update service check did not save correctly. " +
                                        "Stopping update service.");
                                return;
                            }
                        }
                    }
                }
                catch (InterruptedException e) {
                    Log.error(e.getMessage(), e);
                    Thread.currentThread().interrupt();
                }
                finally {
                    // Clean up reference to this thread
                    thread = null;
                }
            }
Starts sevice that checks for new updates.
xmppserver/src/main/java/org/jivesoftware/openfire/update/UpdateManager.java