tidied up some cruft

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@389020 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-03-27 04:37:11 +00:00
parent 694120cd29
commit 5bed19f1c5
1 changed files with 7 additions and 8 deletions

View File

@ -24,6 +24,8 @@ import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ConsumerInfo;
import org.apache.activemq.filter.DestinationMap;
import org.apache.activemq.filter.DestinationMapNode;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.FileWriter;
import java.io.PrintWriter;
@ -36,20 +38,15 @@ import java.util.Iterator;
*/
public class DestinationDotFileInterceptor extends BrokerFilter {
private static final Log log = LogFactory.getLog(DestinationDotFileInterceptor.class);
protected static final String ID_SEPARATOR = "_";
private String file = "ActiveMQDestinations.dot";
private String file;
public DestinationDotFileInterceptor(Broker next, String file) {
super(next);
}
public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
Subscription answer = super.addConsumer(context, info);
//generateDestinationGraph();
return answer;
}
public Destination addDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception {
Destination answer = super.addDestination(context, destination);
generateDestinationGraph();
@ -63,7 +60,9 @@ public class DestinationDotFileInterceptor extends BrokerFilter {
}
protected void generateDestinationGraph() throws Exception {
System.out.println("Autogenerating file: " + file);
if (log.isDebugEnabled()) {
log.debug("Creating destination DOT file at: " + file);
}
PrintWriter writer = new PrintWriter(new FileWriter(file));
try {
generateDestinationGraph(writer);