[jboss-svn-commits] JBL Code SVN: r33020 - in labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product: rosetta/src/org/jboss/soa/esb/listeners/config/mappers130 and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sun May 23 13:34:41 EDT 2010
Author: dward
Date: 2010-05-23 13:34:41 -0400 (Sun, 23 May 2010)
New Revision: 33020
Modified:
labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/etc/schemas/xml/jbossesb-1.3.0.xsd
labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/CamelGatewayMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/camel/CamelGateway.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/samples/quickstarts/camel_helloworld/deployment.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/samples/quickstarts/camel_helloworld/jboss-esb-unfiltered.xml
Log:
Minor naming tweaks.
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/etc/schemas/xml/jbossesb-1.3.0.xsd
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/etc/schemas/xml/jbossesb-1.3.0.xsd 2010-05-23 15:13:05 UTC (rev 33019)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/etc/schemas/xml/jbossesb-1.3.0.xsd 2010-05-23 17:34:41 UTC (rev 33020)
@@ -2070,11 +2070,11 @@
<xsd:element maxOccurs="unbounded" minOccurs="0"
ref="jesb:route" />
</xsd:sequence>
- <xsd:attribute name="from-uri" type="xsd:string"
+ <xsd:attribute name="route-from-uri" type="xsd:string"
use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
- Camel "from" URI.
+ Camel Route "from" URI.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@@ -2109,11 +2109,11 @@
<xsd:element maxOccurs="unbounded" minOccurs="0"
ref="jesb:route" />
</xsd:sequence>
- <xsd:attribute name="from-uri" type="xsd:string"
+ <xsd:attribute name="route-from-uri" type="xsd:string"
use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
- Camel "from" URI.
+ Camel Route "from" URI.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/CamelGatewayMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/CamelGatewayMapper.java 2010-05-23 15:13:05 UTC (rev 33019)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/CamelGatewayMapper.java 2010-05-23 17:34:41 UTC (rev 33020)
@@ -49,12 +49,12 @@
gatewayNode.setAttribute("name", gateway.getName());
- URI toURI = createToURI(gateway, model);
+ URI routeToURI = createRouteToURI(gateway, model);
List<String> routeXMLs = new ArrayList<String>();
- // <camel-gateway from-uri="">
- URI gatewayFromURI = createURI(gateway.getFromUri());
+ // <camel-gateway route-from-uri="">
+ URI gatewayRouteFromURI = createURI(gateway.getRouteFromUri());
final CamelBus bus;
try {
@@ -65,24 +65,26 @@
if (bus != null) {
try {
- if (gatewayFromURI == null) {
- // <camel-bus from-uri="">
- URI busFromURI = createURI(bus.getFromUri());
- addRouteXML(busFromURI, toURI, routeXMLs);
+ if (gatewayRouteFromURI == null) {
+ // <camel-bus route-from-uri="">
+ URI busRouteFromURI = createURI(bus.getRouteFromUri());
+ addRouteXML(busRouteFromURI, routeToURI, routeXMLs);
}
// <camel-bus><route>*
- for (XmlObject route : bus.getRouteList()) {
- addRouteXML(route, toURI, routeXMLs);
+ for (XmlObject busRoute : bus.getRouteList()) {
+ addRouteXML(busRoute, routeToURI, routeXMLs);
}
} catch (ClassCastException e) {
throw new ConfigurationException("Invalid bus config [" + gateway.getBusidref() + "]. Should be contained within a <camel-provider> instance. Unexpected exception - this should have caused a validation error!");
}
}
- addRouteXML(gatewayFromURI, toURI, routeXMLs);
+ if (gatewayRouteFromURI != null) {
+ addRouteXML(gatewayRouteFromURI, routeToURI, routeXMLs);
+ }
// <camel-gateway><route>*
- for (XmlObject route : gateway.getRouteList()) {
- addRouteXML(route, toURI, routeXMLs);
+ for (XmlObject gatewayRoute : gateway.getRouteList()) {
+ addRouteXML(gatewayRoute, routeToURI, routeXMLs);
}
// Map the standard listener attributes - common across all listener types...
@@ -104,7 +106,7 @@
return gatewayNode;
}
- private static URI createToURI(final CamelGatewayDocument.CamelGateway listener, final XMLBeansModel model) throws ConfigurationException {
+ private static URI createRouteToURI(final CamelGatewayDocument.CamelGateway listener, final XMLBeansModel model) throws ConfigurationException {
Service service = model.getService(listener);
Map<String,Object> toParams = new LinkedHashMap<String,Object>();
toParams.put(JBossESBComponent.CATEGORY, service.getCategory());
@@ -135,30 +137,30 @@
return null;
}
- private static void addRouteXML(URI fromURI, URI toURI, List<String> routeXMLs) throws ConfigurationException {
- if (fromURI != null) {
+ private static void addRouteXML(URI routeFromURI, URI routeToURI, List<String> routeXMLs) throws ConfigurationException {
+ if (routeFromURI != null) {
StringBuilder sb = new StringBuilder();
sb.append("<route><from uri=\"");
- sb.append(fromURI);
+ sb.append(routeFromURI);
sb.append("\"/><to uri=\"");
- sb.append(toURI);
+ sb.append(routeToURI);
sb.append("\"/></route>");
routeXMLs.add(sb.toString());
}
}
- private static void addRouteXML(XmlObject routes, URI toURI, List<String> routeXMLs) {
- if (routes != null) {
+ private static void addRouteXML(XmlObject route, URI routeToURI, List<String> routeXMLs) {
+ if (route != null) {
XmlOptions xo = new XmlOptions();
xo.setSaveOuter();
xo.setSavePrettyPrint();
- String routeXML = routes.xmlText(xo);
+ String routeXML = route.xmlText(xo);
routeXML = routeXML.replaceAll(" xmlns=\".*\"", "");
routeXML = routeXML.replaceAll(" ", "");
routeXML = routeXML.replaceAll("\\n", "");
StringBuilder sb = new StringBuilder();
sb.append("<to uri=\"");
- sb.append(toURI);
+ sb.append(routeToURI);
sb.append("\"/></route>");
routeXML = routeXML.replaceAll("</route>", sb.toString());
routeXMLs.add(routeXML);
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/camel/CamelGateway.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/camel/CamelGateway.java 2010-05-23 15:13:05 UTC (rev 33019)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/camel/CamelGateway.java 2010-05-23 17:34:41 UTC (rev 33020)
@@ -59,7 +59,6 @@
String xml = property.getRequiredAttribute("value");
if (xml != null) {
xml = xml.trim();
- xml = xml.replaceAll("&", "&");
if (xml.length() > 0) {
sb.append(xml);
routesDefined = true;
@@ -71,7 +70,7 @@
throw new ConfigurationException("no routes defined; add at least one route");
}
sb.append("</routes>");
- routesXML = sb.toString();
+ routesXML = sb.toString().replaceAll("&", "&");
}
@Override
@@ -80,6 +79,7 @@
camelContext.disableJMX();
camelContext.addComponent(JBossESBComponent.JBOSSESB, new JBossESBComponent());
logger.info("adding routes [" + routesXML + "]");
+ // Don't let the namespace fool you; there's no dependency on Spring at this level!
String jaxbRoutesXML = routesXML.replaceFirst("<routes>", "<routes xmlns=\"http://camel.apache.org/schema/spring\">").replaceAll("&", "&");
try {
JAXBContext jc = JAXBContext.newInstance(Constants.JAXB_CONTEXT_PACKAGES);
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/samples/quickstarts/camel_helloworld/deployment.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/samples/quickstarts/camel_helloworld/deployment.xml 2010-05-23 15:13:05 UTC (rev 33019)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/samples/quickstarts/camel_helloworld/deployment.xml 2010-05-23 17:34:41 UTC (rev 33020)
@@ -1,3 +1 @@
-<jbossesb-deployment>
- <depends>jboss.esb:deployment=spring.esb</depends>
-</jbossesb-deployment>
+<jbossesb-deployment/>
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/samples/quickstarts/camel_helloworld/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/samples/quickstarts/camel_helloworld/jboss-esb-unfiltered.xml 2010-05-23 15:13:05 UTC (rev 33019)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway/product/samples/quickstarts/camel_helloworld/jboss-esb-unfiltered.xml 2010-05-23 17:34:41 UTC (rev 33020)
@@ -4,11 +4,11 @@
<!--
<providers>
<camel-provider name="provider1">
- <camel-bus busid="bus1" from-uri="file://@INPUTDIR@?delete=true"/>
+ <camel-bus busid="bus1" route-from-uri="file://@INPUTDIR@?delete=true"/>
<camel-bus busid="bus2">
<route>
<from uri="file://@INPUTDIR@?delete=true"/>
- <to uri="log://camel_helloworld?level=INFO&showAll=true&multiline=true"/>
+ <to uri="log://camel_helloworld?level=INFO"/>
</route>
</camel-bus>
</camel-provider>
@@ -19,24 +19,20 @@
<service category="camel_helloworld" name="service1" description="Hello World" invmScope="GLOBAL">
<listeners>
<!--
- <camel-gateway name="gateway1" from-uri="file://@INPUTDIR@?delete=true"/>
+ <camel-gateway name="gateway1" route-from-uri="file://@INPUTDIR@?delete=true"/>
<camel-gateway name="gateway2">
<route>
<from uri="file://@INPUTDIR@?delete=true"/>
- <to uri="log://camel_helloworld?level=INFO&showAll=true&multiline=true"/>
+ <to uri="log://camel_helloworld?level=INFO"/>
</route>
</camel-gateway>
<camel-gateway name="gateway3" busidref="bus1"/>
<camel-gateway name="gateway4" busidref="bus2"/>
-->
- <camel-gateway name="gateway1" from-uri="file://@INPUTDIR@?delete=true"/>
+ <camel-gateway name="gateway1" route-from-uri="file://@INPUTDIR@?delete=true"/>
</listeners>
<actions mep="OneWay">
- <action name="action1" class="org.jboss.soa.esb.actions.SystemPrintln">
- <!--
- <property name="printfull" value="true"/>
- -->
- </action>
+ <action name="action1" class="org.jboss.soa.esb.actions.SystemPrintln"/>
</actions>
</service>
</services>
More information about the jboss-svn-commits
mailing list