Commit bfdfcae7 authored by guus's avatar guus

* Updating 'broadcast' plugin to make use of SLF4J instead of custom logging (OF-53).

* Applied java generics.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11439 b35dd754-fafc-0310-a699-88a17e54d16e
parent 5f4194f7
......@@ -44,6 +44,13 @@
Broadcast Plugin Changelog
</h1>
<p><b>1.8.0</b> -- December 1, 2009</p>
<ul>
<li>Now requires Openfire 3.6.5.</li>
<li>Applied Java generics.</li>
<li>[<a href='http://www.igniterealtime.org/issues/browse/OF-53'>OF-53</a>] - Replace custom logging implementation with a third party library.</li>
</ul>
<p><b>1.7.0</b> -- November 16, 2007</p>
<ul>
<li>Now requires Openfire 3.4.1.</li>
......
......@@ -8,8 +8,8 @@
<name>Broadcast</name>
<description>Broadcasts messages to users.</description>
<author>Jive Software</author>
<version>1.7.0</version>
<date>11/16/2007</date>
<version>1.8.0</version>
<date>12/1/2009</date>
<url>http://www.igniterealtime.org</url>
<minServerVersion>3.4.1</minServerVersion>
<minServerVersion>3.6.5</minServerVersion>
</plugin>
\ No newline at end of file
......@@ -37,9 +37,10 @@ import org.jivesoftware.openfire.group.Group;
import org.jivesoftware.openfire.group.GroupManager;
import org.jivesoftware.openfire.group.GroupNotFoundException;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.PropertyEventDispatcher;
import org.jivesoftware.util.PropertyEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xmpp.component.Component;
import org.xmpp.component.ComponentException;
import org.xmpp.component.ComponentManager;
......@@ -62,6 +63,8 @@ import org.xmpp.packet.Presence;
*/
public class BroadcastPlugin implements Plugin, Component, PropertyEventListener {
private static final Logger Log = LoggerFactory.getLogger(BroadcastPlugin.class);
private String serviceName;
private SessionManager sessionManager;
private GroupManager groupManager;
......@@ -96,7 +99,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
componentManager.addComponent(serviceName, this);
}
catch (Exception e) {
Log.error(e);
Log.error(e.getMessage(), e);
}
PropertyEventDispatcher.addListener(this);
}
......@@ -109,7 +112,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
componentManager.removeComponent(serviceName);
}
catch (Exception e) {
Log.error(e);
Log.error(e.getMessage(), e);
}
}
componentManager = null;
......@@ -209,7 +212,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
componentManager.sendPacket(this, error);
}
catch (Exception e) {
Log.error(e);
Log.error(e.getMessage(), e);
}
return;
}
......@@ -233,7 +236,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
componentManager.sendPacket(this, error);
}
catch (Exception e) {
Log.error(e);
Log.error(e.getMessage(), e);
}
}
else if (canProceed) {
......@@ -246,7 +249,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
componentManager.sendPacket(this, newMessage);
}
catch (Exception e) {
Log.error(e);
Log.error(e.getMessage(), e);
}
}
}
......@@ -266,7 +269,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
componentManager.sendPacket(this, error);
}
catch (Exception e) {
Log.error(e);
Log.error(e.getMessage(), e);
}
}
}
......@@ -312,7 +315,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
}
}
catch (ComponentException e) {
Log.error(e);
Log.error(e.getMessage(), e);
}
}
......@@ -398,7 +401,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
componentManager.sendPacket(this, reply);
}
catch (Exception e) {
Log.error(e);
Log.error(e.getMessage(), e);
}
}
......@@ -503,7 +506,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
// PropertyEventListener Methods
public void propertySet(String property, Map params) {
public void propertySet(String property, Map<String, Object> params) {
if (property.equals("plugin.broadcast.groupMembersAllowed")) {
this.groupMembersAllowed = Boolean.parseBoolean((String)params.get("value"));
}
......@@ -518,7 +521,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
}
}
public void propertyDeleted(String property, Map params) {
public void propertyDeleted(String property, Map<String, Object> params) {
if (property.equals("plugin.broadcast.groupMembersAllowed")) {
this.groupMembersAllowed = true;
}
......@@ -533,11 +536,11 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
}
}
public void xmlPropertySet(String property, Map params) {
public void xmlPropertySet(String property, Map<String, Object> params) {
// Ignore.
}
public void xmlPropertyDeleted(String property, Map params) {
public void xmlPropertyDeleted(String property, Map<String, Object> params) {
// Ignore.
}
......@@ -559,13 +562,13 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
componentManager.removeComponent(this.serviceName);
}
catch (Exception e) {
Log.error(e);
Log.error(e.getMessage(), e);
}
try {
componentManager.addComponent(serviceName, this);
}
catch (Exception e) {
Log.error(e);
Log.error(e.getMessage(), e);
}
this.serviceName = serviceName;
}
......
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