public Broker installPlugin(Broker broker) { return new DestinationDotFileInterceptor(broker, file); }
@Override public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean create) throws Exception { Destination answer = super.addDestination(context, destination,create); generateFile(); return answer; }
@Override protected void generateFile(PrintWriter writer) throws Exception { ActiveMQDestination[] destinations = getDestinations(); writer.println(" label = \"Queues\""); writer.println(); printNodeLinks(writer, map.getQueueRootNode(), "queue"); writer.println("}"); writer.println(); writer.println(" label = \"TempQueues\""); writer.println(); printNodeLinks(writer, map.getTempQueueRootNode(), "tempqueue"); writer.println("}"); writer.println(); writer.println(" label = \"Topics\""); writer.println(); printNodeLinks(writer, map.getTopicRootNode(), "topic"); writer.println("}"); writer.println(); writer.println(" label = \"TempTopics\""); writer.println(); printNodeLinks(writer, map.getTempTopicRootNode(), "temptopic"); writer.println("}"); writer.println(); printNodes(writer, map.getQueueRootNode(), "queue"); writer.println();
protected void printNodeLinks(PrintWriter writer, DestinationMapNode node, String prefix) { String path = getPath(node); Collection children = node.getChildren(); for (Iterator iter = children.iterator(); iter.hasNext();) { DestinationMapNode child = (DestinationMapNode)iter.next(); writer.print(" "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); writer.print(" -> "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); writer.print(ID_SEPARATOR); writer.print(getPath(child)); writer.println(";"); printNodeLinks(writer, child, prefix + ID_SEPARATOR + path); } }
protected void printNodes(PrintWriter writer, DestinationMapNode node, String prefix) { String path = getPath(node); writer.print(" "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); String label = path; if (prefix.equals("topic")) { label = "Topics"; } else if (prefix.equals("queue")) { label = "Queues"; } writer.print("[ label = \""); writer.print(label); writer.println("\" ];"); Collection children = node.getChildren(); for (Iterator iter = children.iterator(); iter.hasNext();) { DestinationMapNode child = (DestinationMapNode)iter.next(); printNodes(writer, child, prefix + ID_SEPARATOR + path); } }
protected void printNodeLinks(PrintWriter writer, DestinationMapNode node, String prefix) { String path = getPath(node); Collection children = node.getChildren(); for (Iterator iter = children.iterator(); iter.hasNext();) { DestinationMapNode child = (DestinationMapNode)iter.next(); writer.print(" "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); writer.print(" -> "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); writer.print(ID_SEPARATOR); writer.print(getPath(child)); writer.println(";"); printNodeLinks(writer, child, prefix + ID_SEPARATOR + path); } }
protected void printNodes(PrintWriter writer, DestinationMapNode node, String prefix) { String path = getPath(node); writer.print(" "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); String label = path; if (prefix.equals("topic")) { label = "Topics"; } else if (prefix.equals("queue")) { label = "Queues"; } writer.print("[ label = \""); writer.print(label); writer.println("\" ];"); Collection children = node.getChildren(); for (Iterator iter = children.iterator(); iter.hasNext();) { DestinationMapNode child = (DestinationMapNode)iter.next(); printNodes(writer, child, prefix + ID_SEPARATOR + path); } }
@Override protected void generateFile(PrintWriter writer) throws Exception { ActiveMQDestination[] destinations = getDestinations(); writer.println(" label = \"Queues\""); writer.println(); printNodeLinks(writer, map.getQueueRootNode(), "queue"); writer.println("}"); writer.println(); writer.println(" label = \"TempQueues\""); writer.println(); printNodeLinks(writer, map.getTempQueueRootNode(), "tempqueue"); writer.println("}"); writer.println(); writer.println(" label = \"Topics\""); writer.println(); printNodeLinks(writer, map.getTopicRootNode(), "topic"); writer.println("}"); writer.println(); writer.println(" label = \"TempTopics\""); writer.println(); printNodeLinks(writer, map.getTempTopicRootNode(), "temptopic"); writer.println("}"); writer.println(); printNodes(writer, map.getQueueRootNode(), "queue"); writer.println();
protected void printNodeLinks(PrintWriter writer, DestinationMapNode node, String prefix) { String path = getPath(node); Collection children = node.getChildren(); for (Iterator iter = children.iterator(); iter.hasNext();) { DestinationMapNode child = (DestinationMapNode)iter.next(); writer.print(" "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); writer.print(" -> "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); writer.print(ID_SEPARATOR); writer.print(getPath(child)); writer.println(";"); printNodeLinks(writer, child, prefix + ID_SEPARATOR + path); } }
protected void printNodes(PrintWriter writer, DestinationMapNode node, String prefix) { String path = getPath(node); writer.print(" "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); String label = path; if (prefix.equals("topic")) { label = "Topics"; } else if (prefix.equals("queue")) { label = "Queues"; } writer.print("[ label = \""); writer.print(label); writer.println("\" ];"); Collection children = node.getChildren(); for (Iterator iter = children.iterator(); iter.hasNext();) { DestinationMapNode child = (DestinationMapNode)iter.next(); printNodes(writer, child, prefix + ID_SEPARATOR + path); } }
@Override public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { super.removeDestination(context, destination, timeout); generateFile(); }
public Broker installPlugin(Broker broker) { return new DestinationDotFileInterceptor(broker, file); }
@Override protected void generateFile(PrintWriter writer) throws Exception { ActiveMQDestination[] destinations = getDestinations(); writer.println(" label = \"Queues\""); writer.println(); printNodeLinks(writer, map.getQueueRootNode(), "queue"); writer.println("}"); writer.println(); writer.println(" label = \"TempQueues\""); writer.println(); printNodeLinks(writer, map.getTempQueueRootNode(), "tempqueue"); writer.println("}"); writer.println(); writer.println(" label = \"Topics\""); writer.println(); printNodeLinks(writer, map.getTopicRootNode(), "topic"); writer.println("}"); writer.println(); writer.println(" label = \"TempTopics\""); writer.println(); printNodeLinks(writer, map.getTempTopicRootNode(), "temptopic"); writer.println("}"); writer.println(); printNodes(writer, map.getQueueRootNode(), "queue"); writer.println();
protected void printNodeLinks(PrintWriter writer, DestinationMapNode node, String prefix) { String path = getPath(node); Collection children = node.getChildren(); for (Iterator iter = children.iterator(); iter.hasNext();) { DestinationMapNode child = (DestinationMapNode)iter.next(); writer.print(" "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); writer.print(" -> "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); writer.print(ID_SEPARATOR); writer.print(getPath(child)); writer.println(";"); printNodeLinks(writer, child, prefix + ID_SEPARATOR + path); } }
protected void printNodes(PrintWriter writer, DestinationMapNode node, String prefix) { String path = getPath(node); writer.print(" "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); String label = path; if (prefix.equals("topic")) { label = "Topics"; } else if (prefix.equals("queue")) { label = "Queues"; } writer.print("[ label = \""); writer.print(label); writer.println("\" ];"); Collection children = node.getChildren(); for (Iterator iter = children.iterator(); iter.hasNext();) { DestinationMapNode child = (DestinationMapNode)iter.next(); printNodes(writer, child, prefix + ID_SEPARATOR + path); } }
@Override public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { super.removeDestination(context, destination, timeout); generateFile(); }
public Broker installPlugin(Broker broker) { return new DestinationDotFileInterceptor(broker, file); }
@Override protected void generateFile(PrintWriter writer) throws Exception { ActiveMQDestination[] destinations = getDestinations(); writer.println(" label = \"Queues\""); writer.println(); printNodeLinks(writer, map.getQueueRootNode(), "queue"); writer.println("}"); writer.println(); writer.println(" label = \"TempQueues\""); writer.println(); printNodeLinks(writer, map.getTempQueueRootNode(), "tempqueue"); writer.println("}"); writer.println(); writer.println(" label = \"Topics\""); writer.println(); printNodeLinks(writer, map.getTopicRootNode(), "topic"); writer.println("}"); writer.println(); writer.println(" label = \"TempTopics\""); writer.println(); printNodeLinks(writer, map.getTempTopicRootNode(), "temptopic"); writer.println("}"); writer.println(); printNodes(writer, map.getQueueRootNode(), "queue"); writer.println();
protected void printNodeLinks(PrintWriter writer, DestinationMapNode node, String prefix) { String path = getPath(node); Collection children = node.getChildren(); for (Iterator iter = children.iterator(); iter.hasNext();) { DestinationMapNode child = (DestinationMapNode)iter.next(); writer.print(" "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); writer.print(" -> "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); writer.print(ID_SEPARATOR); writer.print(getPath(child)); writer.println(";"); printNodeLinks(writer, child, prefix + ID_SEPARATOR + path); } }
protected void printNodes(PrintWriter writer, DestinationMapNode node, String prefix) { String path = getPath(node); writer.print(" "); writer.print(prefix); writer.print(ID_SEPARATOR); writer.print(path); String label = path; if (prefix.equals("topic")) { label = "Topics"; } else if (prefix.equals("queue")) { label = "Queues"; } writer.print("[ label = \""); writer.print(label); writer.println("\" ];"); Collection children = node.getChildren(); for (Iterator iter = children.iterator(); iter.hasNext();) { DestinationMapNode child = (DestinationMapNode)iter.next(); printNodes(writer, child, prefix + ID_SEPARATOR + path); } }