Commit a8662f8a authored by guus's avatar guus

- No longer pass the same RoutingTable instance to each processor. Reference...

- No longer pass the same RoutingTable instance to each processor. Reference the instance that's kept in the parent class instead;
- renamed a field from the inner class that was hiding a field from the parent class.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10252 b35dd754-fafc-0310-a699-88a17e54d16e
parent f207284b
...@@ -108,7 +108,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler { ...@@ -108,7 +108,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
packetsProcessor = packetsProcessors.get(domain); packetsProcessor = packetsProcessors.get(domain);
if (packetsProcessor == null) { if (packetsProcessor == null) {
packetsProcessor = packetsProcessor =
new PacketsProcessor(OutgoingSessionPromise.this, domain, routingTable); new PacketsProcessor(OutgoingSessionPromise.this, domain);
packetsProcessors.put(domain, packetsProcessor); packetsProcessors.put(domain, packetsProcessor);
newProcessor = true; newProcessor = true;
} }
...@@ -177,18 +177,16 @@ public class OutgoingSessionPromise implements RoutableChannelHandler { ...@@ -177,18 +177,16 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
private OutgoingSessionPromise promise; private OutgoingSessionPromise promise;
private String domain; private String domain;
private RoutingTable routingTable; private Queue<Packet> packetQueue = new ConcurrentLinkedQueue<Packet>();
private Queue<Packet> packets = new ConcurrentLinkedQueue<Packet>();
public PacketsProcessor(OutgoingSessionPromise promise, String domain, RoutingTable routingTable) { public PacketsProcessor(OutgoingSessionPromise promise, String domain) {
this.promise = promise; this.promise = promise;
this.domain = domain; this.domain = domain;
this.routingTable = routingTable;
} }
public void run() { public void run() {
while (!isDone()) { while (!isDone()) {
Packet packet = packets.poll(); Packet packet = packetQueue.poll();
if (packet != null) { if (packet != null) {
try { try {
sendPacket(packet); sendPacket(packet);
...@@ -277,7 +275,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler { ...@@ -277,7 +275,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
} }
public void addPacket(Packet packet) { public void addPacket(Packet packet) {
packets.add(packet); packetQueue.add(packet);
} }
public String getDomain() { public String getDomain() {
...@@ -285,7 +283,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler { ...@@ -285,7 +283,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
} }
public boolean isDone() { public boolean isDone() {
return packets.isEmpty(); return packetQueue.isEmpty();
} }
} }
} }
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