Commit a38f4e11 authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

Making change based on Alex's recommendation. Thanks Alex :)


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@529 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3d9dd958
package org.jivesoftware.messenger; package org.jivesoftware.messenger;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.container.ServiceLookupFactory; import org.jivesoftware.messenger.container.ServiceLookupFactory;
import org.jivesoftware.messenger.spi.PacketDelivererImpl; import org.jivesoftware.messenger.spi.PacketRouterImpl;
import org.jivesoftware.messenger.spi.PresenceImpl; import org.jivesoftware.messenger.spi.PresenceImpl;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
import org.jivesoftware.util.StringUtils; import org.jivesoftware.util.StringUtils;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/** /**
* <p>Manages the registration and delegation of Components.</p> * <p>Manages the registration and delegation of Components.</p>
* <p/> * <p/>
...@@ -98,6 +98,7 @@ public class ComponentManager { ...@@ -98,6 +98,7 @@ public class ComponentManager {
/** /**
* Registers Probeers who have not yet been serviced. * Registers Probeers who have not yet been serviced.
*
* @param prober the jid probing. * @param prober the jid probing.
* @param probee the presence being probed. * @param probee the presence being probed.
*/ */
...@@ -108,22 +109,22 @@ public class ComponentManager { ...@@ -108,22 +109,22 @@ public class ComponentManager {
/** /**
* Send a packet to the specified recipient. Please note that this sends packets only * Send a packet to the specified recipient. Please note that this sends packets only
* to outgoing jids and does to the incoming server reader. * to outgoing jids and does to the incoming server reader.
*
* @param packet the packet to send. * @param packet the packet to send.
*/ */
public void sendPacket(XMPPPacket packet) { public void sendPacket(XMPPPacket packet) {
PacketRouter router;
try { try {
PacketDelivererImpl deliverer = (PacketDelivererImpl) ServiceLookupFactory.getLookup().lookup(PacketDelivererImpl.class); router = (PacketRouterImpl) ServiceLookupFactory.getLookup().lookup(PacketRouterImpl.class);
if (deliverer != null) { if (router != null) {
// Hand off to the delegated deliverer router.route(packet);
deliverer.deliver(packet);
} }
} }
catch (Exception e) { catch (UnauthorizedException e) {
Log.error("Unable to deliver packet", e); Log.error(e);
} }
} }
private String validateJID(String jid) { private String validateJID(String jid) {
jid = jid.trim().toLowerCase(); jid = jid.trim().toLowerCase();
return jid; return jid;
......
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