Commit a7bd18d0 authored by Alex Wenckus's avatar Alex Wenckus Committed by alex

Removing Guice, alas we barely knew you

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8649 b35dd754-fafc-0310-a699-88a17e54d16e
parent a940eeff
...@@ -18,10 +18,6 @@ import org.dom4j.io.SAXReader; ...@@ -18,10 +18,6 @@ import org.dom4j.io.SAXReader;
import org.jivesoftware.admin.AdminConsole; import org.jivesoftware.admin.AdminConsole;
import org.jivesoftware.database.DbConnectionManager; import org.jivesoftware.database.DbConnectionManager;
import org.jivesoftware.openfire.XMPPServer; import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.container.plugin.AbstractPlugin;
import org.jivesoftware.openfire.container.plugin.PluginName;
import org.jivesoftware.openfire.container.plugin.PluginDescription;
import org.jivesoftware.openfire.container.plugin.PluginDir;
import org.jivesoftware.util.LocaleUtils; import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
import org.jivesoftware.util.Version; import org.jivesoftware.util.Version;
...@@ -35,11 +31,6 @@ import java.util.jar.JarOutputStream; ...@@ -35,11 +31,6 @@ import java.util.jar.JarOutputStream;
import java.util.jar.Pack200; import java.util.jar.Pack200;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
import com.google.inject.Guice;
import com.google.inject.AbstractModule;
import com.google.inject.Provider;
import com.google.inject.Scopes;
/** /**
* Loads and manages plugins. The <tt>plugins</tt> directory is monitored for any * Loads and manages plugins. The <tt>plugins</tt> directory is monitored for any
* new plugins, and they are dynamically loaded.<p/> * new plugins, and they are dynamically loaded.<p/>
...@@ -381,35 +372,7 @@ public class PluginManager { ...@@ -381,35 +372,7 @@ public class PluginManager {
} }
String className = pluginXML.selectSingleNode("/plugin/class").getText(); String className = pluginXML.selectSingleNode("/plugin/class").getText();
Class pluginClazz = pluginLoader.loadClass(className); plugin = (Plugin)pluginLoader.loadClass(className).newInstance();
if(AbstractPlugin.class.isAssignableFrom(pluginClazz)) {
String moduleClassName;
try {
moduleClassName = pluginXML.selectSingleNode("/plugin/module/class")
.getText();
}
catch (NullPointerException npe) {
moduleClassName = null;
}
Class moduleClazz;
try {
if (moduleClassName != null) {
moduleClazz = pluginLoader.loadClass(moduleClassName);
}
else {
moduleClazz = null;
}
}
catch (ClassNotFoundException cnfe) {
moduleClazz = null;
}
//noinspection unchecked
plugin = instantiateAbstractPlugin(pluginDir, pluginLoader, pluginClazz,
moduleClazz);
}
else {
plugin = (Plugin) pluginClazz.newInstance();
}
if (parentPluginNode != null) { if (parentPluginNode != null) {
String parentPlugin = parentPluginNode.getTextTrim(); String parentPlugin = parentPluginNode.getTextTrim();
// See if the parent is already loaded. // See if the parent is already loaded.
...@@ -533,58 +496,6 @@ public class PluginManager { ...@@ -533,58 +496,6 @@ public class PluginManager {
} }
} }
private Plugin instantiateAbstractPlugin(final File pluginDir, PluginClassLoader pluginLoader,
final Class<? extends AbstractPlugin> pluginClazz,
Class<? extends com.google.inject.Module> moduleClazz)
throws IllegalAccessException, InstantiationException
{
// Init the plugin.
ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(pluginLoader);
final PluginModule module = new PluginModule();
com.google.inject.Module tempModule;
if(moduleClazz == null) {
tempModule = null;
}
else {
tempModule = moduleClazz.newInstance();
}
final com.google.inject.Module pluginModule = tempModule;
AbstractPlugin plugin = Guice.createInjector(new AbstractModule() {
protected void configure() {
install(module);
if (pluginModule != null) {
install(pluginModule);
}
bind(String.class).annotatedWith(PluginName.class).toProvider(
new Provider<String>() {
public String get() {
return getName(pluginDir);
}
}
);
bind(String.class).annotatedWith(PluginDescription.class).toProvider(
new Provider<String>() {
public String get() {
return getDescription(pluginDir);
}
}
);
bind(File.class).annotatedWith(PluginDir.class).toProvider(
new Provider<File>() {
public File get() {
return pluginDir;
}
}
);
bind(pluginClazz).in(Scopes.SINGLETON);
}
}).getInstance(pluginClazz);
Thread.currentThread().setContextClassLoader(oldLoader);
return plugin;
}
private void firePluginCreatedEvent(String name, Plugin plugin) { private void firePluginCreatedEvent(String name, Plugin plugin) {
for(PluginListener listener : pluginListeners) { for(PluginListener listener : pluginListeners) {
listener.pluginCreated(name, plugin); listener.pluginCreated(name, plugin);
...@@ -708,12 +619,8 @@ public class PluginManager { ...@@ -708,12 +619,8 @@ public class PluginManager {
* @return the plugin's name. * @return the plugin's name.
*/ */
public String getName(Plugin plugin) { public String getName(Plugin plugin) {
return getName(pluginDirs.get(plugin)); String name = getElementValue(plugin, "/plugin/name");
} String pluginName = pluginDirs.get(plugin).getName();
private String getName(File pluginDir) {
String name = getElementValue(pluginDir, "/plugin/name");
String pluginName = pluginDir.getName();
if (name != null) { if (name != null) {
return AdminConsole.getAdminText(name, pluginName); return AdminConsole.getAdminText(name, pluginName);
} }
...@@ -730,13 +637,8 @@ public class PluginManager { ...@@ -730,13 +637,8 @@ public class PluginManager {
* @return the plugin's description. * @return the plugin's description.
*/ */
public String getDescription(Plugin plugin) { public String getDescription(Plugin plugin) {
return getDescription(pluginDirs.get(plugin)); String pluginName = pluginDirs.get(plugin).getName();
} return AdminConsole.getAdminText(getElementValue(plugin, "/plugin/description"), pluginName);
private String getDescription(File pluginDir) {
String pluginName = pluginDir.getName();
return AdminConsole.getAdminText(getElementValue(pluginDirs.get(pluginDir),
"/plugin/description"), pluginName);
} }
/** /**
...@@ -747,7 +649,7 @@ public class PluginManager { ...@@ -747,7 +649,7 @@ public class PluginManager {
* @return the plugin's author. * @return the plugin's author.
*/ */
public String getAuthor(Plugin plugin) { public String getAuthor(Plugin plugin) {
return getElementValue(pluginDirs.get(plugin), "/plugin/author"); return getElementValue(plugin, "/plugin/author");
} }
/** /**
...@@ -758,7 +660,7 @@ public class PluginManager { ...@@ -758,7 +660,7 @@ public class PluginManager {
* @return the plugin's version. * @return the plugin's version.
*/ */
public String getVersion(Plugin plugin) { public String getVersion(Plugin plugin) {
return getElementValue(pluginDirs.get(plugin), "/plugin/version"); return getElementValue(plugin, "/plugin/version");
} }
/** /**
...@@ -769,7 +671,7 @@ public class PluginManager { ...@@ -769,7 +671,7 @@ public class PluginManager {
* @return the plugin's version. * @return the plugin's version.
*/ */
public String getMinServerVersion(Plugin plugin) { public String getMinServerVersion(Plugin plugin) {
return getElementValue(pluginDirs.get(plugin), "/plugin/minServerVersion"); return getElementValue(plugin, "/plugin/minServerVersion");
} }
/** /**
...@@ -781,7 +683,7 @@ public class PluginManager { ...@@ -781,7 +683,7 @@ public class PluginManager {
* @return the plugin's database schema key or <tt>null</tt> if it doesn't exist. * @return the plugin's database schema key or <tt>null</tt> if it doesn't exist.
*/ */
public String getDatabaseKey(Plugin plugin) { public String getDatabaseKey(Plugin plugin) {
return getElementValue(pluginDirs.get(plugin), "/plugin/databaseKey"); return getElementValue(plugin, "/plugin/databaseKey");
} }
/** /**
...@@ -793,7 +695,7 @@ public class PluginManager { ...@@ -793,7 +695,7 @@ public class PluginManager {
* @return the plugin's database schema version or <tt>-1</tt> if it doesn't exist. * @return the plugin's database schema version or <tt>-1</tt> if it doesn't exist.
*/ */
public int getDatabaseVersion(Plugin plugin) { public int getDatabaseVersion(Plugin plugin) {
String versionString = getElementValue(pluginDirs.get(plugin), "/plugin/databaseVersion"); String versionString = getElementValue(plugin, "/plugin/databaseVersion");
if (versionString != null) { if (versionString != null) {
try { try {
return Integer.parseInt(versionString.trim()); return Integer.parseInt(versionString.trim());
...@@ -814,7 +716,7 @@ public class PluginManager { ...@@ -814,7 +716,7 @@ public class PluginManager {
* @return the plugin's license agreement. * @return the plugin's license agreement.
*/ */
public License getLicense(Plugin plugin) { public License getLicense(Plugin plugin) {
String licenseString = getElementValue(pluginDirs.get(plugin), "/plugin/licenseType"); String licenseString = getElementValue(plugin, "/plugin/licenseType");
if (licenseString != null) { if (licenseString != null) {
try { try {
// Attempt to load the get the license type. We lower-case and // Attempt to load the get the license type. We lower-case and
...@@ -844,11 +746,12 @@ public class PluginManager { ...@@ -844,11 +746,12 @@ public class PluginManager {
* Returns the value of an element selected via an xpath expression from * Returns the value of an element selected via an xpath expression from
* a Plugin's plugin.xml file. * a Plugin's plugin.xml file.
* *
* @param pluginDir the plugin directory. * @param plugin the plugin.
* @param xpath the xpath expression. * @param xpath the xpath expression.
* @return the value of the element selected by the xpath expression. * @return the value of the element selected by the xpath expression.
*/ */
private String getElementValue(File pluginDir, String xpath) { private String getElementValue(Plugin plugin, String xpath) {
File pluginDir = pluginDirs.get(plugin);
if (pluginDir == null) { if (pluginDir == null) {
return null; return null;
} }
......
...@@ -13,24 +13,24 @@ package org.jivesoftware.openfire.plugin; ...@@ -13,24 +13,24 @@ package org.jivesoftware.openfire.plugin;
import org.dom4j.Element; import org.dom4j.Element;
import org.jivesoftware.openfire.SessionManager; import org.jivesoftware.openfire.SessionManager;
import org.jivesoftware.openfire.container.plugin.AbstractPlugin; import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.container.plugin.PluginName; import org.jivesoftware.openfire.container.Plugin;
import org.jivesoftware.openfire.container.plugin.PluginDescription; import org.jivesoftware.openfire.container.PluginManager;
import org.jivesoftware.openfire.group.Group; import org.jivesoftware.openfire.group.Group;
import org.jivesoftware.openfire.group.GroupManager; import org.jivesoftware.openfire.group.GroupManager;
import org.jivesoftware.openfire.group.GroupNotFoundException; import org.jivesoftware.openfire.group.GroupNotFoundException;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.PropertyEventDispatcher;
import org.jivesoftware.util.PropertyEventListener; import org.jivesoftware.util.PropertyEventListener;
import org.jivesoftware.util.JiveProperties;
import org.xmpp.component.Component; import org.xmpp.component.Component;
import org.xmpp.component.ComponentException; import org.xmpp.component.ComponentException;
import org.xmpp.component.ComponentManager; import org.xmpp.component.ComponentManager;
import org.xmpp.component.ComponentManagerFactory;
import org.xmpp.packet.*; import org.xmpp.packet.*;
import java.io.File;
import java.util.*; import java.util.*;
import com.google.inject.Inject;
/** /**
* Broadcast service plugin. It accepts messages and broadcasts them out to * Broadcast service plugin. It accepts messages and broadcasts them out to
* groups of connected users. The address <tt>all@[serviceName].[server]</tt> is * groups of connected users. The address <tt>all@[serviceName].[server]</tt> is
...@@ -40,49 +40,61 @@ import com.google.inject.Inject; ...@@ -40,49 +40,61 @@ import com.google.inject.Inject;
* *
* @author Matt Tucker * @author Matt Tucker
*/ */
public class BroadcastPlugin extends AbstractPlugin implements Component, PropertyEventListener { public class BroadcastPlugin implements Plugin, Component, PropertyEventListener {
private final String pluginName;
private final String pluginDescription;
private final JiveProperties jiveProperties;
private final SessionManager sessionManager;
private final GroupManager groupManager;
private String serviceName; private String serviceName;
private SessionManager sessionManager;
private GroupManager groupManager;
private List<JID> allowedUsers;
private boolean groupMembersAllowed;
private boolean disableGroupPermissions;
private ComponentManager componentManager;
private PluginManager pluginManager;
/** /**
* Constructs a new broadcast plugin. * Constructs a new broadcast plugin.
*
* @param pluginName the name configured for this plugin.
* @param pluginDescription the description configured for this plugin.
* @param jiveProperties system properties which stores the configuration paramters for the
* broadcast plugin.
* @param sessionManager the session manager.
* @param groupManager the group manager.
*/ */
@Inject public BroadcastPlugin() {
public BroadcastPlugin(@PluginName String pluginName, serviceName = JiveGlobals.getProperty("plugin.broadcast.serviceName", "broadcast");
@PluginDescription String pluginDescription, disableGroupPermissions = JiveGlobals.getBooleanProperty(
JiveProperties jiveProperties, "plugin.broadcast.disableGroupPermissions");
SessionManager sessionManager, groupMembersAllowed = JiveGlobals.getBooleanProperty(
GroupManager groupManager) "plugin.broadcast.groupMembersAllowed", true);
{ allowedUsers = stringToList(JiveGlobals.getProperty("plugin.broadcast.allowedUsers", ""));
this.pluginName = pluginName; }
this.pluginDescription = pluginDescription;
this.jiveProperties = jiveProperties; // Plugin Interface
this.sessionManager = sessionManager;
this.groupManager = groupManager; public void initializePlugin(PluginManager manager, File pluginDirectory) {
} pluginManager = manager;
sessionManager = SessionManager.getInstance();
public void initialize() { groupManager = GroupManager.getInstance();
// Register as a component. // Register as a component.
componentManager = ComponentManagerFactory.getComponentManager();
try {
componentManager.addComponent(serviceName, this);
}
catch (Exception e) {
componentManager.getLog().error(e);
}
PropertyEventDispatcher.addListener(this);
}
public void destroyPlugin() {
PropertyEventDispatcher.removeListener(this);
// Unregister component.
try { try {
addComponent(getServiceName(), this); componentManager.removeComponent(serviceName);
} }
catch (Exception e) { catch (Exception e) {
throw new RuntimeException("Error initializing internal broadcast component", e); componentManager.getLog().error(e);
} }
addPropertyEventListener(this); componentManager = null;
pluginManager = null;
sessionManager = null;
groupManager = null;
allowedUsers.clear();
} }
public void initialize(JID jid, ComponentManager componentManager) { public void initialize(JID jid, ComponentManager componentManager) {
...@@ -95,12 +107,15 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -95,12 +107,15 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
} }
// Component Interface // Component Interface
public String getName() { public String getName() {
return pluginName; // Get the name from the plugin.xml file.
return pluginManager.getName(this);
} }
public String getDescription() { public String getDescription() {
return pluginDescription; // Get the description from the plugin.xml file.
return pluginManager.getDescription(this);
} }
public void processPacket(Packet packet) { public void processPacket(Packet packet) {
...@@ -109,7 +124,6 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -109,7 +124,6 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
String toNode = packet.getTo().getNode(); String toNode = packet.getTo().getNode();
// Check if user is allowed to send packet to this service[+group] // Check if user is allowed to send packet to this service[+group]
boolean targetAll = "all".equals(toNode); boolean targetAll = "all".equals(toNode);
Collection<JID> allowedUsers = getGlobalAllowedUsers();
if (targetAll) { if (targetAll) {
// See if the user is allowed to send the packet. // See if the user is allowed to send the packet.
JID address = new JID(packet.getFrom().toBareJID()); JID address = new JID(packet.getFrom().toBareJID());
...@@ -123,7 +137,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -123,7 +137,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
group = groupManager.getGroup(toNode); group = groupManager.getGroup(toNode);
boolean isGroupUser = group.isUser(packet.getFrom()) || boolean isGroupUser = group.isUser(packet.getFrom()) ||
group.isUser(new JID(packet.getFrom().toBareJID())); group.isUser(new JID(packet.getFrom().toBareJID()));
if (isGroupPermissionsDisabled() || (isGroupMembersAllowed() && isGroupUser) || if (disableGroupPermissions || (groupMembersAllowed && isGroupUser) ||
allowedUsers.contains(new JID(packet.getFrom().toBareJID()))) { allowedUsers.contains(new JID(packet.getFrom().toBareJID()))) {
canProceed = true; canProceed = true;
} }
...@@ -330,7 +344,6 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -330,7 +344,6 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
// Return the list of groups hosted by the service that can be used by the user // Return the list of groups hosted by the service that can be used by the user
Collection<Group> groups; Collection<Group> groups;
JID address = new JID(iq.getFrom().toBareJID()); JID address = new JID(iq.getFrom().toBareJID());
Collection<JID> allowedUsers = getGlobalAllowedUsers();
if (allowedUsers.contains(address)) { if (allowedUsers.contains(address)) {
groups = groupManager.getGroups(); groups = groupManager.getGroups();
} }
...@@ -375,9 +388,6 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -375,9 +388,6 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
* @return the service name of this component. * @return the service name of this component.
*/ */
public String getServiceName() { public String getServiceName() {
if (serviceName == null) {
serviceName = jiveProperties.getProperty("plugin.broadcast.serviceName", "broadcast");
}
return serviceName; return serviceName;
} }
...@@ -387,7 +397,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -387,7 +397,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
* @param serviceName the service name of this component. * @param serviceName the service name of this component.
*/ */
public void setServiceName(String serviceName) { public void setServiceName(String serviceName) {
jiveProperties.put("plugin.broadcast.serviceName", serviceName); JiveGlobals.setProperty("plugin.broadcast.serviceName", serviceName);
} }
/** /**
...@@ -399,7 +409,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -399,7 +409,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
* @return the users allowed to send broadcast messages. * @return the users allowed to send broadcast messages.
*/ */
public Collection<JID> getGlobalAllowedUsers() { public Collection<JID> getGlobalAllowedUsers() {
return stringToList(jiveProperties.getProperty("plugin.broadcast.allowedUsers", "")); return allowedUsers;
} }
/** /**
...@@ -416,7 +426,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -416,7 +426,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
for (String jid : allowedUsers) { for (String jid : allowedUsers) {
buf.append(jid).append(","); buf.append(jid).append(",");
} }
jiveProperties.put("plugin.broadcast.allowedUsers", buf.toString()); JiveGlobals.setProperty("plugin.broadcast.allowedUsers", buf.toString());
} }
/** /**
...@@ -427,8 +437,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -427,8 +437,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
* @return true if group permission checking is disabled. * @return true if group permission checking is disabled.
*/ */
public boolean isGroupPermissionsDisabled() { public boolean isGroupPermissionsDisabled() {
return jiveProperties.getBooleanProperty( return disableGroupPermissions;
"plugin.broadcast.disableGroupPermissions");
} }
/** /**
...@@ -438,7 +447,8 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -438,7 +447,8 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
* @param disableGroupPermissions true if group permission checking should be disabled. * @param disableGroupPermissions true if group permission checking should be disabled.
*/ */
public void setGroupPermissionsDisabled(boolean disableGroupPermissions) { public void setGroupPermissionsDisabled(boolean disableGroupPermissions) {
jiveProperties.put("plugin.broadcast.disableGroupPermissions", this.disableGroupPermissions = disableGroupPermissions;
JiveGlobals.setProperty("plugin.broadcast.disableGroupPermissions",
Boolean.toString(disableGroupPermissions)); Boolean.toString(disableGroupPermissions));
} }
...@@ -452,8 +462,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -452,8 +462,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
* group admins are allowed. * group admins are allowed.
*/ */
public boolean isGroupMembersAllowed() { public boolean isGroupMembersAllowed() {
return jiveProperties.getBooleanProperty( return groupMembersAllowed;
"plugin.broadcast.groupMembersAllowed", true);
} }
/** /**
...@@ -466,19 +475,38 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -466,19 +475,38 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
* group admins are allowed. * group admins are allowed.
*/ */
public void setGroupMembersAllowed(boolean allowed) { public void setGroupMembersAllowed(boolean allowed) {
jiveProperties.put("plugin.broadcast.groupMembersAllowed", Boolean.toString(allowed)); this.groupMembersAllowed = allowed;
JiveGlobals.setProperty("plugin.broadcast.groupMembersAllowed", Boolean.toString(allowed));
} }
// PropertyEventListener Methods // PropertyEventListener Methods
public void propertySet(String property, Map params) { public void propertySet(String property, Map params) {
if (property.equals("plugin.broadcast.serviceName")) { if (property.equals("plugin.broadcast.groupMembersAllowed")) {
this.groupMembersAllowed = Boolean.parseBoolean((String)params.get("value"));
}
else if (property.equals("plugin.broadcast.disableGroupPermissions")) {
this.disableGroupPermissions = Boolean.parseBoolean((String)params.get("value"));
}
else if (property.equals("plugin.broadcast.allowedUsers")) {
this.allowedUsers = stringToList((String)params.get("value"));
}
else if (property.equals("plugin.broadcast.serviceName")) {
changeServiceName((String)params.get("value")); changeServiceName((String)params.get("value"));
} }
} }
public void propertyDeleted(String property, Map params) { public void propertyDeleted(String property, Map params) {
if (property.equals("plugin.broadcast.serviceName")) { if (property.equals("plugin.broadcast.groupMembersAllowed")) {
this.groupMembersAllowed = true;
}
else if (property.equals("plugin.broadcast.disableGroupPermissions")) {
this.disableGroupPermissions = false;
}
else if (property.equals("plugin.broadcast.allowedUsers")) {
this.allowedUsers = Collections.emptyList();
}
else if (property.equals("plugin.broadcast.serviceName")) {
changeServiceName("broadcast"); changeServiceName("broadcast");
} }
} }
...@@ -500,7 +528,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -500,7 +528,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
if (serviceName == null) { if (serviceName == null) {
throw new NullPointerException("Service name cannot be null"); throw new NullPointerException("Service name cannot be null");
} }
if (serviceName.equals(this.serviceName)) { if (this.serviceName.equals(serviceName)) {
return; return;
} }
...@@ -537,7 +565,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper ...@@ -537,7 +565,7 @@ public class BroadcastPlugin extends AbstractPlugin implements Component, Proper
values.add(new JID(value)); values.add(new JID(value));
} }
else { else {
values.add(createJid(value)); values.add(XMPPServer.getInstance().createJID(value, null));
} }
} }
} }
......
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