You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/03/22 17:05:46 UTC
[54/54] camel git commit: CAMEL-7263: Remove old and
unused/deprecated dot/view code that has not been in use or maintained for
many years.
CAMEL-7263: Remove old and unused/deprecated dot/view code that has not been in use or maintained for many years.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b63707cd
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b63707cd
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b63707cd
Branch: refs/heads/master
Commit: b63707cd6c06b2a1134cf4e755fa317b292c4396
Parents: b67b629
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Mar 22 16:36:39 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Mar 22 16:36:39 2015 +0100
----------------------------------------------------------------------
camel-core/pom.xml | 4 +-
.../camel/view/GraphGeneratorSupport.java | 104 ----------
.../org/apache/camel/view/GraphSupport.java | 137 -------------
.../apache/camel/view/ModelFileGenerator.java | 154 --------------
.../java/org/apache/camel/view/NodeData.java | 199 -------------------
.../apache/camel/view/RouteDotGenerator.java | 174 ----------------
.../apache/camel/view/XmlGraphGenerator.java | 173 ----------------
.../java/org/apache/camel/view/package.html | 26 ---
.../java/org/apache/camel/view/DotViewTest.java | 135 -------------
.../camel/view/ModelFileGeneratorTest.java | 69 -------
.../camel/view/RouteDotGeneratorTest.java | 30 ---
.../org/apache/camel/view/XmlGraphTest.java | 29 ---
.../main/java/org/apache/camel/guice/Main.java | 6 -
.../main/java/org/apache/camel/spring/Main.java | 6 -
.../spring/handler/CamelNamespaceHandler.java | 5 -
.../org/apache/camel/test/blueprint/Main.java | 13 --
16 files changed, 2 insertions(+), 1262 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/pom.xml
----------------------------------------------------------------------
diff --git a/camel-core/pom.xml b/camel-core/pom.xml
index 6e2c7c2..855ec99 100644
--- a/camel-core/pom.xml
+++ b/camel-core/pom.xml
@@ -375,7 +375,7 @@
</group>
<group>
<title>Utility classes</title>
- <packages>org.apache.camel.util:org.apache.camel.util.*:org.apache.camel.view</packages>
+ <packages>org.apache.camel.util:org.apache.camel.util.*</packages>
</group>
</groups>
</configuration>
@@ -463,7 +463,7 @@
</group>
<group>
<title>Utility classes</title>
- <packages>org.apache.camel.util:org.apache.camel.util.*:org.apache.camel.view</packages>
+ <packages>org.apache.camel.util:org.apache.camel.util.*</packages>
</group>
</groups>
</configuration>
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/main/java/org/apache/camel/view/GraphGeneratorSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/view/GraphGeneratorSupport.java b/camel-core/src/main/java/org/apache/camel/view/GraphGeneratorSupport.java
deleted file mode 100644
index c7c1e4f..0000000
--- a/camel-core/src/main/java/org/apache/camel/view/GraphGeneratorSupport.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.view;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.ModelCamelContext;
-import org.apache.camel.model.RouteDefinition;
-
-/**
- * @version
- */
-@Deprecated
-public abstract class GraphGeneratorSupport extends GraphSupport {
- protected String dir;
- protected int clusterCounter;
- protected String extension;
-
- private final boolean makeParentDirs = true;
- private Map<String, List<RouteDefinition>> routeGroupMap;
-
- protected GraphGeneratorSupport(String dir, String extension) {
- this.dir = dir;
- this.extension = extension;
- }
-
- public String getRoutesText(CamelContext context) throws IOException {
- // used by web console
- List<RouteDefinition> routes = ((ModelCamelContext)context).getRouteDefinitions();
- routeGroupMap = createRouteGroupMap(routes);
- return createRouteMapText();
- }
-
- private String createRouteMapText() {
- StringWriter buffer = new StringWriter();
- PrintWriter writer = new PrintWriter(buffer);
- generateFile(writer, routeGroupMap);
- writer.close();
- return buffer.toString();
- }
-
- public void drawRoutes(CamelContext context) throws IOException {
- File parent = new File(dir);
- if (makeParentDirs) {
- parent.mkdirs();
- }
- List<RouteDefinition> routes = context.getRouteDefinitions();
- routeGroupMap = createRouteGroupMap(routes);
-
- // generate the global file
- generateFile(parent, "routes" + extension, routeGroupMap);
-
- if (routeGroupMap.size() >= 1) {
- Set<Map.Entry<String, List<RouteDefinition>>> entries = routeGroupMap.entrySet();
- for (Map.Entry<String, List<RouteDefinition>> entry : entries) {
-
- Map<String, List<RouteDefinition>> map = new HashMap<String, List<RouteDefinition>>();
- String group = entry.getKey();
- map.put(group, entry.getValue());
-
- // generate the file containing just the routes in this group
- generateFile(parent, group + extension, map);
- }
- }
- }
-
- private void generateFile(File parent, String fileName, Map<String, List<RouteDefinition>> map) throws IOException {
- nodeMap.clear();
- clusterCounter = 0;
-
- PrintWriter writer = new PrintWriter(new FileWriter(new File(parent, fileName)));
- try {
- generateFile(writer, map);
- } finally {
- writer.close();
- }
- }
-
- protected abstract void generateFile(PrintWriter writer, Map<String, List<RouteDefinition>> map);
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/main/java/org/apache/camel/view/GraphSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/view/GraphSupport.java b/camel-core/src/main/java/org/apache/camel/view/GraphSupport.java
deleted file mode 100644
index a097de0..0000000
--- a/camel-core/src/main/java/org/apache/camel/view/GraphSupport.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.view;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.camel.model.ChoiceDefinition;
-import org.apache.camel.model.FromDefinition;
-import org.apache.camel.model.MulticastDefinition;
-import org.apache.camel.model.PipelineDefinition;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.RouteDefinition;
-import org.apache.camel.model.ToDefinition;
-import org.apache.camel.model.language.ExpressionDefinition;
-import org.apache.camel.util.CollectionStringBuffer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A base class for Graph processing code of Camel EIPs containing a number of helper methods
- *
- * @version
- */
-@Deprecated
-public class GraphSupport {
- protected final Logger log = LoggerFactory.getLogger(getClass());
- protected final Map<Object, NodeData> nodeMap = new HashMap<Object, NodeData>();
- private String imagePrefix = "http://camel.apache.org/images/eip/";
-
- protected String getLabel(List<ExpressionDefinition> expressions) {
- CollectionStringBuffer buffer = new CollectionStringBuffer();
- for (ExpressionDefinition expression : expressions) {
- buffer.append(getLabel(expression));
- }
- return buffer.toString();
- }
-
- protected String getLabel(ExpressionDefinition expression) {
- if (expression != null) {
- return expression.getLabel();
- }
- return "";
- }
-
- protected NodeData getNodeData(Object node) {
- Object key = node;
- if (node instanceof FromDefinition) {
- FromDefinition fromType = (FromDefinition) node;
- key = fromType.getUriOrRef();
- } else if (node instanceof ToDefinition) {
- ToDefinition toType = (ToDefinition) node;
- key = toType.getUriOrRef();
- }
- NodeData answer = null;
- if (key != null) {
- answer = nodeMap.get(key);
- }
- if (answer == null) {
- String id = "node" + (nodeMap.size() + 1);
- answer = new NodeData(id, node, imagePrefix);
- nodeMap.put(key, answer);
- }
- return answer;
- }
-
- protected Map<String, List<RouteDefinition>> createRouteGroupMap(List<RouteDefinition> routes) {
- Map<String, List<RouteDefinition>> map = new HashMap<String, List<RouteDefinition>>();
- for (RouteDefinition route : routes) {
- addRouteToMap(map, route);
- }
- return map;
- }
-
- protected void addRouteToMap(Map<String, List<RouteDefinition>> map, RouteDefinition route) {
- String group = route.getGroup();
- if (group == null) {
- group = "Camel Routes";
- }
- List<RouteDefinition> list = map.get(group);
- if (list == null) {
- list = new ArrayList<RouteDefinition>();
- map.put(group, list);
- }
- list.add(route);
- }
-
- protected boolean isMulticastNode(ProcessorDefinition<?> node) {
- return node instanceof MulticastDefinition || node instanceof ChoiceDefinition;
- }
-
- /**
- * Is the given node a pipeline
- */
- protected boolean isPipeline(ProcessorDefinition<?> node) {
- if (node instanceof MulticastDefinition) {
- return false;
- }
- if (node instanceof PipelineDefinition) {
- return true;
- }
- if (node.getOutputs().size() > 1) {
- // is pipeline if there is more than 1 output and they are all To types
- for (Object type : node.getOutputs()) {
- if (!(type instanceof ToDefinition)) {
- return false;
- }
- }
- return true;
- }
- return false;
- }
-
- public String getImagePrefix() {
- return imagePrefix;
- }
-
- public void setImagePrefix(String imagePrefix) {
- this.imagePrefix = imagePrefix;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/main/java/org/apache/camel/view/ModelFileGenerator.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/view/ModelFileGenerator.java b/camel-core/src/main/java/org/apache/camel/view/ModelFileGenerator.java
deleted file mode 100644
index 25d09de..0000000
--- a/camel-core/src/main/java/org/apache/camel/view/ModelFileGenerator.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.view;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.util.List;
-import java.util.Properties;
-
-import javax.xml.bind.Binder;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.RuntimeTransformException;
-import org.apache.camel.builder.xml.Namespaces;
-import org.apache.camel.converter.jaxp.XmlConverter;
-import org.apache.camel.model.RouteDefinition;
-import org.apache.camel.model.RoutesDefinition;
-import org.apache.camel.util.ObjectHelper;
-
-@Deprecated
-public class ModelFileGenerator {
-
- private static final String DEFAULT_ROOT_ELEMENT_NAME = "routes";
- private final JAXBContext jaxbContext;
- private Binder<Node> binder;
-
- public ModelFileGenerator(JAXBContext jaxbContext) {
- this.jaxbContext = jaxbContext;
- }
-
- /**
- * Write the specified 'routeTypes' to 'fileName' as XML using JAXB.
- */
- public void marshalRoutesUsingJaxb(String fileName, List<RouteDefinition> routeTypes) throws IOException {
- OutputStream outputStream = outputStream(fileName);
-
- try {
- XmlConverter converter = converter();
- Document doc = converter.createDocument();
-
- Element root = doc.createElement(rootElementName());
- root.setAttribute("xmlns", Namespaces.DEFAULT_NAMESPACE);
- doc.appendChild(root);
-
- for (RouteDefinition routeType : routeTypes) {
- addJaxbElementToNode(root, routeType);
- }
-
- Result result = new StreamResult(new OutputStreamWriter(outputStream, XmlConverter.defaultCharset));
-
- copyToResult(converter, doc, result);
- } catch (ParserConfigurationException e) {
- throw new RuntimeTransformException(e);
- } catch (TransformerException e) {
- throw new RuntimeTransformException(e);
- } finally {
- outputStream.close();
- }
- }
-
- /**
- * Returns a configured XmlConverter
- */
- private XmlConverter converter() {
- XmlConverter converter = new XmlConverter();
- TransformerFactory transformerFactory = converter.getTransformerFactory();
- transformerFactory.setAttribute("indent-number", 2);
- return converter;
- }
-
- /**
- * Copies the given input Document into the required result using the provided converter.
- */
- private void copyToResult(XmlConverter converter, Document doc, Result result) throws TransformerException {
- Properties outputProperties = converter.defaultOutputProperties();
- outputProperties.put(OutputKeys.OMIT_XML_DECLARATION, "no");
- outputProperties.put(OutputKeys.INDENT, "yes");
-
- converter.toResult(converter.toDOMSource(doc), result, outputProperties);
- }
-
- /**
- * Convert the specified object into XML and add it as a child of 'node' using JAXB.
- */
- private void addJaxbElementToNode(Node node, Object jaxbElement) {
- try {
- if (binder == null) {
- binder = jaxbContext.createBinder();
- }
- binder.marshal(jaxbElement, node);
- } catch (JAXBException e) {
- throw new RuntimeCamelException(e);
- }
- }
-
- /**
- * Return the root element name for the list of routes.
- */
- private String rootElementName() {
- XmlRootElement annotation = (RoutesDefinition.class).getAnnotation(XmlRootElement.class);
- if (annotation != null) {
- String elementName = annotation.name();
- if (ObjectHelper.isNotEmpty(elementName)) {
- return elementName;
- }
- }
- return DEFAULT_ROOT_ELEMENT_NAME;
- }
-
- /**
- * returns an output stream for the filename specified.
- */
- private OutputStream outputStream(String fileName) throws FileNotFoundException {
- File file = new File(fileName);
- if (!file.exists()) {
- File parentFile = file.getParentFile();
- if (parentFile != null) {
- parentFile.mkdirs();
- }
- }
- return new FileOutputStream(file);
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/main/java/org/apache/camel/view/NodeData.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/view/NodeData.java b/camel-core/src/main/java/org/apache/camel/view/NodeData.java
deleted file mode 100644
index 88d3cff..0000000
--- a/camel-core/src/main/java/org/apache/camel/view/NodeData.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.view;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import org.apache.camel.model.AggregateDefinition;
-import org.apache.camel.model.BeanDefinition;
-import org.apache.camel.model.ChoiceDefinition;
-import org.apache.camel.model.FilterDefinition;
-import org.apache.camel.model.FromDefinition;
-import org.apache.camel.model.OtherwiseDefinition;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.RecipientListDefinition;
-import org.apache.camel.model.ResequenceDefinition;
-import org.apache.camel.model.RoutingSlipDefinition;
-import org.apache.camel.model.SplitDefinition;
-import org.apache.camel.model.ToDefinition;
-import org.apache.camel.model.TransformDefinition;
-import org.apache.camel.model.WhenDefinition;
-
-import static org.apache.camel.util.ObjectHelper.isEmpty;
-import static org.apache.camel.util.ObjectHelper.isNotEmpty;
-
-/**
- * Represents a node in the EIP diagram tree
- *
- * @version
- */
-@Deprecated
-public class NodeData {
- public String id;
- public String image;
- public String label;
- public String shape;
- public String edgeLabel;
- public String tooltop;
- public String nodeType;
- public boolean nodeWritten;
- public String url;
- public List<ProcessorDefinition<?>> outputs;
- public String association = "property";
-
- public NodeData(String id, Object node, String imagePrefix) {
- this.id = id;
-
- if (node instanceof ProcessorDefinition) {
- ProcessorDefinition<?> processorType = (ProcessorDefinition<?>)node;
- this.edgeLabel = processorType.getLabel();
- }
- if (node instanceof FromDefinition) {
- FromDefinition fromType = (FromDefinition)node;
- this.tooltop = fromType.getLabel();
- this.label = removeQueryString(this.tooltop);
- this.url = "http://camel.apache.org/message-endpoint.html";
- } else if (node instanceof ToDefinition) {
- ToDefinition toType = (ToDefinition)node;
- this.tooltop = toType.getLabel();
- this.label = removeQueryString(this.tooltop);
- this.edgeLabel = "";
- this.url = "http://camel.apache.org/message-endpoint.html";
- } else if (node instanceof FilterDefinition) {
- this.image = imagePrefix + "MessageFilterIcon.png";
- this.label = "Filter";
- this.nodeType = "Message Filter";
- } else if (node instanceof WhenDefinition) {
- this.image = imagePrefix + "MessageFilterIcon.png";
- this.nodeType = "When Filter";
- this.label = "When";
- this.url = "http://camel.apache.org/content-based-router.html";
- } else if (node instanceof OtherwiseDefinition) {
- this.nodeType = "Otherwise";
- this.edgeLabel = "";
- this.url = "http://camel.apache.org/content-based-router.html";
- this.tooltop = "Otherwise";
- } else if (node instanceof ChoiceDefinition) {
- this.image = imagePrefix + "ContentBasedRouterIcon.png";
- this.nodeType = "Content Based Router";
- this.label = "Choice";
- this.edgeLabel = "";
-
- ChoiceDefinition choice = (ChoiceDefinition)node;
- List<ProcessorDefinition<?>> outputs = new ArrayList<ProcessorDefinition<?>>(choice.getWhenClauses());
- if (choice.getOtherwise() != null) {
- outputs.add(choice.getOtherwise());
- }
- this.outputs = outputs;
- } else if (node instanceof RecipientListDefinition) {
- this.image = imagePrefix + "RecipientListIcon.png";
- this.nodeType = "Recipient List";
- } else if (node instanceof RoutingSlipDefinition) {
- this.image = imagePrefix + "RoutingTableIcon.png";
- this.nodeType = "Routing Slip";
- this.url = "http://camel.apache.org/routing-slip.html";
- } else if (node instanceof SplitDefinition) {
- this.image = imagePrefix + "SplitterIcon.png";
- this.nodeType = "Splitter";
- } else if (node instanceof AggregateDefinition) {
- this.image = imagePrefix + "AggregatorIcon.png";
- this.nodeType = "Aggregator";
- } else if (node instanceof ResequenceDefinition) {
- this.image = imagePrefix + "ResequencerIcon.png";
- this.nodeType = "Resequencer";
- } else if (node instanceof BeanDefinition) {
- BeanDefinition beanRef = (BeanDefinition) node;
- this.nodeType = "Bean Ref";
- this.label = beanRef.getLabel() + " Bean";
- this.shape = "box";
- } else if (node instanceof TransformDefinition) {
- this.nodeType = "Transform";
- this.url = "http://camel.apache.org/message-translator.html";
- }
-
- // lets auto-default as many values as we can
- if (isEmpty(this.nodeType) && node != null) {
- String name = node.getClass().getName();
- int idx = name.lastIndexOf('.');
- if (idx > 0) {
- name = name.substring(idx + 1);
- }
- if (name.endsWith("Type")) {
- name = name.substring(0, name.length() - 4);
- }
- this.nodeType = insertSpacesBetweenCamelCase(name);
- }
- if (this.label == null) {
- if (isEmpty(this.image)) {
- this.label = this.nodeType;
- this.shape = "box";
- } else if (isNotEmpty(this.edgeLabel)) {
- this.label = "";
- } else {
- this.label = node.toString();
- }
- }
- if (isEmpty(this.tooltop)) {
- if (isNotEmpty(this.nodeType)) {
- String description = isNotEmpty(this.edgeLabel) ? this.edgeLabel : this.label;
- this.tooltop = this.nodeType + ": " + description;
- } else {
- this.tooltop = this.label;
- }
- }
- if (isEmpty(this.url) && isNotEmpty(this.nodeType)) {
- this.url = "http://camel.apache.org/" + this.nodeType.toLowerCase(Locale.ENGLISH).replace(' ', '-') + ".html";
- }
- if (node instanceof ProcessorDefinition && this.outputs == null) {
- ProcessorDefinition<?> processorType = (ProcessorDefinition<?>)node;
- this.outputs = processorType.getOutputs();
- }
- }
-
- protected String removeQueryString(String text) {
- int idx = text.indexOf('?');
- if (idx <= 0) {
- return text;
- } else {
- return text.substring(0, idx);
- }
- }
-
- /**
- * Inserts a space before each upper case letter after a lowercase
- */
- public static String insertSpacesBetweenCamelCase(String name) {
- boolean lastCharacterLowerCase = false;
- StringBuilder buffer = new StringBuilder();
- int i = 0;
- for (int size = name.length(); i < size; i++) {
- char ch = name.charAt(i);
- if (Character.isUpperCase(ch)) {
- if (lastCharacterLowerCase) {
- buffer.append(' ');
- }
- lastCharacterLowerCase = false;
- } else {
- lastCharacterLowerCase = true;
- }
- buffer.append(ch);
- }
- return buffer.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/main/java/org/apache/camel/view/RouteDotGenerator.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/view/RouteDotGenerator.java b/camel-core/src/main/java/org/apache/camel/view/RouteDotGenerator.java
deleted file mode 100644
index 358f80d..0000000
--- a/camel-core/src/main/java/org/apache/camel/view/RouteDotGenerator.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.view;
-
-import java.io.PrintWriter;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.camel.model.FromDefinition;
-import org.apache.camel.model.MulticastDefinition;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.RouteDefinition;
-import static org.apache.camel.util.ObjectHelper.isNotEmpty;
-/**
- * A <a href="http://www.graphviz.org/">DOT</a> file creator plugin which
- * creates a DOT file showing the current routes
- *
- * @version
- */
-@Deprecated
-public class RouteDotGenerator extends GraphGeneratorSupport {
-
- public RouteDotGenerator(String dir) {
- super(dir, ".dot");
- }
-
- // Implementation methods
- //-------------------------------------------------------------------------
-
- protected void printRoutes(PrintWriter writer, Map<String, List<RouteDefinition>> map) {
- Set<Map.Entry<String, List<RouteDefinition>>> entries = map.entrySet();
- for (Map.Entry<String, List<RouteDefinition>> entry : entries) {
- String group = entry.getKey();
- printRoutes(writer, group, entry.getValue());
- }
- }
-
- protected void printRoutes(PrintWriter writer, String group, List<RouteDefinition> routes) {
- if (group != null) {
- writer.println("subgraph cluster_" + (clusterCounter++) + " {");
- writer.println("label = \"" + group + "\";");
- writer.println("color = grey;");
- writer.println("style = \"dashed\";");
- writer.println("URL = \"" + group + ".html\";");
- writer.println();
- }
- for (RouteDefinition route : routes) {
- List<FromDefinition> inputs = route.getInputs();
- for (FromDefinition input : inputs) {
- printRoute(writer, route, input);
- }
- writer.println();
- }
- if (group != null) {
- writer.println("}");
- writer.println();
- }
- }
-
- protected void printRoute(PrintWriter writer, final RouteDefinition route, FromDefinition input) {
- NodeData nodeData = getNodeData(input);
-
- printNode(writer, nodeData);
-
- NodeData from = nodeData;
- for (ProcessorDefinition<?> output : route.getOutputs()) {
- NodeData newData = printNode(writer, from, output);
- from = newData;
- }
- }
-
- protected NodeData printNode(PrintWriter writer, NodeData fromData, ProcessorDefinition<?> node) {
- if (node instanceof MulticastDefinition) {
- // no need for a multicast or interceptor node
- List<ProcessorDefinition<?>> outputs = node.getOutputs();
- boolean isPipeline = isPipeline(node);
- for (ProcessorDefinition<?> output : outputs) {
- NodeData out = printNode(writer, fromData, output);
- // if in pipeline then we should move the from node to the next in the pipeline
- if (isPipeline) {
- fromData = out;
- }
- }
- return fromData;
- }
- NodeData toData = getNodeData(node);
-
- printNode(writer, toData);
-
- if (fromData != null) {
- writer.print(fromData.id);
- writer.print(" -> ");
- writer.print(toData.id);
- writer.println(" [");
-
- String label = fromData.edgeLabel;
- if (isNotEmpty(label)) {
- writer.println("label = \"" + label + "\"");
- }
- writer.println("];");
- }
-
- // now lets write any children
- List<ProcessorDefinition<?>> outputs = toData.outputs;
- if (outputs != null) {
- for (ProcessorDefinition<?> output : outputs) {
- NodeData newData = printNode(writer, toData, output);
- if (!isMulticastNode(node)) {
- toData = newData;
- }
- }
- }
- return toData;
- }
-
- protected void printNode(PrintWriter writer, NodeData data) {
- if (!data.nodeWritten) {
- data.nodeWritten = true;
-
- writer.println();
- writer.print(data.id);
- writer.println(" [");
- writer.println("label = \"" + data.label + "\"");
- writer.println("tooltip = \"" + data.tooltop + "\"");
- if (data.url != null) {
- writer.println("URL = \"" + data.url + "\"");
- }
-
- String image = data.image;
- if (image != null) {
- writer.println("shapefile = \"" + image + "\"");
- writer.println("peripheries=0");
- }
- String shape = data.shape;
- if (shape == null && image != null) {
- shape = "custom";
- }
- if (shape != null) {
- writer.println("shape = \"" + shape + "\"");
- }
- writer.println("];");
- writer.println();
- }
- }
-
- protected void generateFile(PrintWriter writer, Map<String, List<RouteDefinition>> map) {
- writer.println("digraph CamelRoutes {");
- writer.println();
-
- writer.println("node [style = \"rounded,filled\", fillcolor = yellow, "
- + "fontname=\"Helvetica-Oblique\"];");
- writer.println();
- printRoutes(writer, map);
-
- writer.println("}");
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/main/java/org/apache/camel/view/XmlGraphGenerator.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/view/XmlGraphGenerator.java b/camel-core/src/main/java/org/apache/camel/view/XmlGraphGenerator.java
deleted file mode 100644
index 7978ef7..0000000
--- a/camel-core/src/main/java/org/apache/camel/view/XmlGraphGenerator.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.view;
-
-import java.io.PrintWriter;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.camel.model.FromDefinition;
-import org.apache.camel.model.MulticastDefinition;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.RouteDefinition;
-import static org.apache.camel.util.ObjectHelper.isEmpty;
-import static org.apache.camel.util.StringHelper.xmlEncode;
-
-/**
- * @version
- */
-@Deprecated
-public class XmlGraphGenerator extends GraphGeneratorSupport {
- private boolean addUrl = true;
-
- public XmlGraphGenerator(String dir) {
- super(dir, ".xml");
- }
-
- protected void generateFile(PrintWriter writer, Map<String, List<RouteDefinition>> map) {
- writer.println("<?xml version='1.0' encoding='UTF-8'?>");
- writer.println("<Graph>");
- writer.println();
-
- if (map.size() > 0) {
- writer.println("<Node id='root' name='Camel Routes' description='Collection of Camel Routes' nodeType='root'/>");
- }
- printRoutes(writer, map);
-
- writer.println();
- writer.println("</Graph>");
- }
-
- protected void printRoutes(PrintWriter writer, Map<String, List<RouteDefinition>> map) {
- Set<Map.Entry<String, List<RouteDefinition>>> entries = map.entrySet();
- for (Map.Entry<String, List<RouteDefinition>> entry : entries) {
- String group = entry.getKey();
- printRoutes(writer, group, entry.getValue());
- }
- }
-
- protected void printRoutes(PrintWriter writer, String group, List<RouteDefinition> routes) {
- group = xmlEncode(group);
- if (group != null) {
- int idx = group.lastIndexOf('.');
- String name = group;
- if (idx > 0 && idx < group.length() - 1) {
- name = group.substring(idx + 1);
- }
- writer.println("<Node id='" + group + "' name='" + name + "' description='" + group + "' nodeType='group'/>");
- writer.println("<Edge fromID='root' toID='" + group + "'/>");
- }
- for (RouteDefinition route : routes) {
- List<FromDefinition> inputs = route.getInputs();
- boolean first = true;
- for (FromDefinition input : inputs) {
- NodeData nodeData = getNodeData(input);
- if (first) {
- first = false;
- if (group != null) {
- writer.println("<Edge fromID='" + group + "' toID='" + xmlEncode(nodeData.id) + "'/>");
- }
- }
- printRoute(writer, route, nodeData);
- }
- writer.println();
- }
- }
-
- protected void printRoute(PrintWriter writer, final RouteDefinition route, NodeData nodeData) {
- printNode(writer, nodeData);
-
- NodeData from = nodeData;
- for (ProcessorDefinition<?> output : route.getOutputs()) {
- NodeData newData = printNode(writer, from, output);
- from = newData;
- }
- }
-
- protected NodeData printNode(PrintWriter writer, NodeData fromData, ProcessorDefinition<?> node) {
- if (node instanceof MulticastDefinition) {
- // no need for a multicast node
- List<ProcessorDefinition<?>> outputs = node.getOutputs();
- for (ProcessorDefinition<?> output : outputs) {
- printNode(writer, fromData, output);
- }
- return fromData;
- }
- NodeData toData = getNodeData(node);
-
- printNode(writer, toData);
-
- if (fromData != null) {
- writer.print("<Edge fromID=\"");
- writer.print(xmlEncode(fromData.id));
- writer.print("\" toID=\"");
- writer.print(xmlEncode(toData.id));
- String association = toData.edgeLabel;
- if (isEmpty(association)) {
- writer.print("\" association=\"");
- writer.print(xmlEncode(association));
- }
- writer.println("\"/>");
- }
-
- // now lets write any children
- List<ProcessorDefinition<?>> outputs = toData.outputs;
- if (outputs != null) {
- for (ProcessorDefinition<?> output : outputs) {
- NodeData newData = printNode(writer, toData, output);
- if (!isMulticastNode(node)) {
- toData = newData;
- }
- }
- }
- return toData;
- }
-
- protected void printNode(PrintWriter writer, NodeData data) {
- if (!data.nodeWritten) {
- data.nodeWritten = true;
-
- writer.println();
- writer.print("<Node id=\"");
- writer.print(xmlEncode(data.id));
- writer.print("\" name=\"");
- String name = data.label;
- if (isEmpty(name)) {
- name = data.tooltop;
- }
- writer.print(xmlEncode(name));
- writer.print("\" nodeType=\"");
- String nodeType = data.image;
- if (isEmpty(nodeType)) {
- nodeType = data.shape;
- if (isEmpty(nodeType)) {
- nodeType = "node";
- }
- }
- writer.print(xmlEncode(nodeType));
- writer.print("\" description=\"");
- writer.print(xmlEncode(data.tooltop));
- if (addUrl) {
- writer.print("\" url=\"");
- writer.print(xmlEncode(data.url));
- }
- writer.println("\"/>");
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/main/java/org/apache/camel/view/package.html
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/view/package.html b/camel-core/src/main/java/org/apache/camel/view/package.html
deleted file mode 100644
index c0236e3..0000000
--- a/camel-core/src/main/java/org/apache/camel/view/package.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
-<head>
-</head>
-<body>
-
-<b>Deprecated:</b>
-Helper class to help with the <a href="http://activemq.apache.org/visualisation.html">Visualisation</a> of Routes
-
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java b/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java
deleted file mode 100644
index 625ae0b..0000000
--- a/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.view;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.builder.xml.XPathBuilder;
-import org.apache.camel.component.bean.MyFooBean;
-import org.apache.camel.impl.JndiRegistry;
-import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy;
-
-/**
- * @version
- */
-public class DotViewTest extends ContextTestSupport {
- protected String outputDirectory = "target/site/cameldoc";
-
- public void testGenerateFiles() throws Exception {
- RouteDotGenerator generator = new RouteDotGenerator(outputDirectory);
- generator.drawRoutes(context);
- }
-
- @Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry jndi = super.createRegistry();
- jndi.bind("myBean", new MyFooBean());
- return jndi;
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- context.addRoutes(new MulticastRoute());
- context.addRoutes(new PipelineRoute());
- context.addRoutes(new AnotherPipelineRoute());
- context.addRoutes(new FromToRoute());
- context.addRoutes(new ChoiceRoute());
- context.addRoutes(new FilterRoute());
- context.addRoutes(new ComplexRoute());
- context.addRoutes(new FromToBeanRoute());
- context.addRoutes(new RoutingSlipRoute());
- context.addRoutes(new AggreagateRoute());
- context.addRoutes(new ResequenceRoute());
- }
-
- static class MulticastRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("seda:multicast.in").
- multicast().to("seda:multicast.out1", "seda:multicast.out2", "seda:multicast.out3");
- }
- }
-
- static class PipelineRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("seda:pipeline.in").to("seda:pipeline.out1", "seda:pipeline.out2", "seda:pipeline.out3");
- }
- }
-
- static class AnotherPipelineRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("seda:pipeline.in2").pipeline("seda:pipeline.out1", "seda:pipeline.out2", "seda:pipeline.out3");
- }
- }
-
- static class FromToRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("seda:foo").to("seda:bar");
- }
- }
-
- static class FromToBeanRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("seda:foo2").bean("myBean", "hello");
- }
- }
-
- static class RoutingSlipRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("seda:foo3").routingSlip(header("splipHeader"));
- }
- }
-
- static class AggreagateRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("seda:foo4")
- .aggregate(constant("messageId"), new UseLatestAggregationStrategy()).completionTimeout(1000L).
- to("seda:aggregated");
- }
- }
-
- static class ResequenceRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("seda:foo5").resequence(constant("seqNum")).to("seda:bar");
- }
- }
-
- static class ChoiceRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("file:target/foo/xyz?noop=true").
- choice().
- when(xpath("/person/city = 'London'")).to("file:target/messages/uk").
- otherwise().to("file:target/messages/others");
- }
- }
-
- static class FilterRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("file:target/foo/bar?noop=true").filter(header("foo").isEqualTo("bar"))
- .to("file:target/xyz?noop=true");
- }
- }
-
- static class ComplexRoute extends RouteBuilder {
- public void configure() throws Exception {
- from("file:target/xyz?noop=true").filter(header("foo").isEqualTo("bar"))
- .recipientList(header("bar")).split(XPathBuilder.xpath("/invoice/lineItems")).throttle(3)
- .to("mock:result");
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/test/java/org/apache/camel/view/ModelFileGeneratorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/view/ModelFileGeneratorTest.java b/camel-core/src/test/java/org/apache/camel/view/ModelFileGeneratorTest.java
deleted file mode 100644
index 5b0dc84..0000000
--- a/camel-core/src/test/java/org/apache/camel/view/ModelFileGeneratorTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.view;
-
-import java.io.File;
-import javax.xml.bind.JAXBContext;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-
-/**
- * @version
- */
-public class ModelFileGeneratorTest extends ContextTestSupport {
- protected String outputDirectory = "target/site/model";
-
- @Override
- protected void setUp() throws Exception {
- deleteDirectory(outputDirectory);
- super.setUp();
- }
-
- public void testGenerateModel() throws Exception {
- try {
- ModelFileGenerator generator = new ModelFileGenerator(JAXBContext.newInstance("org.apache.camel.model"));
- generator.marshalRoutesUsingJaxb(outputDirectory + "/route.xml", context.getRouteDefinitions());
- } catch (IllegalArgumentException e) {
- if (e.getMessage().startsWith("Not supported")) {
- // ignore as some OS does not support indent-number etc.
- return;
- } else {
- throw e;
- }
- }
-
- File out = new File(outputDirectory + "/route.xml");
- assertTrue("File should have been generated", out.exists());
-
- String content = context.getTypeConverter().convertTo(String.class, out);
- assertTrue("Should contain a route", content.contains("<route"));
- assertTrue("Should contain a route", content.contains("</route>"));
- assertTrue("Should contain a route", content.contains("direct:start"));
- assertTrue("Should contain a route", content.contains("mock:result"));
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- from("direct:start").to("mock:result");
- }
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/test/java/org/apache/camel/view/RouteDotGeneratorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/view/RouteDotGeneratorTest.java b/camel-core/src/test/java/org/apache/camel/view/RouteDotGeneratorTest.java
deleted file mode 100644
index dc98f5a..0000000
--- a/camel-core/src/test/java/org/apache/camel/view/RouteDotGeneratorTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.view;
-
-import junit.framework.TestCase;
-
-/**
- * @version
- */
-public class RouteDotGeneratorTest extends TestCase {
-
- public void testInsertSpacesBetweenCamelCase() throws Exception {
- String value = NodeData.insertSpacesBetweenCamelCase("FooBarType");
- assertEquals("Converted value", "Foo Bar Type", value);
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/camel-core/src/test/java/org/apache/camel/view/XmlGraphTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/view/XmlGraphTest.java b/camel-core/src/test/java/org/apache/camel/view/XmlGraphTest.java
deleted file mode 100644
index 095438f..0000000
--- a/camel-core/src/test/java/org/apache/camel/view/XmlGraphTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.view;
-
-/**
- * @version
- */
-public class XmlGraphTest extends DotViewTest {
-
- @Override
- public void testGenerateFiles() throws Exception {
- XmlGraphGenerator generator = new XmlGraphGenerator(outputDirectory);
- generator.drawRoutes(context);
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java b/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
index 3a716fc..d336227 100644
--- a/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
+++ b/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
@@ -22,26 +22,20 @@ import java.util.LinkedList;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
-
import javax.naming.Context;
import javax.naming.InitialContext;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.google.inject.Binding;
import com.google.inject.Injector;
import com.google.inject.Key;
-
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.guice.inject.Injectors;
import org.apache.camel.main.MainSupport;
-import org.apache.camel.model.Constants;
import org.apache.camel.util.IOHelper;
import org.apache.camel.util.ObjectHelper;
-import org.apache.camel.view.ModelFileGenerator;
/**
* A command line tool for booting up a CamelContext using a Guice Injector via JNDI
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java b/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
index 9a2f327..a24e3f9 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
@@ -27,13 +27,11 @@ import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
-import javax.xml.bind.JAXBException;
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.impl.MainSupport;
import org.apache.camel.util.IOHelper;
-import org.apache.camel.view.ModelFileGenerator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -229,10 +227,6 @@ public class Main extends MainSupport {
return answer;
}
- protected ModelFileGenerator createModelFileGenerator() throws JAXBException {
- return new ModelFileGenerator(new SpringModelJAXBContextFactory().newJAXBContext());
- }
-
protected AbstractApplicationContext createAdditionalLocationsFromClasspath() throws IOException {
Set<String> locations = new LinkedHashSet<String>();
findLocations(locations, Main.class.getClassLoader());
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
index 470b256..4979254 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
@@ -57,7 +57,6 @@ import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.spring.KeyStoreParametersFactoryBean;
import org.apache.camel.util.spring.SSLContextParametersFactoryBean;
import org.apache.camel.util.spring.SecureRandomParametersFactoryBean;
-import org.apache.camel.view.ModelFileGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanCreationException;
@@ -120,10 +119,6 @@ public class CamelNamespaceHandler extends NamespaceHandlerSupport {
}
}
- public ModelFileGenerator createModelFileGenerator() throws JAXBException {
- return new ModelFileGenerator(getJaxbContext());
- }
-
public void init() {
// register restContext parser
registerParser("restContext", new RestContextDefinitionParser());
http://git-wip-us.apache.org/repos/asf/camel/blob/b63707cd/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java b/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
index 3094d5e..ba6bcf3 100644
--- a/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
+++ b/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
@@ -21,12 +21,9 @@ import java.util.LinkedList;
import java.util.Map;
import java.util.Properties;
-import javax.xml.bind.JAXBException;
-
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.main.MainSupport;
-import org.apache.camel.view.ModelFileGenerator;
import org.osgi.framework.BundleContext;
/**
@@ -120,8 +117,6 @@ public class Main extends MainSupport {
// call completed to properly stop as we count down the waiting latch
completed();
}
-
-
@Override
protected ProducerTemplate findOrCreateCamelTemplate() {
@@ -139,9 +134,6 @@ public class Main extends MainSupport {
protected BundleContext createBundleContext(String name) throws Exception {
return CamelBlueprintHelper.createBundleContext(name, descriptors, isIncludeSelfAsBundle());
}
-
-
-
@Override
protected Map<String, CamelContext> getCamelContextMap() {
@@ -152,11 +144,6 @@ public class Main extends MainSupport {
return map;
}
- @Override
- protected ModelFileGenerator createModelFileGenerator() throws JAXBException {
- throw new UnsupportedOperationException("This method is not supported");
- }
-
public String getDescriptors() {
return descriptors;
}