Skip to content

Commit

Permalink
Remove unused code from ClusterListener
Browse files Browse the repository at this point in the history
fixes #102
  • Loading branch information
guusdk committed Nov 2, 2024
1 parent 2404715 commit d6a77ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
1 change: 1 addition & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ <h1>

<p><b>3.0.1</b> -- (To be determined)</p>
<ul>
<li>[<a href='https://github.com/igniterealtime/openfire-hazelcast-plugin/issues/102'>Issue #102</a>] - Remove unused code in ClusterListener</li>
</ul>

<p><b>3.0.0</b> -- September 12, 2024</p>
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>${project.description}</description>
<author>Ignite Realtime</author>
<version>${project.version}</version>
<date>2024-09-12</date>
<date>2024-11-02</date>
<minServerVersion>4.8.1</minServerVersion>
<minJavaVersion>1.8</minJavaVersion>
</plugin>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 1999-2009 Jive Software. All rights reserved.
* Copyright (C) 1999-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.
Expand All @@ -16,7 +16,6 @@
package org.jivesoftware.openfire.plugin.util.cache;

import com.hazelcast.cluster.Cluster;
import com.hazelcast.core.EntryListener;
import com.hazelcast.core.LifecycleEvent;
import com.hazelcast.core.LifecycleEvent.LifecycleState;
import com.hazelcast.core.LifecycleListener;
Expand All @@ -29,16 +28,13 @@
import org.jivesoftware.openfire.cluster.NodeID;
import org.jivesoftware.openfire.muc.cluster.NewClusterMemberJoinedTask;
import org.jivesoftware.openfire.plugin.util.cluster.HazelcastClusterNodeInfo;
import org.jivesoftware.util.cache.Cache;
import org.jivesoftware.util.cache.CacheFactory;
import org.jivesoftware.util.cache.CacheWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.Duration;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
Expand All @@ -54,8 +50,6 @@ public class ClusterListener implements MembershipListener, LifecycleListener {

private boolean seniorClusterMember = false;

private final Map<Cache<?,?>, EntryListener> entryListeners = new HashMap<>();

private final Cluster cluster;
private final Map<NodeID, ClusterNodeInfo> clusterNodesInfo = new ConcurrentHashMap<>();

Expand All @@ -80,17 +74,6 @@ public class ClusterListener implements MembershipListener, LifecycleListener {
}
}

private void addEntryListener(final Cache<?, ?> cache, final EntryListener listener) {
if (cache instanceof CacheWrapper) {
final Cache wrapped = ((CacheWrapper)cache).getWrappedCache();
if (wrapped instanceof ClusteredCache) {
((ClusteredCache)wrapped).addEntryListener(listener);
// Keep track of the listener that we added to the cache
entryListeners.put(cache, listener);
}
}
}

@SuppressWarnings("unchecked")
private boolean isDone() {
return done;
Expand Down

0 comments on commit d6a77ee

Please sign in to comment.