Commit 56b2d7b5 authored by Christian Schudt's avatar Christian Schudt

Merge pull request #134 from tevans/OF-859

OF-859: Pubsub fix; misc cleanup
parents 224b447d c5075d59
...@@ -70,8 +70,8 @@ public class SequenceManager { ...@@ -70,8 +70,8 @@ public class SequenceManager {
static { static {
new SequenceManager(JiveConstants.ROSTER, 5); new SequenceManager(JiveConstants.ROSTER, 5);
new SequenceManager(JiveConstants.OFFLINE, 1); new SequenceManager(JiveConstants.OFFLINE, 5);
new SequenceManager(JiveConstants.MUC_ROOM, 1); new SequenceManager(JiveConstants.MUC_ROOM, 5);
} }
/** /**
...@@ -237,7 +237,7 @@ public class SequenceManager { ...@@ -237,7 +237,7 @@ public class SequenceManager {
} }
if (!success) { if (!success) {
Log.error("WARNING: failed to obtain next ID block due to " + Log.warn("WARNING: failed to obtain next ID block due to " +
"thread contention. Trying again..."); "thread contention. Trying again...");
// Call this method again, but sleep briefly to try to avoid thread contention. // Call this method again, but sleep briefly to try to avoid thread contention.
try { try {
......
...@@ -31,7 +31,6 @@ import java.util.concurrent.CopyOnWriteArrayList; ...@@ -31,7 +31,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.dom4j.Element; import org.dom4j.Element;
import org.jivesoftware.openfire.SessionManager; import org.jivesoftware.openfire.SessionManager;
import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.cluster.ClusterManager; import org.jivesoftware.openfire.cluster.ClusterManager;
import org.jivesoftware.openfire.pubsub.cluster.AffiliationTask; import org.jivesoftware.openfire.pubsub.cluster.AffiliationTask;
import org.jivesoftware.openfire.pubsub.cluster.CancelSubscriptionTask; import org.jivesoftware.openfire.pubsub.cluster.CancelSubscriptionTask;
...@@ -57,7 +56,6 @@ import org.xmpp.packet.Message; ...@@ -57,7 +56,6 @@ import org.xmpp.packet.Message;
* @author Matt Tucker * @author Matt Tucker
*/ */
public abstract class Node { public abstract class Node {
public static final String PUBSUB_SVC_ID = XMPPServer.getInstance().getPubSubModule().getServiceID();
/** /**
* Reference to the publish and subscribe service. * Reference to the publish and subscribe service.
......
...@@ -1627,9 +1627,6 @@ public class PubSubPersistenceManager { ...@@ -1627,9 +1627,6 @@ public class PubSubPersistenceManager {
DbConnectionManager.closeConnection(rs, pstmt, con); DbConnectionManager.closeConnection(rs, pstmt, con);
} }
if (results.size() == 0)
return Collections.emptyList();
return results; return results;
} }
......
...@@ -136,7 +136,7 @@ public class PublishedItem implements Serializable { ...@@ -136,7 +136,7 @@ public class PublishedItem implements Serializable {
if (node == null) { if (node == null) {
synchronized (this) { synchronized (this) {
if (node == null) { if (node == null) {
if (Node.PUBSUB_SVC_ID.equals(serviceId)) if (XMPPServer.getInstance().getPubSubModule().getServiceID().equals(serviceId))
{ {
node = (LeafNode) XMPPServer.getInstance().getPubSubModule().getNode(nodeId); node = (LeafNode) XMPPServer.getInstance().getPubSubModule().getNode(nodeId);
} }
......
...@@ -43,7 +43,7 @@ public abstract class NodeTask implements ClusterTask ...@@ -43,7 +43,7 @@ public abstract class NodeTask implements ClusterTask
public PubSubService getService() public PubSubService getService()
{ {
if (Node.PUBSUB_SVC_ID.equals(serviceId)) if (XMPPServer.getInstance().getPubSubModule().getServiceID().equals(serviceId))
return XMPPServer.getInstance().getPubSubModule(); return XMPPServer.getInstance().getPubSubModule();
else else
{ {
......
...@@ -370,9 +370,13 @@ public class LocaleUtils { ...@@ -370,9 +370,13 @@ public class LocaleUtils {
public static String getLocalizedString(String key) { public static String getLocalizedString(String key) {
Locale locale = JiveGlobals.getLocale(); Locale locale = JiveGlobals.getLocale();
try {
ResourceBundle bundle = ResourceBundle.getBundle(resourceBaseName, locale); ResourceBundle bundle = ResourceBundle.getBundle(resourceBaseName, locale);
return getLocalizedString(key, locale, null, bundle); return getLocalizedString(key, locale, null, bundle);
} catch (MissingResourceException mre) {
Log.error(mre.getMessage());
return key;
}
} }
/** /**
......
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