Commit 1c5a3251 authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

Use component manager.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@278 b35dd754-fafc-0310-a699-88a17e54d16e
parent 14639595
...@@ -50,10 +50,7 @@ public class PacketRouterImpl extends BasicModule implements PacketRouter { ...@@ -50,10 +50,7 @@ public class PacketRouterImpl extends BasicModule implements PacketRouter {
* @throws NullPointerException If the packet is null or the packet could not be routed * @throws NullPointerException If the packet is null or the packet could not be routed
*/ */
public void route(XMPPPacket packet) { public void route(XMPPPacket packet) {
// Check for registered components if(hasRouted(packet)){
Component component = componentManager.getComponent(packet.getRecipient().toBareStringPrep());
if(component != null){
component.processPacket(packet);
return; return;
} }
...@@ -72,15 +69,34 @@ public class PacketRouterImpl extends BasicModule implements PacketRouter { ...@@ -72,15 +69,34 @@ public class PacketRouterImpl extends BasicModule implements PacketRouter {
} }
public void route(IQ packet) { public void route(IQ packet) {
iqRouter.route(packet); if(!hasRouted(packet)){
iqRouter.route(packet);
}
} }
public void route(Message packet) { public void route(Message packet) {
messageRouter.route(packet); if(!hasRouted(packet)){
messageRouter.route(packet);
}
} }
public void route(Presence packet) { public void route(Presence packet) {
presenceRouter.route(packet); if(!hasRouted(packet)){
presenceRouter.route(packet);
}
}
public boolean hasRouted(XMPPPacket packet){
if(packet.getRecipient() == null){
return false;
}
// Check for registered components
Component component = componentManager.getComponent(packet.getRecipient().toBareStringPrep());
if(component != null){
component.processPacket(packet);
return true;
}
return false;
} }
protected TrackInfo getTrackInfo() { protected TrackInfo getTrackInfo() {
......
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