From 24246a7289abc46b6ca6becca2de33d840bc0cc0 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Fri, 6 Sep 2024 16:19:03 +0200 Subject: [PATCH] Fix compatibility with Openfire 4.9.0 This commit replaces usage of API that is removed in Openfire 4.9.0. The replacement API was already available in Openfire 4.8.1, which remains the minimum version required by this plugin. --- changelog.html | 1 + plugin.xml | 2 +- .../org/jivesoftware/openfire/plugin/HazelcastPlugin.java | 4 ++-- .../openfire/plugin/util/cache/ClusterClassLoader.java | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/changelog.html b/changelog.html index 578a14261..665392d67 100644 --- a/changelog.html +++ b/changelog.html @@ -47,6 +47,7 @@

3.0.0 -- (tbd)

NOTE: This version of the plugin requires Openfire 4.8.1 or higher diff --git a/plugin.xml b/plugin.xml index d596d1078..71a09e9f4 100644 --- a/plugin.xml +++ b/plugin.xml @@ -6,7 +6,7 @@ ${project.description} Ignite Realtime ${project.version} - 2024-02-08 + 2024-09-06 4.8.1 1.8 diff --git a/src/java/org/jivesoftware/openfire/plugin/HazelcastPlugin.java b/src/java/org/jivesoftware/openfire/plugin/HazelcastPlugin.java index 181c4ef21..3bfcb1dd4 100644 --- a/src/java/org/jivesoftware/openfire/plugin/HazelcastPlugin.java +++ b/src/java/org/jivesoftware/openfire/plugin/HazelcastPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Jive Software, 2022 Ignite Realtime Foundation. All rights reserved. + * Copyright (C) 2004-2009 Jive Software, 2022-2024 Ignite Realtime Foundation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,7 +80,7 @@ private void initializeClustering(final File hazelcastPluginDirectory) { LOGGER.info("All plugins have initialized; initializing clustering"); try { - final Path pathToLocalHazelcastConfig = Paths.get(JiveGlobals.getHomeDirectory(), "conf/hazelcast-local-config.xml"); + final Path pathToLocalHazelcastConfig = JiveGlobals.getHomePath().resolve("conf/hazelcast-local-config.xml"); if (!Files.exists(pathToLocalHazelcastConfig)) { Files.copy(Paths.get(hazelcastPluginDirectory.getAbsolutePath(), "classes/hazelcast-local-config.template.xml"), pathToLocalHazelcastConfig); } diff --git a/src/java/org/jivesoftware/openfire/plugin/util/cache/ClusterClassLoader.java b/src/java/org/jivesoftware/openfire/plugin/util/cache/ClusterClassLoader.java index 8c6f70035..61618e184 100644 --- a/src/java/org/jivesoftware/openfire/plugin/util/cache/ClusterClassLoader.java +++ b/src/java/org/jivesoftware/openfire/plugin/util/cache/ClusterClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 Jive Software. All rights reserved. + * Copyright (C) 2007-2009 Jive Software, 2024 Ignite Realtime Foundation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ public class ClusterClassLoader extends ClassLoader { private static final SystemProperty HAZELCAST_CONFIG_DIR = SystemProperty.Builder.ofType(String.class) .setKey("hazelcast.config.xml.directory") - .setDefaultValue(JiveGlobals.getHomeDirectory() + "/conf") + .setDefaultValue(JiveGlobals.getHomePath().resolve("conf").toString()) .setDynamic(false) .setPlugin(HazelcastPlugin.PLUGIN_NAME) .build();