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 {
* @throws NullPointerException If the packet is null or the packet could not be routed
*/
public void route(XMPPPacket packet) {
// Check for registered components
Component component = componentManager.getComponent(packet.getRecipient().toBareStringPrep());
if(component != null){
component.processPacket(packet);
if(hasRouted(packet)){
return;
}
......@@ -72,16 +69,35 @@ public class PacketRouterImpl extends BasicModule implements PacketRouter {
}
public void route(IQ packet) {
if(!hasRouted(packet)){
iqRouter.route(packet);
}
}
public void route(Message packet) {
if(!hasRouted(packet)){
messageRouter.route(packet);
}
}
public void route(Presence 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() {
TrackInfo trackInfo = new TrackInfo();
......
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