From 48ff2dfc3ec8aafa119b8e25dade695c5d40312b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 6 Jun 2013 06:36:32 +0200 Subject: [PATCH] Store the connections per filter. --- .../java/net/pterodactylus/sonitus/data/filter/PipelineFilter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/net/pterodactylus/sonitus/data/filter/PipelineFilter.java b/src/main/java/net/pterodactylus/sonitus/data/filter/PipelineFilter.java index 492db5b..638df00 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/filter/PipelineFilter.java +++ b/src/main/java/net/pterodactylus/sonitus/data/filter/PipelineFilter.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collection; import java.util.List; +import java.util.Map; import net.pterodactylus.sonitus.data.AbstractFilter; import net.pterodactylus.sonitus.data.DataPacket; @@ -29,6 +30,7 @@ import net.pterodactylus.sonitus.data.Metadata; import net.pterodactylus.sonitus.data.Pipeline.Connection; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; /** * {@link Filter} that combines several filters into one. @@ -46,6 +48,9 @@ public class PipelineFilter extends AbstractFilter implements Filter { /** The last filter (for convenience). */ private final Filter lastFilter; + /** The connections for each filter. */ + private final Map filterConnections = Maps.newHashMap(); + /** * Creates a new pipeline filter. * @@ -82,6 +87,7 @@ public class PipelineFilter extends AbstractFilter implements Filter { filter.open(currentMetadata); currentMetadata = filter.metadata(); Connection connection = new Connection(currentSource, Arrays.asList(filter)); + filterConnections.put(filter, connection); String threadName = String.format("%s → %s", connection.source().name(), filter.name()); new Thread(connection, threadName).start(); currentSource = filter; -- 2.7.4