Commit 61adb163 authored by Guus der Kinderen's avatar Guus der Kinderen Committed by GitHub

Revert "Use an event rather than an arbitrary delay before starting clustering"

This reverts commit b590a0f2.
parent 32ad02fa
...@@ -44,16 +44,6 @@ ...@@ -44,16 +44,6 @@
Hazelcast Clustering Plugin Changelog Hazelcast Clustering Plugin Changelog
</h1> </h1>
<p><b>2.2.3</b> -- September 5, 2017</p>
<ul>
<li>Use an event rather than an arbitrary delay before starting clustering</li>
</ul>
<p><b>2.2.2</b> -- August 3, 2017</p>
<ul>
<li>Ensure that Hazelcast backed Cache objects have the correct settings</li>
</ul>
<p><b>2.2.1</b> -- November 4, 2016</p> <p><b>2.2.1</b> -- November 4, 2016</p>
<ul> <ul>
<li>[<a href='http://www.igniterealtime.org/issues/browse/OF-1210'>OF-1210</a>] - correct time-to-live-seconds and MaxLifetime settings for hazelcast</li> <li>[<a href='http://www.igniterealtime.org/issues/browse/OF-1210'>OF-1210</a>] - correct time-to-live-seconds and MaxLifetime settings for hazelcast</li>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<name>Hazelcast plugin</name> <name>Hazelcast plugin</name>
<description>Adds clustering support</description> <description>Adds clustering support</description>
<author>Tom Evans</author> <author>Tom Evans</author>
<version>2.2.3</version> <version>2.2.2</version>
<date>09/05/2017</date> <date>08/03/2017</date>
<minServerVersion>4.0.0</minServerVersion> <minServerVersion>4.0.0</minServerVersion>
</plugin> </plugin>
...@@ -18,13 +18,14 @@ package org.jivesoftware.openfire.plugin; ...@@ -18,13 +18,14 @@ package org.jivesoftware.openfire.plugin;
import java.io.File; import java.io.File;
import java.io.FileFilter; import java.io.FileFilter;
import java.util.TimerTask;
import org.jivesoftware.openfire.XMPPServer; import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.cluster.ClusterManager; import org.jivesoftware.openfire.cluster.ClusterManager;
import org.jivesoftware.openfire.container.Plugin; import org.jivesoftware.openfire.container.Plugin;
import org.jivesoftware.openfire.container.PluginManager; import org.jivesoftware.openfire.container.PluginManager;
import org.jivesoftware.openfire.container.PluginManagerListener;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.TaskEngine;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -36,23 +37,21 @@ import org.slf4j.LoggerFactory; ...@@ -36,23 +37,21 @@ import org.slf4j.LoggerFactory;
* @author Tom Evans * @author Tom Evans
* @author Matt Tucker * @author Matt Tucker
*/ */
public class HazelcastPlugin implements Plugin { public class HazelcastPlugin extends TimerTask implements Plugin {
private static Logger logger = LoggerFactory.getLogger(HazelcastPlugin.class); private static Logger logger = LoggerFactory.getLogger(HazelcastPlugin.class);
public void initializePlugin(final PluginManager manager, final File pluginDirectory) { private static final long CLUSTER_STARTUP_DELAY_TIME =
logger.info("Waiting for other plugins to initialize before initializing clustering"); JiveGlobals.getLongProperty("hazelcast.startup.delay.seconds", 5);
manager.addPluginManagerListener(new PluginManagerListener() {
@Override public void initializePlugin(PluginManager manager, File pluginDirectory) {
public void pluginsMonitored() { // start cluster using a separate thread after a short delay
manager.removePluginManagerListener(this); // this will allow other plugins to initialize during startup
initializeClustering(); TaskEngine.getInstance().schedule(this, CLUSTER_STARTUP_DELAY_TIME*1000);
}
});
} }
private void initializeClustering() { @Override
logger.info("All plugins have initialized; initializing clustering"); public void run() {
// Check if another cluster is installed and stop loading this plugin if found // Check if another cluster is installed and stop loading this plugin if found
File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins"); File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins");
File[] jars = pluginDir.listFiles(new FileFilter() { File[] jars = pluginDir.listFiles(new FileFilter() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment