[jboss-svn-commits] JBL Code SVN: r32895 - in labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product: etc/schemas/xml and 18 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat May 15 05:56:09 EDT 2010
Author: dward
Date: 2010-05-15 05:56:08 -0400 (Sat, 15 May 2010)
New Revision: 32895
Added:
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/etc/schemas/xml/jbossesb-1.3.0.xsd
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/etc/schemas/xml/jbossesb-1.3.0.xsdconfig
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/CamelContextContainer.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/CamelContextFactory.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/DefaultCamelContextFactory.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBComponent.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBEndpoint.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBProcessor.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/ServiceProcessor.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ActionMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ESBAwareGenerator.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/FsListenerMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/FtpListenerMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/GatewayGenerator.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/GroovyListenerMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/HibernateListenerMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/HttpGatewayMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JbrListenerMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JcaGatewayMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JmsListenerMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/MapperUtil.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/NotificationMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduleMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduleProviderFactory.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduledListenerMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/SecurityMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/SqlListenerMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/UdpListenerMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/UntypedListenerMapper.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/XMLBeansModel.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model130SchemaParser.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/build.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/deployment.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/jboss-esb.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/lib/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/log4j.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/readme.txt
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/esb/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/esb/samples/quickstart/helloworld_camel/
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/esb/samples/quickstart/helloworld_camel/HelloWorldRouteBuilder.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/esb/samples/quickstart/helloworld_camel/test/
Modified:
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/.classpath
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/build-distr.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/build.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/install/build.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/ivy.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/ivysettings.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/build.xml
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model101SchemaParser.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model110SchemaParser.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model120SchemaParser.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelAdapter.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelParser.java
labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/tests/build.xml
Log:
Commit of Camel integration first pass. There are some bugs, but it works!
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/.classpath
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/.classpath 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/.classpath 2010-05-15 09:56:08 UTC (rev 32895)
@@ -23,17 +23,20 @@
<classpathentry excluding="**/.svn/" kind="src" path="services/soapui-client/src/test/java"/>
<classpathentry excluding="**/.svn/" kind="src" path="services/spring/src/main/java"/>
<classpathentry excluding="**/.svn/" kind="src" path="services/spring/src/test/java"/>
+ <classpathentry excluding="**/.svn/" kind="src" path="samples/quickstarts/helloworld_camel/src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="etc/test/resources/log4j/dev"/>
<classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.0.1.jar"/>
<classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.1.0.jar"/>
<classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.2.0.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.3.0.jar"/>
<classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-registry.jar"/>
<classpathentry kind="lib" path="build/lib/activation-1.1.jar"/>
<classpathentry kind="lib" path="build/lib/ant-1.7.0.jar"/>
<classpathentry kind="lib" path="build/lib/antlr-2.7.7.jar"/>
<classpathentry kind="lib" path="build/lib/bsf-2.3.0.jar"/>
<classpathentry kind="lib" path="build/lib/bsh-1.3.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/camel-core-2.2.0.jar"/>
<classpathentry kind="lib" path="build/lib/cglib-nodep-2.1_3.jar"/>
<classpathentry kind="lib" path="build/lib/commons-beanutils-1.7.0.jar"/>
<classpathentry kind="lib" path="build/lib/commons-codec-1.3.jar"/>
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/build-distr.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/build-distr.xml 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/build-distr.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -39,7 +39,7 @@
</copy>
<copy todir="${esbserver.dist.dir}/docs/schema">
<fileset dir="${build.dir}/jbossesb/xml/"
- includes="jbossesb-1.0.1.xsd jbossesb-1.1.0.xsd jbossesb-1.2.0.xsd"/>
+ includes="jbossesb-1.0.1.xsd jbossesb-1.1.0.xsd jbossesb-1.2.0.xsd jbossesb-1.3.0.xsd"/>
</copy>
<copy todir="${esbserver.dist.dir}">
<fileset dir="${build.dir}/jbossesb">
@@ -97,6 +97,9 @@
<!-- temporary until juddi 3.0.1 and scout 1.2.1 releases pushed out through maven -->
<fileset dir="${lib.ext.dir}" includes="juddi-client-*.jar, uddi-ws-*.jar scout-*.jar"/>
<fileset dir="${lib.dir}" includes="commons-configuration-*.jar,commons-codec-*.jar"/>
+ <!-- camel -->
+ <fileset dir="${lib.dir}" includes="camel-core-*.jar"/>
+ <fileset dir="${lib.dir}" includes="commons-management-*.jar"/>
<!-- ftp -->
<fileset dir="${lib.ext.dir}" includes="commons-net-*.jar"/>
<fileset dir="${lib.dir}" includes="commons-io-*.jar,jsch-*.jar"/>
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/build.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/build.xml 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/build.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -254,6 +254,7 @@
<path path="${org.jboss.esb.internal.dest}/schema-model/classes"/>
<path path="${org.jboss.esb.internal.dest}/schema-model/classes110"/>
<path path="${org.jboss.esb.internal.dest}/schema-model/classes120"/>
+ <path path="${org.jboss.esb.internal.dest}/schema-model/classes130"/>
<fileset dir="lib" includes="*.jar" />
<fileset dir="lib/ext" includes="*.jar" />
<fileset dir="lib/ext/standalone" includes="*.jar" />
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/etc/schemas/xml/jbossesb-1.3.0.xsd
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/etc/schemas/xml/jbossesb-1.3.0.xsd (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/etc/schemas/xml/jbossesb-1.3.0.xsd 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,2079 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Generated by Turbo XML 2.4.1.100. Conforms to w3c http://www.w3.org/2001/XMLSchema-->
+<xsd:schema
+ xmlns:jesb="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd">
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Document root + some basic types.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="jbossesb">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The jbossesb configuration for a single instance.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:globals" />
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:camel" />
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:providers" />
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:services" />
+ </xsd:sequence>
+ <xsd:attribute default="180" name="parameterReloadSecs"
+ use="optional" />
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="property">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A simple name-value pair.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="xsd:anyType">
+ <xsd:attribute name="name" type="xsd:string"
+ use="required" />
+ <xsd:attribute name="value" type="xsd:string" />
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="globals">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A container for the configurations global to a jbossesb config file
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="war-security" minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Security configuration that is global to the jboss-esb.xml file.
+ These configuration settings are shared for all http-providers and EBWS that are defined in jboss-esb.xml.Domain.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="method" use="optional" default="BASIC">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="BASIC" />
+ <xsd:enumeration value="DIGEST" />
+ <xsd:enumeration value="CLIENT-CERT" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="domain" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">Security Domain.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Camel types.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="camel">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Camel integration configuration.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="camel-context" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="routes-builder" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:attribute name="class" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="factory-class" type="xsd:string" use="optional" default="org.jboss.soa.esb.camel.DefaultCamelContextFactory" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Provider and Bus base types.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="providers">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A container for the providers referenced in the jbossesb
+ config file
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:provider" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:complexType abstract="true" name="provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Abstract provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <xsd:element abstract="true" name="provider" type="jesb:provider" />
+
+ <xsd:complexType name="bus-provider">
+ <xsd:complexContent>
+ <xsd:extension base="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A provider of a bus. So for instance you can
+ have a jms-provider (JBossMQ) or an
+ ftp-provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:bus" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:element name="bus-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Generic Bus Provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider" />
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A bus (also called "channel" by others) is a means by
+ which Services communicate with each other (JMS, FTP,
+ HTTP, etc).
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="busid" type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ An id such that this bus can be referenced by
+ Service listn.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:element name="bus" type="jesb:bus" />
+
+ <xsd:element name="schedule-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:provider">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:schedule" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType abstract="true" name="schedule">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Schedule Configuration.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="scheduleid" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ An id such that this schedule can be referenced by
+ Service listner.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="startDate" type="xsd:dateTime"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Schedule start time and date.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="endDate" type="xsd:dateTime"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Schedule end time and date.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:element abstract="true" name="schedule" type="jesb:schedule" />
+
+ <xsd:element name="simple-schedule"
+ substitutionGroup="jesb:schedule">
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:schedule">
+ <xsd:attribute name="frequency" use="optional" type="xsd:long" default="10">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">Schedule frequency.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="frequencyUnits" use="optional" type="jesb:frequency-unit" default="seconds">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">Schedule frequency time units.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="-1" name="execCount" type="xsd:int" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Schedule execution count. -1 to execute indefinitely.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:simpleType name="frequency-unit">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="seconds"/>
+ <xsd:enumeration value="milliseconds"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:element name="cron-schedule"
+ substitutionGroup="jesb:schedule">
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:schedule">
+ <xsd:attribute name="cronExpression"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Schedule CRON expression.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Service and Action types.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="services">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A container for services.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:service" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="service">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A service has listener or gateways and a list of
+ actions.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0" ref="jesb:security" />
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:listeners" />
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:actions" />
+ </xsd:sequence>
+ <xsd:attribute name="category"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The service category which will be used to store
+ a reference to this service in the registry.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:maxLength value="255"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="name"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The service name which will be used to store a
+ reference to this service in the registry.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:maxLength value="255"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="description"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The service description which stored with this
+ service in the registry, so that the purpose of
+ this service can be understood by a human.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:maxLength value="255"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="alertTimeThreshold"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A value used for monitoring to produce alerts
+ if the service takes longer to complete than
+ the value of the field.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:decimal"/>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="alertLengthThreshold"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A value used for monitoring to produce alerts
+ if the service takes longer to complete than
+ the value of the field.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:decimal"/>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="invmScope" type="jesb:invmScope" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ All services are locally invokable over an "in VM" transport. Invokability
+ can be scoped using this attribute. An "invmScope" value of "NONE" means that
+ the Service should not be locally invokable over the "in VM" transport.
+ More fine grained scoping will be added in the future.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="invmTransacted" type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Should the InVM listener execute in a transacted environment?
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:simpleType name="invmScope">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <!-- Not invokable over InVM -->
+ <xsd:enumeration value="NONE" />
+
+ <!-- Invokable over InVM only from within the same/local deployment. -->
+ <!-- xsd:enumeration value="LOCAL" / -->
+
+ <!-- (DEFAULT) Invokable over InVM from within the same classloader scope. -->
+ <xsd:enumeration value="GLOBAL" />
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="mepType">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="RequestResponse" />
+ <xsd:enumeration value="OneWay" />
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:element name="actions">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A container for actions belonging to this service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:action" />
+ </xsd:sequence>
+ <xsd:attribute name="mep" type="jesb:mepType" />
+ <xsd:attribute name="inXsd" type="xsd:string" />
+ <xsd:attribute name="outXsd" type="xsd:string" />
+ <xsd:attribute name="requestLocation" type="xsd:string"/>
+ <xsd:attribute name="responseLocation" type="xsd:string"/>
+ <xsd:attribute name="faultXsd" type="xsd:string" />
+ <xsd:attribute name="webservice" type="xsd:boolean" default="true"/>
+ <xsd:attribute name="validate" type="xsd:boolean" default="false"/>
+ <xsd:attribute name="addressing" type="xsd:boolean" default="false"/>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="action">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ An action which will act on the message when it is
+ received by the service. Actions can be chained. Hence
+ you can specify a list of actions. Action are
+ 'pluggable' and can be custom code, however JBossESB
+ comes with a list of predefined actions.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The logical name of the action.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="class" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The full classname of the java class in which
+ this action is defined.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="process" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The name of the method on the action that needs
+ to be called when the message is received.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="alertTimeThreshold"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A value used for monitoring to produce alerts
+ if the service takes longer to complete than
+ the value of the field.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:decimal"/>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="alertLengthThreshold"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A value used for monitoring to produce alerts
+ if the service takes longer to complete than
+ the value of the field.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:decimal"/>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="security">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="runAs" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Is used to specify that a specific security role given by the role-name value should be used
+ as the security identity for this service.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="rolesAllowed" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Specifies one or more logical roles that are allowed to acccess the service.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="moduleName" type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="useCallerIdentity" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Is used to indicate that the current caller's identity should be propagated as the security identity
+ this service.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="callbackHandler" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ CallbackHandler implementation class. This will override the global callbackhandler
+ which can be specified in jbossesb-properties.xml
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Listener base types.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="listeners">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A container for all listener for a service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:abstract-listener" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:complexType name="listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A listener is a listener or a gateway. The listener
+ defines to which bus the service is listening. The
+ service can simultaneniously listen to multiple buses.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The logical name of the listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="$not-defined$" name="busidref"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A reference to an existing bus, as defined in the
+ 'buses' section of this jbossesb config.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+
+ <xsd:complexType abstract="true" name="gateway-only-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Listener type that can only act as a message-unaware listener (gateway) .
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:listener" />
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="dual-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Listener type that can act as both a message-aware and message-unaware listener (gateway).
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:listener">
+ <xsd:attribute default="1" name="maxThreads" type="xsd:int" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The number of threads which will be started for this
+ listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="false" name="is-gateway" type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ true if the listener is a gateway. A gateway is an
+ ESB-Unware listener, while a listener is ESB-aware
+ and as such expects jbossesb formatted messages.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:element name="abstract-listener" type="jesb:listener" abstract="true"/>
+
+ <xsd:element name="listener" type="jesb:dual-listener" substitutionGroup="jesb:abstract-listener"/>
+
+ <xsd:complexType abstract="true"
+ name="abstract-scheduled-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Abstract scheduled listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:attribute default="-1"
+ name="poll-frequency-seconds" type="xsd:int" use="optional">
+<!-- Purposely defaults to -1 -->
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ DEPRECATED (use "schedule-frequency" or
+ "scheduleidref"): The frequency with which
+ this listener is scheduled (in seconds).
+ Defaults to 10 seconds.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="-1" name="schedule-frequency"
+ type="xsd:int" use="optional">
+<!-- Purposely defaults to -1 -->
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The frequency with which this listener is
+ scheduled (in seconds). Defaults to 10
+ seconds.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="scheduleidref" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The id reference for the schedule that's
+ driving this scheduled listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:element name="scheduled-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Scheduled listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension
+ base="jesb:abstract-scheduled-listener">
+ <xsd:attribute name="event-processor"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Message Composer class name.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="transacted"
+ type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Should the schedule execute in a
+ transacted environment?
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- JCA Types -->
+ <xsd:element name="activation-config">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Activation configuration for jca bus or listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:property" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="jca-gateway" substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific gateway using JCA inflow.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:gateway-only-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:activation-config" />
+ </xsd:sequence>
+ <xsd:attribute name="adapter" type="xsd:string"
+ use="required" />
+ <xsd:attribute name="endpointClass"
+ type="xsd:string" use="required" />
+ <xsd:attribute name="messagingType"
+ type="xsd:string" use="optional" />
+ <xsd:attribute name="jcaBridge" type="xsd:string"
+ use="optional" />
+ <xsd:attribute name="transacted" type="xsd:boolean"
+ use="optional" />
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ JMS Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="jms-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A JMS filter can add information to a Queue, or Topic.
+ For example you can defined a message-selector. However,
+ you can also push the queue name and type into this
+ filter given you did not already specify them in the
+ jms-bus.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="dest-name" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Name of the Queue of Topic.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="dest-type" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A Queue delivers a message once, a topic
+ broadcasts a message to all registered
+ listeners.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="QUEUE" />
+ <xsd:enumeration value="TOPIC" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="selector" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A message-selector allows multiple listeners to
+ register with the same queue/topic, but they
+ will filter on this message-selector.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="persistent"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If false, JMS messages will be sent
+ non-persistent. Default is to send messages with
+ DeliveryMode.PERSISTENT.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="AUTO_ACKNOWLEDGE"
+ name="acknowledge-mode" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JMS Session acknowledge mode. Can be on of
+ AUTO_ACKNOWLEDGE (default), CLIENT_ACKNOWLEDGE,
+ or DUPS_OK_ACKNOWLEDGE.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute
+ name="jms-security-principal" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JMS destination username. Will be used when creating a connection
+ to the destination.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute
+ name="jms-security-credential" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JMS destination password. Will be used when creating a connection
+ to the destination. Will be ignored if username is not specified.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="false" name="transacted"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, JMS sessions will be transaction aware.
+ Default is false.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="jms-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A JMS-Bus is a specific instance of a bus using the JMS
+ protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:jms-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:complexType name="jms-provider-type">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing JMS.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="connection-factory"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The connection-factory used to lookup
+ queues/topics in a naming directory (JNDI)
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="jndi-context-factory"
+ type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The context factory class the JBossESB will
+ use to do naming lookups.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="jndi-pkg-prefix"
+ type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The pkg-prefix which will be used to do
+ naming lookups. It is left empty by default.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="jndi-URL" type="xsd:anyURI">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The URL used to do naming lookups.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:element name="jms-provider" substitutionGroup="jesb:provider"
+ type="jesb:jms-provider-type" />
+
+ <xsd:element name="jms-jca-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing JMS through
+ JCA inflow.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:jms-provider-type">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:activation-config" />
+ </xsd:sequence>
+ <xsd:attribute name="adapter" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The artifact containing the resource
+ adapter.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="endpointClass"
+ type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The class name of the JCA endpoint.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="messagingType"
+ type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The class name of the messaging specific
+ interface.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="jcaBridge" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The class name of the JCA Bridge.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="transacted"
+ type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The transacted flag.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="providerAdapterJNDI" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The JNDI location of an alternate provider adapter
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="jms-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific listener using the jms protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:jms-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ FS Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="fs-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A FS filter.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="directory" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file share that is monitored for incoming
+ new files.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="input-suffix" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix used to filter files targeted
+ for comsumption by the ESB (note: add the dot,
+ so something like '.esbIn').
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbInProcess" name="work-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix used while the file is being
+ process, so that another thread or process won't
+ pick it up too.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="post-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be deleted after it is
+ processed. Note that in that case post-directory
+ and post-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="post-rename"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be renamed after it is
+ processed. Note that in that case post-directory
+ and post-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="processed" name="post-directory"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file share to which the file will be moved
+ after it is processed by the ESB
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbDone" name="post-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix which will be added to the file
+ name after it is processed.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="error-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be deleted if an error
+ occurs during processing. Note that in that case
+ error-directory and error-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="processed" name="error-directory"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file share to which the file will be moved
+ after when an error occurs during processing.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbERROR" name="error-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix which will be added to the file
+ name after an error occurs during processing.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="fs-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A Fs-Bus is a specific instance of a bus using the File
+ protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:fs-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="fs-provider" substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing a file
+ system (local fileshare or NAS).
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider" />
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="fs-listener" substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific listener using the file protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension
+ base="jesb:abstract-scheduled-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:fs-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ FTP Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="ftp-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A FTP filter.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="directory" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The ftp directory that is monitored for incoming
+ new files.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="username" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The username used to access the ftp server
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="password" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The password used to access the ftp server.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="input-suffix" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix used to filter files targeted
+ for comsumption by the ESB (note: add the dot,
+ so something like '.esbIn').
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbInProcess" name="work-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix used while the file is being
+ process, so that another thread or process won't
+ pick it up too.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="post-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be deleted after it is
+ processed. Note that in that case post-directory
+ and post-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="post-rename"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be renamed after it is
+ processed. Note that in that case post-directory
+ and post-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="post-directory" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The ftp directory to which the file will be
+ moved after it is processed by the ESB
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbDone" name="post-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix which will be added to the file
+ name after it is processed.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="error-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be deleted if an error
+ occurs during processing. Note that in that case
+ error-directory and error-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="processed" name="error-directory"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The ftp directory to which the file will be
+ moved after when an error occurs during
+ processing.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbERROR" name="error-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix which will be added to the file
+ name after an error occurs during processing.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="passive" type="xsd:boolean"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ This is an ftp server setting which may vary per
+ session.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="ftp" name="protocol"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The protocol, can be sftp (SSH File Transfer
+ Protocol), ftps (FTP over SLL) and ftp (to which
+ it defaults).
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="ftp" />
+ <xsd:enumeration value="ftps" />
+ <xsd:enumeration value="sftp" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="certificate-url" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The url to a public server certificate for ftps, or to a
+ private certificate for sftp client verification. sftp certificate
+ can be located via a resource.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="certificate-name" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The common name of a certificate, which may be needed
+ for ftps.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="certificate-passphrase" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The passphrase of the private key, if necessary, for sftp client verification.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="false" name="read-only"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the ftp server does not permit write
+ opertations on files. Note that in this case the
+ following properties have no effect:
+ work-suffix, post-delete, post-directory,
+ post-suffix, error-delete, error-directory, and
+ error-suffix.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="ftp-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A FTP-Bus is a specific instance of a bus using the FTP
+ protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:ftp-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="ftp-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing a ftp
+ service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="hostname" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The ftp hostname, as it can be resolved
+ by DNS.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="ftp-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific listener using the ftp protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension
+ base="jesb:abstract-scheduled-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:ftp-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ SQL Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="sql-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A SQL filter.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="tablename" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The table in which esb message are stored.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="message-id-column"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A unique key (PK) in the table.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="retry-count-column" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Column name for storing the message delivery retry count.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="message-column"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The field that holds the serialized message.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="status-column"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ This column contents ('P', 'W', 'E' or 'D')
+ indicates if the row is pending (P), in process
+ (W), in error(E) or done (D) if postDelete
+ and/or errorDelete are 'true' rows might be
+ deleted
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="where-condition" use="optional"
+ type="xsd:string" default="">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A where clause, not including the word where,
+ which is applied to the query.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="order-by" use="optional"
+ type="xsd:string" default="">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A where clause, not including the word where,
+ which is applied to the query.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="insert-timestamp-column" use="optional"
+ type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Holds the timestamp when the record was
+ inserted.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="post-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, records will be deleted after
+ processing.((e.g. no rows with a 'D' for done,
+ in column defined in 'status_column')
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="error-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, records in error will be deleted after
+ attempted picked up for processing.(e.g. no rows
+ with a 'E' for error, in column defined in
+ 'status_column')
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="sql-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A SQL-Bus is a specific instance of a bus using the SQL
+ protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:sql-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="sql-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing a db
+ service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="datasource" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The name of the datasource.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="url" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The url needed to connect to the db.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="driver" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The driver needed to connect to the db.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="username" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The username used to access the
+ database.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="password" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The password used to access the
+ database.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="transacted"
+ type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The transacted flag.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="sql-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific listener using the SQL protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:sql-message-filter" />
+ </xsd:sequence>
+ <xsd:attribute default="10"
+ name="poll-frequency-seconds" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The frequency with which this listener
+ polls the db in seconds. Defaults to 10
+ seconds.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:integer">
+ <xsd:minExclusive value="0" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Hibernate Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="hibernate-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A Hibernate filter.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="classname" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The class name to monitor.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="message_id" name="event"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A comma-separated list of events to intercept.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="hibernate-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A hibernate-bus is a specific instance of a bus using
+ the Hibernate protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:hibernate-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="hibernate-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing a hibernate
+ service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="hibernate-cfg-file"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The Hibernate configuration file to use.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="hibernate-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific listener using the hibernate protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:hibernate-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ JBoss Remoting Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="jbr-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JBoss Remoting Bus
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:attribute name="port" type="xsd:int"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JBoss Remoting Server listen port.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="jbr-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JBoss Remoting Provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="protocol" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Jboss Remoting Listener/Server protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="http" />
+ <xsd:enumeration value="https" />
+ <xsd:enumeration value="socket" />
+ <xsd:enumeration value="sslsocket" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="host" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JBoss Remoting Server bind address. When
+ not specified, defaults to
+ InetAddress.getLocalHost().getHostName().
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="jbr-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JBoss Remoting Listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener" />
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Http Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="http-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Http Bus
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:choice minOccurs="0" maxOccurs="2">
+ <xsd:element name="protected-methods" minOccurs="0" maxOccurs="1">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="method" minOccurs="1" maxOccurs="5">
+ <xsd:complexType>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="GET" />
+ <xsd:enumeration value="POST" />
+ <xsd:enumeration value="PUT" />
+ <xsd:enumeration value="DELETE" />
+ <xsd:enumeration value="HEAD" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="allowed-roles" minOccurs="0" maxOccurs="1">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="role" minOccurs="1" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ <xsd:attribute name="transportGuarantee" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="NONE" />
+ <xsd:enumeration value="INTEGRAL" />
+ <xsd:enumeration value="CONFIDENTIAL" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="http-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Http Provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:sequence>
+ <xsd:element name="exception" type="jesb:httpExceptionMappings" minOccurs="0" maxOccurs="1" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="http-gateway"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ http Listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:gateway-only-listener">
+ <xsd:choice minOccurs="0" maxOccurs="2">
+ <xsd:element name="exception" type="jesb:httpExceptionMappings">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Exception to HTTP status code mappings.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="asyncResponse" type="jesb:asyncHttpResponse">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Aynchronous HTTP Response. If set, the gateway will asynchronously deliver the
+ message to the target Service.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:choice>
+ <xsd:attribute name="urlPattern" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The URL Pattern of requests to be filtered to this listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="payloadAs" type="jesb:payloadAs" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Set the ESB Message payload ass either a String or an array of bytes.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:simpleType name="payloadAs">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="STRING"/>
+ <xsd:enumeration value="BYTES"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:complexType name="httpExceptionMappings">
+ <xsd:sequence>
+ <xsd:element name="mapping" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:attribute name="class" type="xsd:string" use="required" />
+ <xsd:attribute name="status" type="xsd:integer" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="mappingsFile" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Path to a .properties file containing a list of Exception to HTTP Status code mappings.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:complexType name="asyncHttpResponse">
+ <xsd:sequence>
+ <xsd:element name="payload" minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Static HTTP Gateway response payload for async message delivery to service.
+ <p/>
+ If not set, an empty (zero length) payload will be returned in the HTTP Response.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="classpathResource" type="xsd:string" use="required" />
+ <xsd:attribute name="contentType" type="xsd:string" use="required" />
+ <xsd:attribute name="characterEncoding" type="xsd:string" use="optional" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="statusCode" type="xsd:int" default="200" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Static HTTP Gateway response code for async message delivery to service.
+ <p/>
+ If not set, a 200 status (OK) will be returned in the HTTP Response.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Groovy Gateway Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="groovy-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Groovy Listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:attribute name="script" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The path (classpath) to the Groovy
+ Gateway script. Or, the alias for the
+ pre-packaged Groovy Gateway script.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ UDP Gateway Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="udp-listener" substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ UDP Listener that uses Mina.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:attribute name="host" type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The host that this listener will listen to.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="port" type="xsd:integer" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The port that this listener will listen to.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="handlerClass" type="xsd:string" use="optional" default="org.jboss.soa.esb.listeners.gateway.mina.DefaultMessageHandler">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The fully qualified name of a org.jboss.soa.esb.listeners.gateway.mina.MessageHandler implementation.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+</xsd:schema>
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/etc/schemas/xml/jbossesb-1.3.0.xsd
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/etc/schemas/xml/jbossesb-1.3.0.xsdconfig
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/etc/schemas/xml/jbossesb-1.3.0.xsdconfig (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/etc/schemas/xml/jbossesb-1.3.0.xsdconfig 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,14 @@
+<!-- An xsdconfig file must begin with a "config" element in the
+ http://www.bea.com/2002/09/xbean/config namespace. Also, be sure
+ to declare any namespaces used to qualify types in your schema (here,
+ the namespace corresponding to the pol prefix. -->
+
+<xb:config xmlns:pol="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd"
+ xmlns:xb="http://www.bea.com/2002/09/xbean/config">
+
+ <!-- Use the "namespace" element to map a namespace to the Java package
+ name that should be generated. -->
+ <xb:namespace uri="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd">
+ <xb:package>org.jboss.soa.esb.listeners.config.xbeanmodel130</xb:package>
+ </xb:namespace>
+</xb:config>
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/install/build.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/install/build.xml 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/install/build.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -254,6 +254,8 @@
<fileset dir="${org.jboss.esb.dist.lib}/jbossesb.sar/lib">
<include name="jbossesb-rosetta.jar"/>
<include name="jbossesb-config-model-*.jar"/>
+ <include name="camel-core-*.jar"/>
+ <include name="commons-management-*.jar"/>
<include name="commons-lang-*.jar"/>
<include name="commons-net-*.jar"/>
<include name="commons-ssl-*.jar"/>
@@ -316,6 +318,8 @@
<fileset dir="${org.jboss.esb.dist.lib}/jbossesb.sar">
<exclude name="lib/jbossesb-rosetta.jar"/>
<exclude name="lib/jbossesb-config-model-*.jar"/>
+ <exclude name="lib/camel-core-*.jar"/>
+ <exclude name="lib/commons-management-*.jar"/>
<exclude name="lib/commons-codec-*.jar"/>
<exclude name="lib/commons-lang-*.jar"/>
<exclude name="lib/commons-net-*.jar"/>
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/ivy.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/ivy.xml 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/ivy.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -34,6 +34,8 @@
<!-- temporary until 1.2.1 is pushed into maven
<dependency org="org.apache.ws.scout" name="scout" rev="1.2.1"/>
-->
+ <dependency org="org.apache.camel" name="camel-core" rev="2.2.0"/>
+ <dependency org="org.fusesource.commonman" name="commons-management" rev="1.0"/>
<dependency org="jboss.aop" name="jboss-aop-jdk50" rev="1.5.6.GA"/>
<!-- dependency org="jboss.messaging" name="jboss-messaging-client" rev="1.4.1.CR1"/ -->
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/ivysettings.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/ivysettings.xml 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/ivysettings.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -28,12 +28,20 @@
<url name="scout">
<artifact pattern="http://repo1.maven.org/maven2/org/apache/ws/scout/[artifact]/[revision]/[artifact]-[revision].[ext]"/>
</url>
+ <url name="camel">
+ <artifact pattern="http://repo1.maven.org/maven2/org/apache/camel/[artifact]/[revision]/[artifact]-[revision].[ext]"/>
+ </url>
+ <url name="commonman">
+ <artifact pattern="http://repo1.maven.org/maven2/org/fusesource/commonman/[artifact]/[revision]/[artifact]-[revision].[ext]"/>
+ </url>
</resolvers>
<modules>
<module organisation="org.milyn" name="*" resolver="smooks"/>
<module organisation="org.hibernate" name="ejb3-persistence" resolver="ejb3"/>
<module organisation="org.apache.juddi" name="*" resolver="juddi"/>
<module organisation="org.apache.ws.scout" name="*" resolver="scout"/>
+ <module organisation="org.apache.camel" name="*" resolver="camel"/>
+ <module organisation="org.fusesource.commonman" name="*" resolver="commonman"/>
<module organisation="hibernate-entitymanager" name="hibernate-entitymanager" resolver="entitymanager"/>
</modules>
</ivysettings>
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/build.xml 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/build.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -24,6 +24,8 @@
<property name="schema110.classes.dir" location="${gendir}/classes110" />
<property name="schema120.src.dir" location="${gendir}/src120" />
<property name="schema120.classes.dir" location="${gendir}/classes120" />
+ <property name="schema130.src.dir" location="${gendir}/src130" />
+ <property name="schema130.classes.dir" location="${gendir}/classes130" />
<property environment="env"/>
<property name="org.jboss.esb.lib.dir" location="${org.jboss.esb.internal.dest}/lib"/>
@@ -38,6 +40,7 @@
<pathelement location="${schema101.classes.dir}"/>
<pathelement location="${schema110.classes.dir}"/>
<pathelement location="${schema120.classes.dir}"/>
+ <pathelement location="${schema130.classes.dir}"/>
</path>
<target name="org.jboss.esb.rosetta.init">
@@ -217,6 +220,23 @@
<fileset dir="${org.jboss.esb.rosetta.classes.dir}"
includes="VERSION org/jboss/soa/**/Version.class"/>
</jar>
+
+ <!-- now handle 1.3.0 -->
+ <xmlbean
+ classgendir="${schema130.classes.dir}"
+ javasource="1.5"
+ debug="${org.jboss.esb.debug}"
+ srcgendir="${schema130.src.dir}"
+ destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.3.0.jar"
+ classpathref="xbeans-classpath">
+ <fileset dir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.3.0.xsd,jbossesb-1.3.0.xsdconfig"/>
+ </xmlbean>
+ <!-- now add the xsd to it -->
+ <jar destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.3.0.jar" update="true" manifest="${org.jboss.esb.rosetta.classes.dir}/MANIFEST.MF"
+ basedir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.3.0.xsd">
+ <fileset dir="${org.jboss.esb.rosetta.classes.dir}"
+ includes="VERSION org/jboss/soa/**/Version.class"/>
+ </jar>
</target>
<path id="xbeans-classpath">
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/CamelContextContainer.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/CamelContextContainer.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/CamelContextContainer.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2010
+ */
+package org.jboss.soa.esb.camel;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.RoutesBuilder;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * CamelContextContainer.
+ *
+ * @author david at jboss.org
+ */
+public class CamelContextContainer extends AbstractManagedLifecycle
+{
+
+ public static final String CAMEL_CONTEXT = "camel-context";
+ public static final String FACTORY_CLASS = "factory-class";
+ public static final String JBOSSESB = "jbossesb";
+ public static final String ROUTES_BUILDER = "routes-builder";
+ public static final String CLASS = "class";
+
+ private CamelContext camelContext = null;
+
+ public CamelContextContainer(ConfigTree camelContextConfig) throws ConfigurationException
+ {
+ super(camelContextConfig);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void doInitialise() throws ManagedLifecycleException
+ {
+ ConfigTree camelContextConfig = getConfig();
+ try
+ {
+ // create context
+ Class<CamelContextFactory> camelContextFactoryClass = ClassUtil.forName(camelContextConfig.getRequiredAttribute(FACTORY_CLASS), getClass());
+ camelContext = camelContextFactoryClass.newInstance().createCamelContext();
+
+ // add component(s)
+ camelContext.addComponent(JBOSSESB, new JBossESBComponent());
+
+ // add routes
+ for (ConfigTree routesBuilderConfig : camelContextConfig.getChildren(ROUTES_BUILDER))
+ {
+ Class<RoutesBuilder> routesBuilderClass = ClassUtil.forName(routesBuilderConfig.getRequiredAttribute(CLASS), getClass());
+ camelContext.addRoutes(routesBuilderClass.newInstance());
+ }
+ }
+ catch (Exception e)
+ {
+ throw new ManagedLifecycleException(e);
+ }
+ }
+
+ @Override
+ protected void doStart() throws ManagedLifecycleException
+ {
+ try
+ {
+ camelContext.start();
+ }
+ catch (Exception e)
+ {
+ throw new ManagedLifecycleException("Exception encountered while starting CamelContext", e);
+ }
+ }
+
+ @Override
+ protected void doStop() throws ManagedLifecycleException
+ {
+ try
+ {
+ camelContext.stop();
+ }
+ catch (Exception e)
+ {
+ throw new ManagedLifecycleException("Exception encountered while stopping CamelContext", e);
+ }
+ }
+
+ @Override
+ protected void doDestroy() throws ManagedLifecycleException
+ {
+ camelContext = null;
+ }
+
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/CamelContextContainer.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/CamelContextFactory.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/CamelContextFactory.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/CamelContextFactory.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2010
+ */
+package org.jboss.soa.esb.camel;
+
+import org.apache.camel.CamelContext;
+
+/**
+ * CamelContextFactory.
+ *
+ * @author david at jboss.org
+ */
+public interface CamelContextFactory
+{
+
+ public CamelContext createCamelContext() throws Exception;
+
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/CamelContextFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/DefaultCamelContextFactory.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/DefaultCamelContextFactory.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/DefaultCamelContextFactory.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2010
+ */
+package org.jboss.soa.esb.camel;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+
+/**
+ * DefaultCamelContextFactory.
+ *
+ * @author david at jboss.org
+ */
+public class DefaultCamelContextFactory implements CamelContextFactory
+{
+
+ public CamelContext createCamelContext() throws Exception
+ {
+ return new DefaultCamelContext();
+ }
+
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/DefaultCamelContextFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBComponent.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBComponent.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBComponent.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2010
+ */
+package org.jboss.soa.esb.camel;
+
+import java.util.Map;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.impl.DefaultComponent;
+import org.jboss.soa.esb.Service;
+
+/**
+ * JBossESBComponent.
+ *
+ * @author david at jboss.org
+ */
+public class JBossESBComponent extends DefaultComponent
+{
+
+ public static final String SERVICE = "service";
+ public static final String CATEGORY = "category";
+ public static final String NAME = "name";
+ public static final String ASYNC = "async";
+ public static final String TIMEOUT = "timeout";
+
+ public JBossESBComponent() {}
+
+ @Override
+ protected Endpoint createEndpoint(String uri, String command, Map<String, Object> parameters) throws Exception
+ {
+ JBossESBProcessor processor;
+ if (SERVICE.equals(command))
+ {
+ String category = getAndRemoveParameter(parameters, CATEGORY, String.class);
+ String name = getAndRemoveParameter(parameters, NAME, String.class);
+ boolean async = getAndRemoveParameter(parameters, ASYNC, Boolean.class, Boolean.FALSE);
+ long timeout = getAndRemoveParameter(parameters, TIMEOUT, Long.class, 10000l);
+ processor = new ServiceProcessor(new Service(category, name), async, timeout);
+ }
+ else
+ {
+ throw new Exception("unrecognized command: " + command + " from uri: " + uri);
+ }
+ JBossESBEndpoint endpoint = new JBossESBEndpoint(uri, this, processor);
+ setProperties(endpoint, parameters);
+ return endpoint;
+ }
+
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBComponent.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBEndpoint.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBEndpoint.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBEndpoint.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2010
+ */
+package org.jboss.soa.esb.camel;
+
+import org.apache.camel.impl.ProcessorEndpoint;
+
+/**
+ * JBossESBEndpoint.
+ *
+ * @author david at jboss.org
+ */
+public class JBossESBEndpoint extends ProcessorEndpoint
+{
+
+ public JBossESBEndpoint(String endpointUri, JBossESBComponent component, JBossESBProcessor processor)
+ {
+ super(endpointUri, component, processor);
+ }
+
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBProcessor.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBProcessor.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBProcessor.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2010
+ */
+package org.jboss.soa.esb.camel;
+
+import java.util.Map;
+
+import org.apache.camel.Processor;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.Properties;
+import org.jboss.soa.esb.message.body.content.BytesBody;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/**
+ * JBossESBProcessor.
+ *
+ * @author david at jboss.org
+ */
+public abstract class JBossESBProcessor implements Processor
+{
+
+ protected Message convert(org.apache.camel.Message camelMessage)
+ {
+ Message esbMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+ // camel headers --> esb properties
+ Properties properties = esbMessage.getProperties();
+ Map<String,Object> headers = camelMessage.getHeaders();
+ for (String name : headers.keySet())
+ {
+ properties.setProperty(name, headers.get(name));
+ }
+
+ // body
+ String body = camelMessage.getBody(String.class);
+ if (body != null)
+ {
+ esbMessage.getBody().add(body);
+ }
+
+ return esbMessage;
+ }
+
+ protected org.apache.camel.Message convert(Message esbMessage)
+ {
+ org.apache.camel.Message camelMessage = new org.apache.camel.impl.DefaultMessage();
+
+ // esb properties --> camel headers
+ Properties properties = esbMessage.getProperties();
+ for (String name : properties.getNames())
+ {
+ camelMessage.setHeader(name, properties.getProperty(name));
+ }
+
+ // body
+ byte[] body = (byte[])esbMessage.getBody().get(BytesBody.BYTES_LOCATION);
+ camelMessage.setBody(body != null ? new String(body) : null);
+
+ return camelMessage;
+ }
+
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/JBossESBProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/ServiceProcessor.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/ServiceProcessor.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/ServiceProcessor.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2010
+ */
+package org.jboss.soa.esb.camel;
+
+import org.apache.camel.Exchange;
+import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * ServiceProcessor.
+ *
+ * @author david at jboss.org
+ */
+public class ServiceProcessor extends JBossESBProcessor
+{
+
+ private Service service;
+ private boolean async;
+ private long timeout;
+
+ public ServiceProcessor(Service service, boolean async, long timeout)
+ {
+ this.service = service;
+ this.async = async;
+ this.timeout = timeout;
+ }
+
+ public void process(Exchange exchange) throws Exception
+ {
+ Message in = convert(exchange.getIn());
+ ServiceInvoker invoker = new ServiceInvoker(service);
+ if (async)
+ {
+ invoker.deliverAsync(in);
+ exchange.setOut(convert(in));
+ }
+ else
+ {
+ Message out = invoker.deliverSync(in, timeout);
+ exchange.setOut(convert(out));
+ }
+ }
+
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/camel/ServiceProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -131,6 +131,9 @@
ModelAdapter model = generator.getModel();
+ // Handle Camel integration
+ instances.addAll(model.getCamelContextContainers());
+
// Handle the ServiceContracts
if (servlets != null && !servlets.isEmpty())
{
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -348,6 +348,9 @@
public static ManagedLifecycleController startController(ModelAdapter configModel, ConfigTree listenerConfig, ConfigTree gatewayConfig) throws ParamRepositoryException, SAXException, ManagedLifecycleException, ConfigurationException {
final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(listenerConfig);
instances.addAll(LifecycleUtil.getGateways(gatewayConfig));
+
+ // Handle Camel integration
+ instances.addAll(configModel.getCamelContextContainers());
ManagedLifecycleController lifecycleController = new ManagedLifecycleController(instances);
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ActionMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ActionMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ActionMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.MepType;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ActionDocument.Action;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ActionsDocument.Actions;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.PropertyDocument.Property;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ServiceDocument.Service;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of XSD based configuration service actions onto a "ConfigTree"
+ * style listener configuration.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ActionMapper {
+ private static final Logger logger = Logger.getLogger(ActionMapper.class);
+
+ /**
+ * Perform the mapping. Checks to ensure that action names are unique, and throws a ConfigurationException if
+ * a duplicate action name is registered.
+ * @param listenerConfigTree The listener ConfigTree to which the actions are to be added.
+ * @param listenerService The Service to which the listener is bound. The Service defines the actions.
+ * @param model The configuration model from which the mapping is being performed.
+ * @throws org.jboss.soa.esb.ConfigurationException
+ */
+ public static void map(Element listenerConfigTree, Service listenerService, XMLBeansModel model) throws ConfigurationException {
+ if (listenerService.getActions()!=null) {
+ final Actions actions = listenerService.getActions();
+ final MepType.Enum mep = actions.getMep() ;
+ if (mep != null)
+ {
+ listenerConfigTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG, mep.toString()) ;
+ }
+ final String inxsd = actions.getInXsd();
+ if (inxsd != null)
+ {
+ listenerConfigTree.setAttribute(ListenerTagNames.IN_XSD_ATTRIBUTE_TAG, inxsd);
+ }
+ final String outxsd = actions.getOutXsd();
+ if (outxsd != null)
+ {
+ listenerConfigTree.setAttribute(ListenerTagNames.OUT_XSD_ATTRIBUTE_TAG, outxsd);
+ }
+
+ final String faultxsd = actions.getFaultXsd();
+
+ if (faultxsd != null)
+ {
+ listenerConfigTree.setAttribute(ListenerTagNames.FAULT_XSD_ATTRIBUTE_TAG, faultxsd);
+ }
+
+ if (actions.isSetValidate())
+ {
+ listenerConfigTree.setAttribute(ListenerTagNames.VALIDATE_ATTRIBUTE_TAG, Boolean.toString(actions.getValidate())) ;
+ }
+
+ final String requestLocation = actions.getRequestLocation() ;
+ if (requestLocation != null)
+ {
+ listenerConfigTree.setAttribute(ListenerTagNames.REQUEST_LOCATION_TAG, requestLocation) ;
+ }
+
+ final String responseLocation = actions.getResponseLocation() ;
+ if (responseLocation != null)
+ {
+ listenerConfigTree.setAttribute(ListenerTagNames.RESPONSE_LOCATION_TAG, responseLocation) ;
+ }
+
+ SecurityMapper.map(listenerConfigTree, listenerService);
+ List<Action> actionList = actions.getActionList();
+
+ HashMap<String,String> hm = new HashMap<String,String>();
+ for(Action action : actionList) {
+ mapAction(listenerConfigTree, action);
+ if (hm.containsKey(action.getName())) {
+ throw new ConfigurationException("Tried to register a duplicate action name. Service "
+ + listenerService.getName() + " already contains an action named "
+ + action.getName() + ". Action names must be unique per service.");
+ } else {
+ hm.put(action.getName(), action.getName());
+ }
+ }
+ }
+ }
+
+ /**
+ * Map an action instance onto the listener ConfigTree.
+ * @param listenerConfigTree The target listener ConfigTree.
+ * @param action The action instance.
+ */
+ private static void mapAction(Element listenerConfigTree, Action action) {
+ Element actionConfigTree = YADOMUtil.addElement(listenerConfigTree, "action");
+ List<Property> properties = action.getPropertyList();
+
+ actionConfigTree.setAttribute(ListenerTagNames.ACTION_ELEMENT_TAG, action.getName());
+ actionConfigTree.setAttribute(ListenerTagNames.ACTION_CLASS_TAG, action.getClass1());
+ actionConfigTree.setAttribute(ListenerTagNames.PROCESS_METHOD_TAG, action.getProcess());
+
+ if (action.getAlertLengthThreshold() != null) {
+ actionConfigTree.setAttribute(ListenerTagNames.ACTION_ALERT_LENGTH_TAG, action.getAlertLengthThreshold().toString());
+ }
+ if ( action.getAlertTimeThreshold() != null) {
+ actionConfigTree.setAttribute(ListenerTagNames.ACTION_ALERT_TIME_TAG, action.getAlertTimeThreshold().toString());
+ }
+
+ // The "okMethods" and "exceptionMethod" attributes are supported by adding them as child <property> elements.
+
+ // Map the property elements to action attributes...
+ for(Property property : properties) {
+ Element propertyElement = listenerConfigTree.getOwnerDocument().createElement("property");
+
+ MapperUtil.serialize(property, propertyElement);
+
+ if(property.getValue() != null) {
+ actionConfigTree.setAttribute(property.getName(), property.getValue());
+ }
+ // If the property has child content, add that directy to the action. Of course it only really
+ // makes sense to do this with one property!
+ if(propertyElement.hasChildNodes()) {
+ YADOMUtil.copyChildNodes(propertyElement, actionConfigTree);
+ }
+ }
+
+ // Remove any empty attributes set on the action config...
+ YADOMUtil.removeEmptyAttributes(actionConfigTree);
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ActionMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ESBAwareGenerator.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ESBAwareGenerator.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ESBAwareGenerator.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,230 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.AbstractScheduledListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Bus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.DualListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsProviderType;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Listener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Provider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FsListenerDocument.FsListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FtpListenerDocument.FtpListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.GroovyListenerDocument.GroovyListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JbrListenerDocument.JbrListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsBusDocument.JmsBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsJcaProviderDocument.JmsJcaProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsListenerDocument.JmsListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsMessageFilterDocument.JmsMessageFilter;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ServiceDocument.Service;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SqlBusDocument.SqlBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SqlListenerDocument.SqlListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SqlProviderDocument.SqlProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ScheduledListenerDocument.ScheduledListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel110.HttpListenerDocument;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.message.MessageAwareListener;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * ESB Aware Listeners Configuration Generator.
+ * <p/>
+ * Generates a "ConfigTree" style configuration for the ESB Aware Listeners.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ESBAwareGenerator {
+
+ private static final Logger logger = Logger.getLogger(ESBAwareGenerator.class);
+
+ /**
+ * XMLBeans based configuration model instance.
+ */
+ private XMLBeansModel model;
+
+ /**
+ * Public constructor.
+ * @param model XMLBeans based configuration model instance.
+ */
+ public ESBAwareGenerator(XMLBeansModel model) {
+ this.model = model;
+ }
+
+ /**
+ * Generate the configuration DOM for the target Server.
+ * @return The configuration DOM.
+ * @throws org.jboss.soa.esb.ConfigurationException Error creating configuration.
+ */
+ public Document generate() throws ConfigurationException {
+ Document doc = YADOMUtil.createDocument();
+ Element root;
+
+ doc.appendChild(doc.createComment("\n\tNOTE: DO NOT MODIFY\n\tThis file was auto-generated.\n"));
+ root = YADOMUtil.addElement(doc, "jbossesb-listeners");
+ root.setAttribute("parameterReloadSecs", model.getParameterReloadSecs());
+
+ // Add an InVM listener for each service...
+ List<Service> services = model.getServices();
+ for (int i = 0; i < services.size(); i++) {
+ Service service = services.get(i);
+ if(model.exposesInVMListener(service)) {
+ addInVMListener(root, service, i);
+ }
+ }
+
+ // Iterate over all the ESB Aware listner configs and map them to the listener configuration...
+ List<Listener> listeners = model.getESBAwareListeners();
+ for(Listener listener : listeners) {
+ addESBAwareConfig(root, listener);
+ }
+
+ return doc;
+ }
+
+ private void addInVMListener(Element root, Service service, int serviceIndex) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "InVM-" + serviceIndex);
+ Element properties = listenerNode.getOwnerDocument().createElement("properties");
+
+ MapperUtil.mapListenerServiceAttributes(listenerNode, service, false);
+ listenerNode.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, MessageAwareListener.class.getName());
+
+ Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+ eprNode.setAttribute(ListenerTagNames.PROTOCOL_TAG, InVMEpr.INVM_PROTOCOL);
+
+ MapperUtil.mapProperties(service.getPropertyList(), properties);
+ eprNode.setAttribute(ListenerTagNames.URL_TAG, InVMEpr.INVM_PROTOCOL + "://"
+ + InVMEpr.createEncodedServiceId(service.getCategory(), service.getName())
+ + "/" + YADOMUtil.getAttribute(properties, "inVMPassByValue", "false")
+ + "?" + YADOMUtil.getAttribute(properties, "inVMLockStep", "false")
+ + "#" + YADOMUtil.getAttribute(properties, "inVMLockStepTimeout", "10000"));
+
+ listenerNode.setAttribute(ListenerTagNames.MAX_THREADS_TAG, YADOMUtil.getAttribute(properties, ListenerTagNames.MAX_THREADS_TAG, "1"));
+
+ listenerNode.setAttribute(ListenerTagNames.TRANSACTED_TAG, Boolean.toString(getInVMTransacted(service))) ;
+ YADOMUtil.removeEmptyAttributes(eprNode);
+
+ ActionMapper.map(listenerNode, service, model);
+ }
+
+ /**
+ * Try to find the InVM transacted value. Check to see if the transacted attribute
+ * has been explicitly set on the service. If it has not been explicitly set then we
+ * check to see if any of the listener/bus configurations are transacted and assume the
+ * InVM is implicitly transacted.
+ *
+ * @param service The current service.
+ * @return true if transacted, false otherwise.
+ */
+ private boolean getInVMTransacted(final Service service)
+ throws ConfigurationException
+ {
+ if (service.isSetInvmScope()) {
+ return service.getInvmTransacted() ;
+ } else if (service.isSetListeners()) {
+ for (Listener listener: service.getListeners().getAbstractListenerList()) {
+ if (listener instanceof ScheduledListener) {
+ if (((ScheduledListener)listener).getTransacted())
+ return true ;
+ }
+ else if (listener instanceof JmsListener) {
+ final Bus bus = model.getBus(listener.getBusidref()) ;
+ if (!(bus instanceof JmsBus))
+ continue ;
+
+ final Provider provider = model.getProvider(bus) ;
+ if (provider instanceof JmsJcaProvider) {
+ // Jms JCA provider defaults to true
+ final JmsJcaProvider jmsJcaProvider = (JmsJcaProvider)provider ;
+ if (!jmsJcaProvider.isSetTransacted() || jmsJcaProvider.getTransacted())
+ return true ;
+ } else if (provider instanceof JmsProviderType) {
+ JmsMessageFilter filter = ((JmsListener)listener).getJmsMessageFilter() ;
+ if (filter == null)
+ filter = ((JmsBus)bus).getJmsMessageFilter() ;
+ if ((filter != null) && filter.getTransacted())
+ return true ;
+ }
+ } else if (listener instanceof SqlListener) {
+ final Bus bus = model.getBus(listener.getBusidref()) ;
+ if (!(bus instanceof SqlBus))
+ continue ;
+
+ final Provider provider = model.getProvider(bus) ;
+ if ((provider instanceof SqlProvider) && ((SqlProvider)provider).getTransacted())
+ return true ;
+ }
+ }
+ }
+ return false ;
+ }
+
+ /**
+ * Add a single ESB Aware Listener configuration node to configuration root.
+ * @param root Configuration root node.
+ * @param listener The ESB Aware Listener configuration to be added.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ private void addESBAwareConfig(Element root, Listener listener) throws ConfigurationException {
+ Element listenerConfigTree;
+ Service listenerService;
+
+ // Of course we could do the following reflectively if we really want to - TODO perhaps!!
+ if(listener instanceof JmsListener) {
+ listenerConfigTree = JmsListenerMapper.map(root, (JmsListener)listener, model);
+ } else if (listener instanceof ScheduledListener) {
+ listenerConfigTree = ScheduledListenerMapper.map(root, (ScheduledListener) listener, model);
+ } else if(listener instanceof FsListener) {
+ listenerConfigTree = FsListenerMapper.map(root, (FsListener)listener, model);
+ } else if (listener instanceof FtpListener) {
+ listenerConfigTree = FtpListenerMapper.map(root, (FtpListener)listener, model);
+ } else if (listener instanceof SqlListener) {
+ listenerConfigTree = SqlListenerMapper.map(root, (SqlListener)listener, model);
+ } else if (listener instanceof JbrListener) {
+ logger.error("JbossRemoting listener only supported in Gateway mode.");
+ return;
+ } else if (listener instanceof GroovyListener) {
+ listenerConfigTree = GroovyListenerMapper.map(root, (GroovyListener)listener, model);
+ } else if (listener instanceof DualListener){
+ listenerConfigTree = UntypedListenerMapper.map(root, (DualListener)listener, model);
+ } else {
+ throw new ConfigurationException("Unexpected listener type encountered: " + listener) ;
+ }
+
+ if (listener instanceof AbstractScheduledListener) {
+ ScheduleMapper.map(listenerConfigTree, (AbstractScheduledListener) listener, model);
+ }
+
+ // Locate the Service to which the listener is bound...
+ listenerService = model.getService(listener);
+
+ // Map the actions and notiications...
+ ActionMapper.map(listenerConfigTree, listenerService, model);
+ NotificationMapper.map(listenerConfigTree, listenerService, model);
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ESBAwareGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/FsListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/FsListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/FsListenerMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import java.io.File;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FsBusDocument.FsBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FsListenerDocument.FsListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FsMessageFilterDocument.FsMessageFilter;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FsProviderDocument.FsProvider;
+import org.jboss.soa.esb.listeners.gateway.FileGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of a <fs-listener> XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ *
+ * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
+ */
+public class FsListenerMapper {
+
+ /**
+ * Perform the mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener The Jmslistener to be mapped into the ConfigTree.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, FsListener listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+ FsBus bus;
+ FsProvider provider;
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ try {
+ bus = (FsBus) model.getBus(listener.getBusidref());
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <fs-listener> must reference a <fs-bus>.");
+ }
+ try {
+ provider = (FsProvider) model.getProvider(bus);
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <fs-provider> instance. Unexpected exception - this should have caused a validation error!");
+ }
+
+ FsMessageFilter messageFilter = listener.getFsMessageFilter();
+ if(messageFilter == null) {
+ messageFilter = bus.getFsMessageFilter();
+ if(messageFilter == null) {
+ throw new ConfigurationException("No <fs-detination> defined on either <fs-listener> [" + listener.getName() + "] or <fs-bus> [" + bus.getBusid() + "].");
+ }
+ }
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+ if(listener.getIsGateway()) {
+ listenerNode.setAttribute("gatewayClass", FileGatewayListener.class.getName());
+ // Map EPR related attributes onto the listener - from the bus and provider and listener.
+ // Note: This will change - the Gateways will also support the EPR element...
+ mapFsEprProperties(listenerNode, provider, messageFilter);
+ MapperUtil.mapEPRProperties(listener, listenerNode, model);
+ } else {
+ Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+
+ // Map EPR related attributes onto the EPR - from the bus and provider and listener...
+ mapFsEprProperties(eprNode, provider, messageFilter);
+ MapperUtil.mapEPRProperties(listener, eprNode, model);
+ // Remove any empty attributes set on the EPR config...
+ YADOMUtil.removeEmptyAttributes(eprNode);
+ }
+
+ // Remove any empty attributes set on the listener config...
+ YADOMUtil.removeEmptyAttributes(listenerNode);
+
+ return listenerNode;
+ }
+
+ private static void mapFsEprProperties(Element toElement, FsProvider provider, FsMessageFilter messageFilter) {
+ final File directory = new File(messageFilter.getDirectory()) ;
+ toElement.setAttribute(ListenerTagNames.URL_TAG, directory.toURI().toString());
+ toElement.setAttribute(FileEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
+ toElement.setAttribute(FileEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
+ toElement.setAttribute(FileEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
+ toElement.setAttribute(FileEpr.POST_RENAME_TAG, String.valueOf(messageFilter.getPostRename()));
+ if (!messageFilter.getPostDelete()) {
+ toElement.setAttribute(FileEpr.POST_DIR_TAG, messageFilter.getPostDirectory());
+ toElement.setAttribute(FileEpr.POST_SUFFIX_TAG, messageFilter.getPostSuffix());
+ }
+ toElement.setAttribute(FileEpr.ERROR_DEL_TAG, String.valueOf(messageFilter.getErrorDelete()));
+ if (!messageFilter.getErrorDelete()) {
+ toElement.setAttribute(FileEpr.ERROR_DIR_TAG, messageFilter.getErrorDirectory());
+ toElement.setAttribute(FileEpr.ERROR_SUFFIX_TAG, messageFilter.getErrorSuffix());
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/FsListenerMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/FtpListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/FtpListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/FtpListenerMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,217 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FTPSEpr;
+import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FtpBusDocument.FtpBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FtpListenerDocument.FtpListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FtpMessageFilterDocument.FtpMessageFilter;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FtpMessageFilterDocument.FtpMessageFilter.Protocol;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FtpProviderDocument.FtpProvider;
+import org.jboss.soa.esb.listeners.gateway.ReadOnlyRemoteGatewayListener;
+import org.jboss.soa.esb.listeners.gateway.RemoteGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of a <fs-listener> XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ *
+ * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
+ */
+public class FtpListenerMapper {
+
+ /**
+ * Perform the mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener The Jmslistener to be mapped into the ConfigTree.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, FtpListener listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+ FtpBus bus;
+ FtpProvider provider;
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ try {
+ bus = (FtpBus) model.getBus(listener.getBusidref());
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <ftp-listener> must reference a <ftp-bus>.");
+ }
+ try {
+ provider = (FtpProvider) model.getProvider(bus);
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <ftp-provider> instance. Unexpected exception - this should have caused a validation error!");
+ }
+
+ FtpMessageFilter messageFilter = listener.getFtpMessageFilter();
+ if(messageFilter == null) {
+ messageFilter = bus.getFtpMessageFilter();
+ if(messageFilter == null) {
+ throw new ConfigurationException("No <ftp-detination> defined on either <ftp-listener> [" + listener.getName() + "] or <ftp-bus> [" + bus.getBusid() + "].");
+ }
+ }
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+ if(listener.getIsGateway()) {
+ if ( messageFilter.getReadOnly() )
+ listenerNode.setAttribute("gatewayClass", ReadOnlyRemoteGatewayListener.class.getName());
+ else
+ listenerNode.setAttribute("gatewayClass", RemoteGatewayListener.class.getName());
+ // Map EPR related attributes onto the listener - from the bus and provider and listener.
+ // Note: This will change - the Gateways will also support the EPR element...
+ mapFtpEprProperties(listenerNode, provider, messageFilter);
+ MapperUtil.mapEPRProperties(listener, listenerNode, model);
+ } else {
+ Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+
+ // Map EPR related attributes onto the EPR - from the bus and provider and listener...
+ mapFtpEprProperties(eprNode, provider, messageFilter);
+ MapperUtil.mapEPRProperties(listener, eprNode, model);
+ // Remove any empty attributes set on the EPR config...
+ YADOMUtil.removeEmptyAttributes(eprNode);
+ }
+
+ // Remove any empty attributes set on the listener config...
+ YADOMUtil.removeEmptyAttributes(listenerNode);
+
+ return listenerNode;
+ }
+
+ /**
+ * The separator used by the ftp protocol to separate the
+ * host:port section from the path
+ */
+ private static final String FTP_SEPARATOR = "/";
+
+ private static void mapFtpEprProperties(Element toElement, FtpProvider provider, FtpMessageFilter messageFilter)
+ throws ConfigurationException
+ {
+ String inputDir = messageFilter.getDirectory();
+ if ( ! inputDir.startsWith( FTP_SEPARATOR ) )
+ inputDir = FTP_SEPARATOR + inputDir;
+
+ final String filterPassword = messageFilter.getPassword() ;
+ final String username = encodeUsername(messageFilter.getUsername()) ;
+ final String userInfo = (filterPassword == null ? username : username + ":" + filterPassword) ;
+ final String origHostname = provider.getHostname() ;
+ final int colonLocation = origHostname.indexOf(':') ;
+ final String hostname ;
+ final int port ;
+ if (colonLocation > -1)
+ {
+ hostname = origHostname.substring(0, colonLocation) ;
+ final int portLocation = colonLocation+1 ;
+ if (portLocation < origHostname.length())
+ {
+ try
+ {
+ port = Integer.parseInt(origHostname.substring(portLocation)) ;
+ }
+ catch (final NumberFormatException nfe)
+ {
+ throw new ConfigurationException("Failed to parse port value") ;
+ }
+ }
+ else
+ {
+ port = -1 ;
+ }
+ }
+ else
+ {
+ hostname = origHostname ;
+ port = -1 ;
+ }
+ final URI uri ;
+ try
+ {
+ uri = new URI(messageFilter.getProtocol().toString(),
+ userInfo, hostname, port, inputDir, null, null) ;
+ }
+ catch (final URISyntaxException urise)
+ {
+ throw new ConfigurationException("Unexpected exception creating FTP URI, " + urise.getMessage()) ;
+ }
+ toElement.setAttribute(ListenerTagNames.URL_TAG, uri.toASCIIString());
+ toElement.setAttribute(FTPEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
+ toElement.setAttribute(FTPEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
+ toElement.setAttribute(FTPEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
+ toElement.setAttribute(FTPEpr.POST_RENAME_TAG, String.valueOf(messageFilter.getPostRename()));
+
+ if (!messageFilter.getPostDelete()) {
+ toElement.setAttribute(FTPEpr.POST_DIR_TAG, messageFilter.getPostDirectory());
+ toElement.setAttribute(FTPEpr.POST_SUFFIX_TAG, messageFilter.getPostSuffix());
+ }
+ toElement.setAttribute(FTPEpr.ERROR_DEL_TAG, String.valueOf(messageFilter.getErrorDelete()));
+ if (!messageFilter.getErrorDelete()) {
+ toElement.setAttribute(FTPEpr.ERROR_DIR_TAG, messageFilter.getErrorDirectory());
+ toElement.setAttribute(FTPEpr.ERROR_SUFFIX_TAG, messageFilter.getErrorSuffix());
+ }
+ toElement.setAttribute(FTPEpr.PASSIVE_TAG, String.valueOf(messageFilter.getPassive()));
+ if (Protocol.SFTP.equals(messageFilter.getProtocol())) {
+ toElement.setAttribute(SFTPEpr.CERTIFICATE_TAG, messageFilter.getCertificateUrl());
+ toElement.setAttribute(SFTPEpr.PASSPHRASE_TAG, messageFilter.getCertificatePassphrase()) ;
+ }
+ if (Protocol.FTPS.equals(messageFilter.getProtocol())) {
+ toElement.setAttribute(FTPSEpr.CERTIFICATE_TAG, messageFilter.getCertificateUrl());
+ toElement.setAttribute(FTPSEpr.CERTIFICATE_NAME_TAG, messageFilter.getCertificateName());
+ }
+ }
+
+ private static String encodeUsername(final String username)
+ {
+ if (username != null)
+ {
+ int colonPosn = username.indexOf(':') ;
+ if (colonPosn > -1)
+ {
+ int currentIndex = 0 ;
+ final StringBuilder sb = new StringBuilder() ;
+ while(colonPosn > 0)
+ {
+ sb.append(username.substring(currentIndex, colonPosn)) ;
+ sb.append("%3A") ;
+ currentIndex = colonPosn+1 ;
+ colonPosn = username.indexOf(':', currentIndex) ;
+ }
+ if (currentIndex < username.length())
+ {
+ sb.append(username.substring(currentIndex)) ;
+ }
+ return sb.toString() ;
+ }
+ }
+ return username ;
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/FtpListenerMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/GatewayGenerator.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/GatewayGenerator.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/GatewayGenerator.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,157 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FsListenerDocument.FsListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FtpListenerDocument.FtpListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.GroovyListenerDocument.GroovyListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.HibernateListenerDocument.HibernateListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JbrListenerDocument.JbrListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.HttpGatewayDocument.HttpGateway;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsListenerDocument.JmsListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ServiceDocument.Service;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SqlListenerDocument.SqlListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.UdpListenerDocument.UdpListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.DualListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Listener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JcaGatewayDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.AbstractScheduledListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel110.HttpListenerDocument;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Gateway Listeners Configuration Generator.
+ * <p/>
+ * Generates a "ConfigTree" style configuration for the Gateways Listeners.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class GatewayGenerator {
+
+ private static final Logger logger = Logger.getLogger(GatewayGenerator.class);
+
+ /**
+ * XMLBeans based configuration model instance.
+ */
+ private XMLBeansModel model;
+
+ /**
+ * Public constructor.
+ *
+ * @param model XMLBeans based configuration model instance.
+ */
+ public GatewayGenerator(XMLBeansModel model) {
+ this.model = model;
+ }
+
+ /**
+ * Generate the configuration DOM for the target Server.
+ *
+ * @return The configuration DOM.
+ * @throws org.jboss.soa.esb.ConfigurationException Error creating configuration.
+ */
+ public Document generate() throws ConfigurationException {
+ Document doc = YADOMUtil.createDocument();
+ Element root;
+
+ doc.appendChild(doc.createComment("\n\tNOTE: DO NOT MODIFY\n\tThis file was auto-generated.\n"));
+ root = YADOMUtil.addElement(doc, "jbossesb-gateways");
+ root.setAttribute("parameterReloadSecs", model.getParameterReloadSecs());
+
+ List<Service> services = model.getServices();
+ HashMap<String, HashMap<String, String>> hm = new HashMap<String, HashMap<String, String>>();
+ for (Service service : services) {
+ if (hm.containsKey(service.getCategory())) {
+ HashMap<String, String> hc = hm.get(service.getCategory());
+
+ if (hc.containsKey(service.getName())) {
+ throw new ConfigurationException("Service names must be unique within a category. "
+ + "The service name " + service.getName()
+ + " is already defined within the " + service.getCategory() + " category.");
+ } else {
+ hc.put(service.getName(), service.getName());
+ }
+ } else {
+ HashMap <String,String> hc = new HashMap<String,String>();
+ hc.put(service.getName(), service.getName());
+ hm.put(service.getCategory(), hc);
+ }
+ }
+
+ // Iterate over all the gateway configs and map them to the gateway configuration...
+ List<Listener> gateways = model.getGatewayListeners();
+ for (Listener gateway : gateways) {
+ addGatewayConfig(root, gateway);
+ }
+
+ return doc;
+ }
+
+ /**
+ * Add a single gateway configuration node to configuration root.
+ *
+ * @param root Configuration root node.
+ * @param gateway The Gateway Listener configuration to be added.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ private void addGatewayConfig(Element root, Listener gateway) throws ConfigurationException {
+ Element listenerConfig;
+
+ // Of course we could do the following reflectively if we really want to - TODO perhaps!!
+ if (gateway instanceof JmsListener) {
+ listenerConfig = JmsListenerMapper.map(root, (JmsListener) gateway, model);
+ } else if (gateway instanceof FsListener) {
+ listenerConfig = FsListenerMapper.map(root, (FsListener) gateway, model);
+ } else if (gateway instanceof JcaGatewayDocument.JcaGateway) {
+ listenerConfig = JcaGatewayMapper.map(root, (JcaGatewayDocument.JcaGateway) gateway, model);
+ } else if (gateway instanceof FtpListener) {
+ listenerConfig = FtpListenerMapper.map(root, (FtpListener) gateway, model);
+ } else if (gateway instanceof SqlListener) {
+ listenerConfig = SqlListenerMapper.map(root, (SqlListener) gateway, model);
+ } else if (gateway instanceof JbrListener) {
+ listenerConfig = JbrListenerMapper.map(root, (JbrListener) gateway, model);
+ } else if (gateway instanceof HttpGateway) {
+ listenerConfig = HttpGatewayMapper.map(root, (HttpGateway) gateway, model);
+ } else if (gateway instanceof GroovyListener) {
+ listenerConfig = GroovyListenerMapper.map(root, (GroovyListener) gateway, model);
+ } else if (gateway instanceof HibernateListener) {
+ listenerConfig = HibernateListenerMapper.map(root, (HibernateListener) gateway, model);
+ } else if (gateway instanceof UdpListener) {
+ listenerConfig = UdpListenerMapper.map(root, (UdpListener) gateway, model);
+ } else if (gateway instanceof DualListener){
+ listenerConfig = UntypedListenerMapper.map(root, (DualListener)gateway, model);
+ } else {
+ throw new ConfigurationException("Unexpected gateway type encountered: " + gateway) ;
+ }
+
+ if (gateway instanceof AbstractScheduledListener) {
+ ScheduleMapper.map(listenerConfig, (AbstractScheduledListener) gateway, model);
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/GatewayGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/GroovyListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/GroovyListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/GroovyListenerMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.GroovyListenerDocument;
+import org.jboss.soa.esb.listeners.gateway.GroovyGateway;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.w3c.dom.Element;
+
+/**
+ * Config mapper class for the Groovy Listener.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class GroovyListenerMapper {
+
+ public static Element map(Element root, GroovyListenerDocument.GroovyListener listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+
+ if(listener.getIsGateway()) {
+ listenerNode.setAttribute("gatewayClass", GroovyGateway.class.getName());
+ } else {
+ listenerNode.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, GroovyGateway.class.getName());
+ }
+
+ listenerNode.setAttribute("script", listener.getScript());
+
+ return listenerNode;
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/GroovyListenerMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/HibernateListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/HibernateListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/HibernateListenerMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import java.util.List;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.HibernateBusDocument.HibernateBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.HibernateListenerDocument.HibernateListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.HibernateMessageFilterDocument.HibernateMessageFilter;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.HibernateProviderDocument.HibernateProvider;
+import org.jboss.soa.esb.listeners.gateway.HibernateGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of a <fs-listener> XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ */
+public class HibernateListenerMapper {
+
+ /**
+ * Perform the mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener The Jmslistener to be mapped into the ConfigTree.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, HibernateListener listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+ HibernateBus bus;
+ HibernateProvider provider;
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ try {
+ bus = (HibernateBus) model.getBus(listener.getBusidref());
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <hibernate-listener> must reference a <hibernate-bus>.");
+ }
+ try {
+ provider = (HibernateProvider) model.getProvider(bus);
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <hibernate-provider> instance. Unexpected exception - this should have caused a validation error!");
+ }
+
+ List<HibernateMessageFilter> messageFilters = null;
+ messageFilters = listener.getHibernateMessageFilterList();
+
+ if(messageFilters.size() == 0) {
+ messageFilters = bus.getHibernateMessageFilterList();
+ if(messageFilters == null) {
+ throw new ConfigurationException("No <hibernate-message-filter> defined on either <hibernate-listener> [" + listener.getName() + "] or <hibernate-bus> [" + bus.getBusid() + "].");
+ }
+ }
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+ if(listener.getIsGateway()) {
+ listenerNode.setAttribute("gatewayClass", HibernateGatewayListener.class.getName());
+ // Map EPR related attributes onto the listener - from the bus and provider and listener.
+ // Note: This will change - the Gateways will also support the EPR element...
+ mapHibernateEprProperties(listenerNode, provider, messageFilters);
+ MapperUtil.mapEPRProperties(listener, listenerNode, model);
+ } else {
+ Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+ // Map EPR related attributes onto the EPR - from the bus and provider and listener...
+ mapHibernateEprProperties(eprNode, provider, messageFilters);
+ MapperUtil.mapEPRProperties(listener, eprNode, model);
+ // Remove any empty attributes set on the EPR config...
+ YADOMUtil.removeEmptyAttributes(eprNode);
+ }
+
+ // Remove any empty attributes set on the listener config...
+ YADOMUtil.removeEmptyAttributes(listenerNode);
+
+ return listenerNode;
+ }
+
+ /**
+ * mapHibernateEprProperties creates a ConfigTree with the details we need
+ * from the HibernateProvider and MessageFilters.
+ * @param toElement the element we are passing on
+ * @param provider the provider object
+ * @param messageFilters collection of MessageFilters we need to implement
+ */
+ private static void mapHibernateEprProperties(Element toElement, HibernateProvider provider, List<HibernateMessageFilter> messageFilters) {
+ toElement.setAttribute(HibernateEpr.HIBERNATE_CFG_TAG, provider.getHibernateCfgFile());
+ for (HibernateMessageFilter messageFilter: messageFilters) {
+ Element temp = YADOMUtil.addElement(toElement, "messagefilter");
+ temp.setAttribute(HibernateEpr.CLASS_NAME_TAG, messageFilter.getClassname());
+ temp.setAttribute(HibernateEpr.EVENT_TAG, messageFilter.getEvent());
+ toElement.appendChild(temp);
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/HibernateListenerMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/HttpGatewayMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/HttpGatewayMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/HttpGatewayMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,247 @@
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.gateway.http.HttpGatewayServlet;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.PropertyDocument.Property;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.HttpBusDocument.HttpBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.HttpGatewayDocument.HttpGateway;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.HttpProviderDocument.HttpProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.PayloadAs;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.HttpExceptionMappings;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.AsyncHttpResponse;
+import org.jboss.internal.soa.esb.listeners.war.HttpGatewayDeploymentFactory;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.w3c.dom.Element;
+import org.apache.log4j.Logger;
+
+import java.util.*;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * Http gateway mapper.
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpGatewayMapper {
+
+ private static final Logger logger = Logger.getLogger(HttpGatewayMapper.class);
+
+ /**
+ * Perform the Http listener mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener http listener config.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, HttpGateway listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+ HttpBus bus;
+ HttpProvider provider;
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ try {
+ bus = (HttpBus) model.getOptionalBus(listener.getBusidref());
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <http-listener> must reference a <http-bus>.");
+ }
+
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+
+ String urlPattern = listener.getUrlPattern();
+ PayloadAs.Enum payloadAs = listener.getPayloadAs();
+
+ if(listener.getAsyncResponseList() != null && !listener.getAsyncResponseList().isEmpty()) {
+ AsyncHttpResponse asyncResponse = listener.getAsyncResponseList().get(0);
+ listenerNode.setAttribute(HttpGatewayServlet.ASYNC_SERVICE_INVOKE, "true");
+ listenerNode.setAttribute(HttpGatewayServlet.ASYNC_STATUS_CODE, Integer.toString(asyncResponse.getStatusCode()));
+ AsyncHttpResponse.Payload payload = asyncResponse.getPayload();
+ if(payload != null) {
+ listenerNode.setAttribute(HttpGatewayServlet.ASYNC_PAYLOAD, payload.getClasspathResource());
+ listenerNode.setAttribute(HttpGatewayServlet.ASYNC_PAYLOAD_CONTENT_TYPE, payload.getContentType());
+ if(payload.getCharacterEncoding() != null) {
+ listenerNode.setAttribute(HttpGatewayServlet.ASYNC_PAYLOAD_CHARACTER_ENCODING, payload.getCharacterEncoding());
+ }
+ }
+ } else {
+ listenerNode.setAttribute(HttpGatewayServlet.ASYNC_SERVICE_INVOKE, "false");
+ }
+
+ if(bus != null) {
+ try {
+ provider = (HttpProvider) model.getProvider(bus);
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <http-provider> instance. Unexpected exception - this should have caused a validation error!");
+ }
+
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ //MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
+ for(Property property : provider.getPropertyList()) {
+ Element propertyElement = listenerNode.getOwnerDocument().createElement("property");
+ MapperUtil.serialize(property, propertyElement);
+ listenerNode.appendChild(propertyElement);
+ }
+
+ List<HttpBus.ProtectedMethods> protectedMethodsList = bus.getProtectedMethodsList();
+ List<HttpBus.AllowedRoles> rolesList = bus.getAllowedRolesList();
+ HttpBus.TransportGuarantee.Enum transportGuarantee = bus.getTransportGuarantee();
+
+ MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
+ mapStandardSettings(listenerNode, urlPattern, payloadAs, listener.getPropertyList());
+
+ if(protectedMethodsList != null && !protectedMethodsList.isEmpty()) {
+ HttpBus.ProtectedMethods methods = protectedMethodsList.get(0);
+ StringBuilder methodsString = new StringBuilder();
+
+ for(HttpBus.ProtectedMethods.Method method : methods.getMethodList()) {
+ if(methodsString.length() > 0) {
+ methodsString.append(",");
+ }
+ methodsString.append(method.getName().toString());
+ }
+ listenerNode.setAttribute(HttpGatewayDeploymentFactory.PROTECTED_METHODS, methodsString.toString());
+ }
+ if(rolesList != null && !rolesList.isEmpty()) {
+ HttpBus.AllowedRoles roles = rolesList.get(0);
+ StringBuilder rolesString = new StringBuilder();
+
+ for(HttpBus.AllowedRoles.Role role : roles.getRoleList()) {
+ if(rolesString.length() > 0) {
+ rolesString.append(",");
+ }
+ rolesString.append(role.getName());
+ }
+ listenerNode.setAttribute(HttpGatewayDeploymentFactory.ALLOWED_ROLES, rolesString.toString());
+ }
+
+ if(transportGuarantee != null) {
+ listenerNode.setAttribute(HttpGatewayDeploymentFactory.TRANSPORT_GUARANTEE, transportGuarantee.toString());
+ }
+
+ // Exception status mappings...
+ mapExceptionStatusMappings(listenerNode, provider, listener);
+ } else {
+ // Use the "default" http bus....
+ mapStandardSettings(listenerNode, urlPattern, payloadAs, listener.getPropertyList());
+
+ // Exception status mappings...
+ mapExceptionStatusMappings(listenerNode, (HttpProvider) model.getProvider(HttpProvider.class), listener);
+ }
+
+ return listenerNode;
+ }
+
+ private static void mapStandardSettings(Element listenerNode, String urlPattern, PayloadAs.Enum payloadAs, List<Property> listenerProps) {
+ MapperUtil.mapProperties(listenerProps, listenerNode);
+
+ listenerNode.setAttribute(ListenerTagNames.GATEWAY_CLASS_TAG, HttpGatewayDeploymentFactory.class.getName());
+ listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, "true");
+
+ if(urlPattern != null) {
+ listenerNode.setAttribute(HttpGatewayDeploymentFactory.URL_PATTERN, urlPattern);
+ }
+ if(payloadAs != null) {
+ listenerNode.setAttribute(HttpGatewayServlet.PAYLOAD_AS, payloadAs.toString());
+ }
+ }
+
+ private static void mapExceptionStatusMappings(Element listenerNode, HttpProvider provider, HttpGateway listener) throws ConfigurationException {
+ StringBuilder exceptionMappingsAttrBuilder = new StringBuilder();
+
+ if(provider != null) {
+ HttpExceptionMappings providerExceptionConfig = provider.getException();
+ if(providerExceptionConfig != null) {
+ buildExceptionMappingCSV(exceptionMappingsAttrBuilder, providerExceptionConfig);
+ }
+ }
+
+ if(listener != null && listener.getExceptionList() != null && !listener.getExceptionList().isEmpty()) {
+ HttpExceptionMappings listenerExceptionConfig = listener.getExceptionList().get(0);
+ buildExceptionMappingCSV(exceptionMappingsAttrBuilder, listenerExceptionConfig);
+ }
+
+ if(exceptionMappingsAttrBuilder.length() > 0) {
+ listenerNode.setAttribute(org.jboss.soa.esb.listeners.gateway.http.HttpGatewayServlet.EXCEPTION_MAPPINGS, exceptionMappingsAttrBuilder.toString());
+ }
+ }
+
+ private static void buildExceptionMappingCSV(StringBuilder exceptionMappingsAttrBuilder, HttpExceptionMappings exceptionConfig) throws ConfigurationException {
+ // The mappings file is a .properties file containing exception-to-status-code mappings...
+ String mappingsFile = exceptionConfig.getMappingsFile();
+ if(mappingsFile != null) {
+ exceptionMappingsAttrBuilder.append(mappingsFile);
+ exceptionMappingsAttrBuilder.append(",");
+ }
+
+ // We add the exception mappings as a CSV list of exception class name and status
+ // code key value pairs...
+ List<HttpExceptionMappings.Mapping> mappings = exceptionConfig.getMappingList();
+ if(mappings != null && !mappings.isEmpty()) {
+ for(HttpExceptionMappings.Mapping mapping : mappings) {
+ exceptionMappingsAttrBuilder.append(mapping.getClass1().trim());
+ exceptionMappingsAttrBuilder.append("=");
+ exceptionMappingsAttrBuilder.append(mapping.getStatus());
+ exceptionMappingsAttrBuilder.append(",");
+ }
+ }
+ }
+
+ public static Map<String, Integer> decodeExceptionMappingsCSV(String exceptionMappingsCSV) throws ConfigurationException {
+ AssertArgument.isNotNullAndNotEmpty(exceptionMappingsCSV, "exceptionMappingsCSV");
+
+ Map<String, Integer> mappings = new HashMap<String, Integer>();
+ String[] mappingDecls = exceptionMappingsCSV.split(",");
+
+ for(String mappingDecl : mappingDecls) {
+ String[] mappingTokens = mappingDecl.split("=");
+ if(mappingTokens.length == 1) {
+ loadExceptionMappings(mappingTokens[0], mappings);
+ } else if(mappingTokens.length == 2) {
+ try {
+ mappings.put(mappingTokens[0], Integer.valueOf(mappingTokens[1]));
+ } catch(NumberFormatException e) {
+ throw new ConfigurationException("Invalid Exception Status Mapping mapping declaration '" + mappingDecl + "'. Status code value '" + mappingTokens[1] + "' not a valid integer.");
+ }
+ } else {
+ throw new ConfigurationException("Invalid Exception Status Mapping mapping declaration '" + mappingDecl + "'. Expected either an exception mapping file name, or a '<exception>=<status>' Key Value Pair.");
+ }
+ }
+
+ return mappings;
+ }
+
+ private static void loadExceptionMappings(String mappingsFile, Map<String, Integer> mappings) throws ConfigurationException {
+ Properties mappingProperties = new Properties();
+ InputStream stream = ClassUtil.getResourceAsStream(mappingsFile, HttpGatewayMapper.class);
+
+ if(stream == null) {
+ throw new ConfigurationException("Failed to find Exception to HTTP Status code mappings file '" + mappingsFile + "' on classpath.");
+ }
+
+ try {
+ mappingProperties.load(stream);
+ } catch (IOException e) {
+ throw new ConfigurationException("Error reading Exception to HTTP Status code mappings file '" + mappingsFile + "'.", e);
+ } finally {
+ try {
+ stream.close();
+ } catch (IOException e) {
+ logger.debug("Error closing Exception to HTTP Status code mappings file '" + mappingsFile + "'.", e);
+ }
+ }
+
+ Set<Map.Entry<Object, Object>> entries = mappingProperties.entrySet();
+ for(Map.Entry<Object, Object> entry : entries) {
+ try {
+ mappings.put((String) entry.getKey(), Integer.valueOf((String) entry.getValue()));
+ } catch(NumberFormatException e) {
+ throw new ConfigurationException("Invalid Exception Status Mapping mapping '" + entry.getKey() + "=" + entry.getValue() + "'. Status code value '" + entry.getValue() + "' not a valid integer.");
+ }
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/HttpGatewayMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JbrListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JbrListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JbrListenerMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JbrBusDocument.JbrBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JbrListenerDocument.JbrListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JbrProviderDocument.JbrProvider;
+import org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * JBoss Remoting listener mapper.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JbrListenerMapper {
+
+ /**
+ * Perform the mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener JBoss Remoting listener config.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, JbrListener listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+ JbrBus bus;
+ JbrProvider provider;
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ try {
+ bus = (JbrBus) model.getBus(listener.getBusidref());
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <jbr-listener> must reference a <jbr-bus>.");
+ }
+ try {
+ provider = (JbrProvider) model.getProvider(bus);
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <jbr-provider> instance. Unexpected exception - this should have caused a validation error!");
+ }
+
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
+ MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+
+ if(listener.getIsGateway()) {
+ String host = provider.getHost();
+
+ listenerNode.setAttribute("gatewayClass", JBossRemotingGatewayListener.class.getName());
+ listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));
+
+ if(host != null) {
+ listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_HOST, host);
+ }
+ listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PROTOCOL, provider.getProtocol().toString());
+ listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PORT, Integer.toString(bus.getPort()));
+ } else {
+ throw new ConfigurationException("Invalid <jbr-listener> config [" + listener.getName() + "]. <jbr-listener> is currently only supported as a gateway listener.");
+ }
+
+ return listenerNode;
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JbrListenerMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JcaGatewayMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JcaGatewayMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JcaGatewayMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ServiceDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JcaGatewayDocument.JcaGateway;
+import org.jboss.soa.esb.listeners.jca.JcaInflowGateway;
+import org.w3c.dom.Element;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 29886 $
+ */
+public class JcaGatewayMapper
+{
+ public static Element map(Element root, JcaGateway gateway, XMLBeansModel model) throws ConfigurationException
+ {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+
+ listenerNode.setAttribute("name", gateway.getName());
+
+ ServiceDocument.Service service = model.getService(gateway);
+ listenerNode.setAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG, service.getDescription());
+ listenerNode.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, service.getCategory());
+ listenerNode.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service.getName());
+
+ listenerNode.setAttribute("adapter", gateway.getAdapter());
+ listenerNode.setAttribute("endpointClass", gateway.getEndpointClass());
+ listenerNode.setAttribute("messagingType", gateway.getMessagingType());
+ listenerNode.setAttribute("jcaBridge", gateway.getJcaBridge());
+ listenerNode.setAttribute("transacted", Boolean.valueOf(gateway.getTransacted()).toString());
+
+ MapperUtil.mapProperties(gateway.getPropertyList(), listenerNode);
+ listenerNode.setAttribute("gatewayClass", JcaInflowGateway.class.getName());
+ Element activationConfig = YADOMUtil.addElement(listenerNode, "activation-config");
+ MapperUtil.serialize(gateway.getActivationConfig(), activationConfig);
+
+
+ YADOMUtil.removeEmptyAttributes(listenerNode);
+ return listenerNode;
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JcaGatewayMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JmsListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JmsListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JmsListenerMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,365 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsProviderType;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ActivationConfigDocument.ActivationConfig;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsBusDocument.JmsBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsJcaProviderDocument.JmsJcaProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsListenerDocument.JmsListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsMessageFilterDocument.JmsMessageFilter;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsMessageFilterDocument.JmsMessageFilter.DestType;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.PropertyDocument.Property;
+import org.jboss.soa.esb.listeners.gateway.JmsGatewayListener;
+import org.jboss.soa.esb.listeners.gateway.PackageJmsMessageContents;
+import org.jboss.soa.esb.listeners.jca.ActivationMapper;
+import org.jboss.soa.esb.listeners.jca.JcaConstants;
+import org.jboss.soa.esb.listeners.jca.JcaGatewayListener;
+import org.jboss.soa.esb.listeners.jca.JcaJMSInflowMessageProcessorAdapter;
+import org.jboss.soa.esb.listeners.jca.JcaJMSMessageAwareComposer;
+import org.jboss.soa.esb.listeners.jca.JcaMessageAwareListener;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.w3c.dom.Element;
+
+import com.arjuna.common.util.propertyservice.PropertyManager;
+
+/**
+ * Performs the mapping of a <jms-listener> XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JmsListenerMapper {
+ // The default JMS JCA adapter.
+ private static final String DEFAULT_JMS_ADAPTER = "jms-ra.rar" ;
+
+ private static Logger log = Logger.getLogger( JmsListenerMapper.class );
+
+ /**
+ * Perform the mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener The Jmslistener to be mapped into the ConfigTree.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, JmsListener listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+ JmsBus bus;
+ JmsProviderType provider;
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ try {
+ bus = (JmsBus) model.getBus(listener.getBusidref());
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <jms-listener> must reference a <jms-bus>.");
+ }
+ try {
+ provider = (JmsProviderType) model.getProvider(bus);
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <jms-provider> instance. Unexpected exception - this should have caused a validation error!");
+ }
+
+ JmsMessageFilter messageFilter = listener.getJmsMessageFilter();
+ if(messageFilter == null) {
+ messageFilter = bus.getJmsMessageFilter();
+ if(messageFilter == null) {
+ throw new ConfigurationException("No <jms-detination> defined on either <jms-listener> [" + listener.getName() + "] or <jms-bus> [" + bus.getBusid() + "].");
+ }
+ }
+
+ final Class<?> gatewayClass ;
+ if (provider instanceof JmsJcaProvider) {
+ final JmsJcaProvider jmsJcaProvider = (JmsJcaProvider)provider ;
+ mapJmsJcaAttributes(listener, listenerNode, bus, jmsJcaProvider, messageFilter) ;
+ gatewayClass = JcaGatewayListener.class ;
+ } else {
+ gatewayClass = JmsGatewayListener.class ;
+ }
+
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+ if(listener.getIsGateway()) {
+
+ listenerNode.setAttribute("gatewayClass", gatewayClass.getName());
+ listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));
+
+ // Map EPR related attributes onto the listener - from the bus and provider and listener.
+ // Note: This will change - the Gateways will also support the EPR element...
+ mapJmsEprProperties(listenerNode, provider, messageFilter);
+ listenerNode.setAttribute(ListenerTagNames.PROTOCOL_TAG, JMSEpr.JMS_PROTOCOL);
+
+ MapperUtil.mapEPRProperties(listener, listenerNode, model);
+ } else {
+ Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+
+
+ // Map EPR related attributes onto the EPR - from the bus and provider and listener...
+ mapJmsEprProperties(eprNode, provider, messageFilter);
+ eprNode.setAttribute(ListenerTagNames.PROTOCOL_TAG, JMSEpr.JMS_PROTOCOL);
+
+ MapperUtil.mapEPRProperties(listener, eprNode, model);
+ // Remove any empty attributes set on the EPR config...
+ YADOMUtil.removeEmptyAttributes(eprNode);
+ }
+
+ // Remove any empty attributes set on the listener config...
+ YADOMUtil.removeEmptyAttributes(listenerNode);
+
+ return listenerNode;
+ }
+
+ private static void mapJmsEprProperties(Element toElement, JmsProviderType provider, JmsMessageFilter messageFilter) {
+ if(messageFilter.getDestType() == DestType.QUEUE) {
+ toElement.setAttribute(JMSEpr.DESTINATION_TYPE_TAG, JMSEpr.QUEUE_TYPE);
+ } else {
+ toElement.setAttribute(JMSEpr.DESTINATION_TYPE_TAG, JMSEpr.TOPIC_TYPE);
+ }
+ toElement.setAttribute(JMSEpr.DESTINATION_NAME_TAG, messageFilter.getDestName());
+ toElement.setAttribute(JMSEpr.MESSAGE_SELECTOR_TAG, messageFilter.getSelector());
+ toElement.setAttribute(JMSEpr.CONNECTION_FACTORY_TAG, provider.getConnectionFactory());
+ toElement.setAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG, provider.getJndiContextFactory());
+ toElement.setAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG, provider.getJndiPkgPrefix());
+ toElement.setAttribute(JMSEpr.JNDI_URL_TAG, provider.getJndiURL());
+ toElement.setAttribute(JMSEpr.PERSISTENT_TAG, Boolean.toString( messageFilter.getPersistent()));
+ toElement.setAttribute(JMSEpr.ACKNOWLEDGE_MODE_TAG, messageFilter.getAcknowledgeMode());
+ toElement.setAttribute(JMSEpr.JMS_SECURITY_PRINCIPAL_TAG, messageFilter.getJmsSecurityPrincipal());
+ toElement.setAttribute(JMSEpr.JMS_SECURITY_CREDENTIAL_TAG, messageFilter.getJmsSecurityCredential());
+ toElement.setAttribute(JMSEpr.TRANSACTED_TAG, Boolean.toString( messageFilter.getTransacted()));
+ }
+
+ private static void mapJmsJcaAttributes(final JmsListener listener,
+ final Element listenerNode, final JmsBus bus, final JmsJcaProvider jmsJcaProvider,
+ final JmsMessageFilter messageFilter)
+ throws ConfigurationException {
+ setAttribute(listenerNode, JcaConstants.ATTRIBUTE_ADAPTER,
+ jmsJcaProvider.getAdapter(), DEFAULT_JMS_ADAPTER) ;
+ setAttribute(listenerNode, JcaConstants.ATTRIBUTE_ENDPOINT_CLASS,
+ jmsJcaProvider.getEndpointClass(), JcaJMSInflowMessageProcessorAdapter.class.getName()) ;
+ setAttribute(listenerNode, JcaConstants.ATTRIBUTE_MESSAGING_TYPE,
+ jmsJcaProvider.getMessagingType()) ;
+ setAttribute(listenerNode, JcaConstants.ATTRIBUTE_JCA_BRIDGE,
+ jmsJcaProvider.getJcaBridge()) ;
+ final boolean transacted ;
+ if (jmsJcaProvider.isSetTransacted())
+ {
+ transacted = jmsJcaProvider.getTransacted() ;
+ }
+ else
+ {
+ transacted = true ;
+ }
+
+ setAttribute(listenerNode, JcaConstants.ATTRIBUTE_TRANSACTED,
+ Boolean.toString(transacted)) ;
+
+ if (listener.getIsGateway())
+ {
+ setAttribute(listenerNode, ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG,
+ PackageJmsMessageContents.class.getName()) ;
+ setAttribute(listenerNode, ListenerTagNames.GATEWAY_COMPOSER_METHOD_TAG,
+ "process") ;
+ }
+ else
+ {
+ setAttribute(listenerNode, ListenerTagNames.LISTENER_CLASS_TAG,
+ JcaMessageAwareListener.class.getName()) ;
+ setAttribute(listenerNode, JcaConstants.ATTRIBUTE_LISTENER_COMPOSER_CLASS,
+ JcaJMSMessageAwareComposer.class.getName()) ;
+ }
+
+ final ActivationMapper activationMapper = getActivationMapper(listener, bus, jmsJcaProvider) ;
+ final Map<String, String> activationConfigValues = new HashMap<String, String>() ;
+ activationMapper.setDestination(activationConfigValues, messageFilter.getDestName()) ;
+ activationMapper.setProviderAdapterJNDI(activationConfigValues, jmsJcaProvider.getProviderAdapterJNDI()) ;
+ final int destType = messageFilter.getDestType().intValue() ;
+ if (destType == DestType.INT_QUEUE)
+ {
+ activationMapper.setDestinationType(activationConfigValues, true) ;
+ }
+ else if (destType == DestType.INT_TOPIC)
+ {
+ activationMapper.setDestinationType(activationConfigValues, false) ;
+ }
+ else
+ {
+ throw new ConfigurationException("Unknown destination type: " + messageFilter.getDestType()) ;
+ }
+
+ activationMapper.setMessageSelector(activationConfigValues, messageFilter.getSelector()) ;
+ final Integer maxThreads = (listener.isSetMaxThreads() ? Integer.valueOf(listener.getMaxThreads()) : null) ;
+ activationMapper.setMaxThreads(activationConfigValues, maxThreads) ;
+
+ final Element activationConfigElement = YADOMUtil.addElement(listenerNode, JcaConstants.ELEMENT_ACTIVATION_CONFIG) ;
+ for(Map.Entry<String, String> entry: activationConfigValues.entrySet())
+ {
+ addPropertyElement(activationConfigElement, entry.getKey(), entry.getValue()) ;
+ }
+
+ final Set<String> defaultPropertyNames = activationConfigValues.keySet() ;
+ log.debug("Default activation-config properties :" + defaultPropertyNames );
+
+ /*
+ * add user activation-config properties specified in the provider element.
+ */
+ ActivationConfig activationConfig = jmsJcaProvider.getActivationConfig();
+ if ( activationConfig != null )
+ {
+ List<Property> propertyList = activationConfig.getPropertyList();
+ for (Iterator<Property> iterator = propertyList.iterator(); iterator.hasNext();)
+ {
+ Property prop = iterator.next();
+ if ( defaultPropertyNames.contains( prop.getName() ))
+ throw new ConfigurationException( "activation-config already contains [" + prop.getName() + "], which cannot be overridden");
+
+ addPropertyElement(activationConfigElement, prop.getName(), prop.getValue()) ;
+ }
+ }
+ }
+
+ private static void setAttribute(final Element listenerNode,
+ final String name, final String value)
+ {
+ if (value != null)
+ {
+ listenerNode.setAttribute(name, value) ;
+ }
+ }
+
+ private static void setAttribute(final Element listenerNode,
+ final String name, final String value, final String defaultValue)
+ {
+ if (value == null)
+ {
+ listenerNode.setAttribute(name, defaultValue) ;
+ }
+ else
+ {
+ listenerNode.setAttribute(name, value) ;
+ }
+ }
+
+ private static void addPropertyElement(final Element activationConfigElement,
+ final String name, final String value)
+ {
+ final Element propertyElement = YADOMUtil.addElement(activationConfigElement,
+ JcaConstants.ELEMENT_PROPERTY) ;
+ propertyElement.setAttribute("name", name) ;
+ propertyElement.setAttribute("value", value) ;
+ }
+
+ private static ActivationMapper getActivationMapper(final JmsListener listener,
+ final JmsBus bus, final JmsJcaProvider jmsJcaProvider)
+ throws ConfigurationException
+ {
+ final String activationMapper = getActivationMapperClass(listener, bus, jmsJcaProvider); ;
+ if (activationMapper == null)
+ {
+ throw new ConfigurationException("Could not locate ActivationMapper for adapter " + jmsJcaProvider.getAdapter()) ;
+ }
+ final Class activationMapperClass ;
+ try
+ {
+ activationMapperClass = ClassUtil.forName(activationMapper.trim(), JmsListenerMapper.class) ;
+ }
+ catch (final ClassNotFoundException cnfe)
+ {
+ throw new ConfigurationException("Could not locate activation mapper class " + activationMapper, cnfe) ;
+ }
+
+ if (!ActivationMapper.class.isAssignableFrom(activationMapperClass))
+ {
+ throw new ConfigurationException("Activation mapper class " + activationMapper + " does not implement ActivationMapper interface") ;
+ }
+ try
+ {
+ return (ActivationMapper)(activationMapperClass.newInstance()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new ConfigurationException("Failed to instantiate activation mapper class " + activationMapper, th) ;
+ }
+ }
+
+ private static String getActivationMapperClass(final JmsListener listener,
+ final JmsBus bus, final JmsJcaProvider jmsJcaProvider)
+ throws ConfigurationException
+ {
+ final String listenerActivationMapper = findProperty(listener.getPropertyList(), ListenerTagNames.JCA_ACTIVATION_MAPPER) ;
+ if (listenerActivationMapper != null)
+ {
+ return listenerActivationMapper ;
+ }
+
+ final String busActivationMapper = findProperty(bus.getPropertyList(), ListenerTagNames.JCA_ACTIVATION_MAPPER) ;
+ if (busActivationMapper != null)
+ {
+ return busActivationMapper ;
+ }
+
+ final String providerActivationMapper = findProperty(jmsJcaProvider.getPropertyList(), ListenerTagNames.JCA_ACTIVATION_MAPPER) ;
+ if (providerActivationMapper != null)
+ {
+ return providerActivationMapper ;
+ }
+
+ final String adapter = (jmsJcaProvider.getAdapter() == null ? DEFAULT_JMS_ADAPTER : jmsJcaProvider.getAdapter()) ;
+
+ final PropertyManager propertyManager = ModulePropertyManager.getPropertyManager(ModulePropertyManager.JCA_MODULE);
+ final String activationMapper = propertyManager.getProperty("org.jboss.soa.esb.jca.activation.mapper." + adapter) ;
+ if (activationMapper == null)
+ {
+ throw new ConfigurationException("Could not locate activation mapper for adapter " + adapter) ;
+ }
+ return activationMapper ;
+ }
+
+ private static String findProperty(final List<Property> properties, final String name)
+ {
+ if ((properties != null) && (name != null))
+ {
+ for(Property property: properties)
+ {
+ if (name.equals(property.getName()))
+ {
+ return property.getValue() ;
+ }
+ }
+ }
+ return null ;
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/JmsListenerMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/MapperUtil.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/MapperUtil.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/MapperUtil.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,200 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import java.util.List;
+
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlCursor.TokenType;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.*;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.PropertyDocument.Property;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ServiceDocument.Service;
+import org.jboss.soa.esb.listeners.message.MessageAwareListener;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Mapper utility methods.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract class MapperUtil {
+
+ /**
+ * Map all default listener attributes onto the target listener ConfigTree.
+ * @param listener The listener configuration instance.
+ * @param listenerNode The target DOM ConfigTree listener element.
+ * @param model The model.
+ */
+ protected static void mapDefaultAttributes(Listener listener, Element listenerNode, XMLBeansModel model) {
+ Service service = model.getService(listener);
+ boolean isGateway = XMLBeansModel.isGateway(listener);
+
+ if(listener instanceof DualListener) {
+ listenerNode.setAttribute(ListenerTagNames.MAX_THREADS_TAG, String.valueOf(((DualListener)listener).getMaxThreads()));
+ } else {
+ listenerNode.setAttribute(ListenerTagNames.MAX_THREADS_TAG, "1");
+ }
+
+ mapListenerServiceAttributes(listenerNode, service, isGateway);
+ if (!isGateway && !listenerNode.hasAttribute(ListenerTagNames.LISTENER_CLASS_TAG)) {
+ listenerNode.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, MessageAwareListener.class.getName());
+ }
+
+ ActionsDocument.Actions actions = service.getActions();
+ if(actions != null) {
+ MepType.Enum mep = actions.getMep();
+ if(mep != null) {
+ // Intentionally not setting a default of RequestResponse because the action pipeline
+ // has a "defaultProcessing" state that exists if the mep is not set (dubious??)....
+ listenerNode.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG, mep.toString());
+ }
+ }
+
+ String busIdRef = listener.getBusidref();
+ if(busIdRef != null) {
+ listenerNode.setAttribute(ListenerTagNames.BUSIDREF_ATTRIBUTE_TAG, busIdRef);
+ }
+ }
+
+ /**
+ * Map the Service specific attributes onto the listener configuration.
+ * @param listenerNode The listener config node.
+ * @param service The Service details (from the model).
+ * @param isGateway True if the listener is a gateway, otherwise false.
+ */
+ public static void mapListenerServiceAttributes(Element listenerNode, Service service, boolean isGateway) {
+ listenerNode.setAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG, service.getDescription());
+ if (isGateway) {
+ listenerNode.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, service.getCategory());
+ listenerNode.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service.getName());
+ } else {
+ listenerNode.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, service.getCategory());
+ listenerNode.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, service.getName());
+ }
+ if (service.getAlertTimeThreshold() != null) {
+ listenerNode.setAttribute(ListenerTagNames.SERVICE_ALERT_TIME_TAG, service.getAlertTimeThreshold().toString());
+ }
+ if (service.getAlertLengthThreshold() != null) {
+ listenerNode.setAttribute(ListenerTagNames.SERVICE_ALERT_LENGTH_TAG, service.getAlertLengthThreshold().toString());
+ }
+ }
+
+ /**
+ * Map all the properties targeted at the supplied listener onto the target element.
+ * <p/>
+ * This involves copying the properties from the associated bus and provider nodes.
+ * @param listener The listener config instance.
+ * @param target The target DOM ConfigTree listener element.
+ * @param model The model.
+ * @throws org.jboss.soa.esb.ConfigurationException Bad bis configuration.
+ */
+ protected static void mapEPRProperties(Listener listener, Element target, XMLBeansModel model) throws ConfigurationException {
+ Bus bus = model.getBus(listener.getBusidref());
+ Provider provider = model.getProvider(bus);
+
+ // Map the properties from the provider config...
+ mapProperties(provider.getPropertyList(), target);
+ // Map the properties from the bus config...
+ mapProperties(bus.getPropertyList(), target);
+ }
+
+ /**
+ * Map all the supplied properties onto the target element.
+ * @param target The target DOM element.
+ * @param properties The properties to be mapped.
+ */
+ public static void mapProperties(List<Property> properties, Element target) {
+ // Map the property elements to actions attributes...
+ for(Property property : properties) {
+ Element propertyElement = target.getOwnerDocument().createElement("property");
+ serialize(property, propertyElement);
+ if (propertyElement.hasChildNodes())
+ {
+ YADOMUtil.copyChildNodes(propertyElement, target);
+ }
+ else
+ {
+ target.setAttribute(property.getName(), property.getValue());
+ }
+ }
+ }
+
+ /**
+ * Serialise the supplied {@link org.apache.xmlbeans.XmlObject} instance to the supplied element.
+ * @param xmlObject The XmlObject instance.
+ * @param toElement The element to which the cursor is to be serialised.
+ */
+ protected static void serialize(XmlObject xmlObject, Element toElement) {
+ XmlCursor cursor = xmlObject.newCursor();
+
+ // Note there are methods on the XmlObject that "looked" as though they might be able
+ // to do this for us (save, newDomNode etc), but they kept throwing exceptions.
+
+ serialize(cursor, toElement);
+ cursor.dispose();
+ }
+
+ /**
+ * Serialise the XML content behind the supplied XmlCursor instance to the supplied
+ * target element.
+ * @param cursor The cursor instance.
+ * @param toElement The target DOM Element.
+ */
+ private static void serialize(XmlCursor cursor, Element toElement) {
+ TokenType token;
+ Document doc = toElement.getOwnerDocument();
+
+ while(true) {
+ token = cursor.toNextToken();
+
+ switch (token.intValue()) {
+ case TokenType.INT_ATTR:
+ toElement.setAttribute(cursor.getName().getLocalPart(), cursor.getTextValue());
+ break;
+ case TokenType.INT_COMMENT:
+ toElement.appendChild(doc.createComment(cursor.getTextValue()));
+ break;
+ case TokenType.INT_START:
+ Element childElement = doc.createElement(cursor.getName().getLocalPart());
+ toElement.appendChild(childElement);
+ serialize(cursor, childElement);
+ break;
+ case TokenType.INT_TEXT:
+ toElement.appendChild(doc.createTextNode(cursor.getChars()));
+ break;
+ case TokenType.INT_END:
+ case TokenType.INT_STARTDOC:
+ case TokenType.INT_ENDDOC:
+ case TokenType.INT_NONE:
+ return;
+ case TokenType.INT_PROCINST:
+ case TokenType.INT_NAMESPACE:
+ default:
+ break;
+ }
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/MapperUtil.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/NotificationMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/NotificationMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/NotificationMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ServiceDocument.Service;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NotificationMapper {
+
+ /**
+ * @param listenerConfigTree
+ * @param listenerService
+ * @param model
+ */
+ public static void map(Element listenerConfigTree, Service listenerService, XMLBeansModel model) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/NotificationMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduleMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduleMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduleMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.AbstractScheduledListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FrequencyUnit;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.PropertyDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Schedule;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.CronScheduleDocument.CronSchedule;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ScheduleProviderDocument.ScheduleProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SimpleScheduleDocument.SimpleSchedule;
+import org.jboss.soa.esb.schedule.SchedulerResource;
+import org.w3c.dom.Element;
+
+/**
+ * Schedule Mapper.
+ * <p/>
+ * Maps the scheduling info from the Schedule based listener config, to the
+ * ConfigTree config model.
+ *
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ScheduleMapper {
+
+ private static Logger logger = Logger.getLogger(ScheduleMapper.class);
+
+ public static void map(Element listenerConfig, AbstractScheduledListener scheduledListener, final XMLBeansModel model) throws ConfigurationException {
+ String scheduleIdRef = scheduledListener.getScheduleidref();
+ Element domElement = (Element) scheduledListener.getDomNode();
+ int scheduleFrequency = scheduledListener.getScheduleFrequency();
+ int pollFrequency = scheduledListener.getPollFrequencySeconds();
+ int pollLatency = getPollLatencySeconds(scheduledListener);
+
+ if(scheduleIdRef != null) {
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_ID_REF, scheduleIdRef);
+ final Schedule schedule = model.getSchedule(scheduleIdRef) ;
+ if (schedule.isSetStartDate()) {
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_START_DATE, Long.toString(schedule.getStartDate().getTimeInMillis())) ;
+ }
+ if (schedule.isSetEndDate()) {
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_END_DATE, Long.toString(schedule.getEndDate().getTimeInMillis())) ;
+ }
+ if (schedule instanceof SimpleSchedule) {
+ final SimpleSchedule simpleSchedule = (SimpleSchedule)schedule ;
+ final long simpleFrequency = simpleSchedule.getFrequency() ;
+ final FrequencyUnit.Enum unit = simpleSchedule.getFrequencyUnits() ;
+ final String frequencyVal ;
+ if (unit.equals(FrequencyUnit.SECONDS)) {
+ frequencyVal = Long.toString(simpleFrequency * 1000) ;
+ } else {
+ frequencyVal = Long.toString(simpleFrequency) ;
+ }
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_SIMPLE_FREQUENCY, frequencyVal) ;
+ if (simpleSchedule.isSetExecCount()) {
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_SIMPLE_EXEC, Integer.toString(simpleSchedule.getExecCount())) ;
+ }
+ } else if (schedule instanceof CronSchedule) {
+ final String cronExpression = ((CronSchedule)schedule).getCronExpression() ;
+ if (cronExpression == null) {
+ throw new ConfigurationException("Missing cron expression from configuration") ;
+ }
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_CRON_EXPRESSION, cronExpression) ;
+ } else {
+ throw new ConfigurationException("Unknown schedule type specified in configuration: " + schedule.getClass().getName()) ;
+ }
+
+ if(domElement.hasAttribute("poll-frequency-seconds") || domElement.hasAttribute("schedule-frequency") ) {
+ logger.warn("Schedule Listener '" + listenerConfig.getTagName() + "' defines both 'scheduleidref' and frequency attributes. Using the 'scheduleidref'.");
+ }
+ } else if(scheduleFrequency > -1) {
+ listenerConfig.setAttribute(ScheduleProviderFactory.ATTR_FREQUENCY, Integer.toString(scheduleFrequency));
+ } else if(pollFrequency > -1) {
+ listenerConfig.setAttribute(ScheduleProviderFactory.ATTR_FREQUENCY, Integer.toString(pollFrequency));
+ } else if(pollLatency > -1) {
+ listenerConfig.setAttribute(ScheduleProviderFactory.ATTR_FREQUENCY, Integer.toString(pollLatency));
+ } else {
+ listenerConfig.setAttribute(ScheduleProviderFactory.ATTR_FREQUENCY, "10");
+ }
+
+ final ScheduleProvider scheduleProvider = model.getScheduleProvider() ;
+ if (scheduleProvider != null) {
+ // There is only one schedule provider allowed in the configuration at present
+ copyProperties(listenerConfig, model.getScheduleProvider().getPropertyList(), model.getScheduledListenerCount()) ;
+ }
+
+ if(domElement.hasAttribute("poll-frequency-seconds")) {
+ logger.warn("Attrubute 'poll-frequency-seconds' is DEPRECATED. Please change your configuration to use 'schedule-frequency'.");
+ }
+ if(pollLatency > -1) {
+ logger.warn("Property 'pollLatencySeconds' is DEPRECATED. Please change your configuration to use 'schedule-frequency'.");
+ }
+ }
+
+ private static void copyProperties(final Element listenerConfig, final List<PropertyDocument.Property> properties, final int numScheduledListeners)
+ {
+ final Element schedulePropertyElement = YADOMUtil.addElement(listenerConfig, ListenerTagNames.SCHEDULE_PROPERTIES) ;
+ schedulePropertyElement.setAttribute(SchedulerResource.THREAD_COUNT, Integer.toString(numScheduledListeners)) ;
+
+ if ((properties != null) && (properties.size() > 0))
+ {
+ MapperUtil.mapProperties(properties, schedulePropertyElement) ;
+ }
+ }
+
+ private static int getPollLatencySeconds(AbstractScheduledListener scheduledListener) {
+ String value = XMLBeansModel.getProperty(scheduledListener.getPropertyList(), "pollLatencySeconds", "-1");
+
+ try {
+ return Integer.parseInt(value);
+ } catch (NumberFormatException e) {
+ return -1;
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduleMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduleProviderFactory.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduleProviderFactory.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduleProviderFactory.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.jboss.soa.esb.schedule.*;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ScheduleProviderDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SimpleScheduleDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.CronScheduleDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.FrequencyUnit;
+
+import java.util.List;
+import java.util.Properties;
+import java.util.ArrayList;
+
+/**
+ * Factory class for creating and configuring a {@link org.jboss.soa.esb.schedule.ScheduleProvider}
+ * instance.
+ *
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract class ScheduleProviderFactory {
+
+ public static final String ATTR_SCHEDULE_ID_REF = "scheduleidref";
+ public static final String ATTR_FREQUENCY = "schedule-frequency";
+
+ public static ScheduleProvider createInstance(List<ManagedLifecycle> listeners, ScheduleProviderDocument.ScheduleProvider scheduleProviderConfig) throws ConfigurationException {
+ Properties schedulerConfig = null;
+ List<Schedule> schedules = null;
+ ScheduleProvider instance;
+
+ if(scheduleProviderConfig != null) {
+ schedulerConfig = XMLBeansModel.toProperties(scheduleProviderConfig.getPropertyList());
+ schedules = getSchedules(scheduleProviderConfig);
+ }
+ instance = new ScheduleProvider(schedulerConfig, schedules);
+
+ try {
+ for(ManagedLifecycle listener : listeners) {
+ if(listener instanceof ScheduledEventListener) {
+ ConfigTree config = listener.getConfig();
+ String scheduleIdRef = config.getAttribute(ATTR_SCHEDULE_ID_REF);
+
+ if(scheduleIdRef != null) {
+ instance.addListener((ScheduledEventListener) listener, scheduleIdRef);
+ } else {
+ long frequency = config.getLongAttribute(ATTR_FREQUENCY, 10);
+ instance.addListener((ScheduledEventListener) listener, frequency);
+ }
+ }
+ }
+ } catch (SchedulingException e) {
+ throw new ConfigurationException(e);
+ }
+
+ return instance;
+ }
+
+ private static List<Schedule> getSchedules(ScheduleProviderDocument.ScheduleProvider scheduleProviderConfig) throws ConfigurationException {
+ List<Schedule> schedules = new ArrayList<Schedule>();
+ List<org.jboss.soa.esb.listeners.config.xbeanmodel130.Schedule> scheduleConfigs = scheduleProviderConfig.getScheduleList();
+ List<String> schedulIds = new ArrayList<String>();
+
+ // We wouldn't have to do this if we were using JAXB!!!
+ // TODO: Get XMLBeans to fudge the class names for the generated binds - existing names are potentialy dangerous because they're the same as the non XMLBeans types
+ for(org.jboss.soa.esb.listeners.config.xbeanmodel130.Schedule scheduleConfig : scheduleConfigs) {
+ String scheduleId = scheduleConfig.getScheduleid();
+ Schedule schedule;
+
+ if(schedulIds.contains(scheduleId)) {
+ throw new ConfigurationException("Duplicate 'scheduleid' value of '" + scheduleId + "'. Must be unique on a per <schedule-provider> basis.");
+ }
+ schedulIds.add(scheduleId);
+
+ if(scheduleConfig instanceof SimpleScheduleDocument.SimpleSchedule) {
+ SimpleSchedule simpleSchedule;
+ FrequencyUnit.Enum frequencyUnit = ((SimpleScheduleDocument.SimpleSchedule)scheduleConfig).getFrequencyUnits();
+
+ schedule = simpleSchedule = new SimpleSchedule(scheduleId);
+ if(frequencyUnit == FrequencyUnit.SECONDS) {
+ simpleSchedule.setFrequency(((SimpleScheduleDocument.SimpleSchedule)scheduleConfig).getFrequency() * 1000);
+ } else {
+ simpleSchedule.setFrequency(((SimpleScheduleDocument.SimpleSchedule)scheduleConfig).getFrequency());
+ }
+ simpleSchedule.setExecCount(((SimpleScheduleDocument.SimpleSchedule)scheduleConfig).getExecCount());
+ } else {
+ CronSchedule cronSchedule;
+
+ schedule = cronSchedule = new CronSchedule(scheduleId);
+ cronSchedule.setCronExpression(((CronScheduleDocument.CronSchedule)scheduleConfig).getCronExpression());
+ }
+ schedule.setStartDate(scheduleConfig.getStartDate());
+ schedule.setEndDate(scheduleConfig.getEndDate());
+ schedules.add(schedule);
+ }
+
+ return schedules;
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduleProviderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduledListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduledListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduledListenerMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.w3c.dom.Element;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ScheduledListenerDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ServiceDocument.Service;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.ScheduleListener;
+import org.jboss.soa.esb.dom.YADOMUtil;
+
+/**
+ * Mapper for the {@link org.jboss.soa.esb.listeners.ScheduleListener}.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ScheduledListenerMapper {
+ public static Element map(Element root, ScheduledListenerDocument.ScheduledListener listener, XMLBeansModel model) {
+ Service service = model.getService(listener);
+ boolean isGateway = listener.getIsGateway();
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ listenerNode.setAttribute("event-processor", listener.getEventProcessor());
+ listenerNode.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, ScheduleListener.class.getName());
+ if (listener.isSetTransacted()) {
+ listenerNode.setAttribute(ListenerTagNames.TRANSACTED_TAG, Boolean.toString(listener.getTransacted()));
+ }
+
+ MapperUtil.mapListenerServiceAttributes(listenerNode, service, isGateway) ;
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+
+ return listenerNode;
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/ScheduledListenerMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/SecurityMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/SecurityMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/SecurityMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SecurityDocument.Security;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ServiceDocument.Service;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of XSD based configuration service actions onto a
+ * "ConfigTree" style listener configuration.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public class SecurityMapper
+{
+ private SecurityMapper() {}
+
+ /**
+ * Perform the mapping.
+ *
+ * @param toConfigTree
+ * The listener ConfigTree to which the actions are to be added.
+ * @param service
+ * The Service to which the listener is bound. The Service defines the actions.
+ * @throws org.jboss.soa.esb.ConfigurationException
+ */
+ public static void map( final Element toConfigTree, final Service service ) throws ConfigurationException
+ {
+ final Security security = service.getSecurity();
+ if ( security != null)
+ {
+ final Element securityElement = YADOMUtil.addElement( toConfigTree, ListenerTagNames.SECURITY_TAG );
+ MapperUtil.serialize( security, securityElement );
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/SecurityMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/SqlListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/SqlListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/SqlListenerMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,147 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SqlBusDocument.SqlBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SqlListenerDocument.SqlListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SqlMessageFilterDocument.SqlMessageFilter;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.SqlProviderDocument.SqlProvider;
+import org.jboss.soa.esb.listeners.gateway.SqlTableGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of a <fs-listener> XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ *
+ * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
+ */
+public class SqlListenerMapper {
+
+ /**
+ * Perform the mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener The Jmslistener to be mapped into the ConfigTree.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, SqlListener listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+ SqlBus bus;
+ SqlProvider provider;
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ try {
+ bus = (SqlBus) model.getBus(listener.getBusidref());
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <sql-listener> must reference a <sql-bus>.");
+ }
+ try {
+ provider = (SqlProvider) model.getProvider(bus);
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <sql-provider> instance. Unexpected exception - this should have caused a validation error!");
+ }
+
+ if (provider.getDatasource() != null) {
+ if ((provider.getUsername() != null)
+ || (provider.getDriver() != null)) {
+ throw new ConfigurationException ("Invalid sql-provider configuration : a datasource and a username/password/driver "
+ + "combination cannot both be defined. Use only one (datasource or JDBC connection info)."
+ + "Datasource : [" + provider.getDatasource() + "] JDBC URL [" + provider.getUrl() + "]");
+ }
+ } else if (provider.getUrl() == null) {
+ throw new ConfigurationException ("Invalid sql-provider configuration : a datasource or a URL/username/password/driver "
+ + "combination must be defined. Use only one (datasource or JDBC connection info). "
+ + "URL was null.");
+ } else if (provider.getUsername() == null) {
+ throw new ConfigurationException ("Invalid sql-provider configuration : a datasource or a URL/username/password/driver "
+ + "combination must be defined. Use only one (datasource or JDBC connection info). "
+ + "Username was null.");
+ } else if (provider.getDriver() == null) {
+ throw new ConfigurationException ("Invalid sql-provider configuration : either a datasource or a URL/username/password/driver "
+ + "combination must be defined. Use only one (datasource or JDBC connection info). "
+ + "Driver was null.");
+ }
+
+ SqlMessageFilter messageFilter = listener.getSqlMessageFilter();
+ if(messageFilter == null) {
+ messageFilter = bus.getSqlMessageFilter();
+ if(messageFilter == null) {
+ throw new ConfigurationException("No <sql-destination> defined on either <sql-listener> [" + listener.getName() + "] or <sql-bus> [" + bus.getBusid() + "].");
+ }
+ }
+ listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
+ if (provider.isSetTransacted()) {
+ listenerNode.setAttribute(ListenerTagNames.TRANSACTED_TAG, Boolean.toString(provider.getTransacted())) ;
+ }
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+ if(listener.getIsGateway()) {
+ listenerNode.setAttribute("gatewayClass", SqlTableGatewayListener.class.getName());
+ listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));
+
+ // Map EPR related attributes onto the listener - from the bus and provider and listener.
+ // Note: This will change - the Gateways will also support the EPR element...
+ mapSqlEprProperties(listenerNode, provider, messageFilter);
+ MapperUtil.mapEPRProperties(listener, listenerNode, model);
+ } else {
+ Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+
+ // Map EPR related attributes onto the EPR - from the bus and provider and listener...
+ mapSqlEprProperties(eprNode, provider, messageFilter);
+ MapperUtil.mapEPRProperties(listener, eprNode, model);
+ // Remove any empty attributes set on the EPR config...
+ YADOMUtil.removeEmptyAttributes(eprNode);
+ }
+
+ // Remove any empty attributes set on the listener config...
+ YADOMUtil.removeEmptyAttributes(listenerNode);
+
+ return listenerNode;
+ }
+
+ private static void mapSqlEprProperties(Element toElement, SqlProvider provider, SqlMessageFilter messageFilter) {
+ toElement.setAttribute(JDBCEpr.DATASOURCE_TAG, provider.getDatasource());
+ toElement.setAttribute(JDBCEpr.URL_TAG, provider.getUrl());
+ toElement.setAttribute(JDBCEpr.DRIVER_TAG, provider.getDriver());
+ toElement.setAttribute(JDBCEpr.USERNAME_TAG, provider.getUsername());
+ toElement.setAttribute(JDBCEpr.PASSWORD_TAG, provider.getPassword());
+ toElement.setAttribute(JDBCEpr.TABLE_NAME_TAG, messageFilter.getTablename());
+ toElement.setAttribute(JDBCEpr.WHERE_CONDITION_TAG, messageFilter.getWhereCondition());
+ toElement.setAttribute(JDBCEpr.ORDER_BY_TAG, messageFilter.getOrderBy());
+ toElement.setAttribute(JDBCEpr.MESSAGE_ID_COLUMN_TAG, messageFilter.getMessageIdColumn());
+ toElement.setAttribute(JDBCEpr.RETRY_COUNT_COLUMN_TAG, messageFilter.getRetryCountColumn());
+ toElement.setAttribute(JDBCEpr.DATA_COLUMN_TAG, messageFilter.getMessageColumn());
+ toElement.setAttribute(JDBCEpr.STATUS_COLUMN_TAG, String.valueOf(messageFilter.getStatusColumn()));
+ toElement.setAttribute(JDBCEpr.TIMESTAMP_COLUMN_TAG, messageFilter.getInsertTimestampColumn());
+ toElement.setAttribute(JDBCEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
+ toElement.setAttribute(JDBCEpr.ERROR_DEL_TAG, String.valueOf(messageFilter.getErrorDelete()));
+
+
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/SqlListenerMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/UdpListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/UdpListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/UdpListenerMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.UdpListenerDocument;
+import org.jboss.soa.esb.listeners.gateway.mina.UdpGatewayConfig;
+import org.jboss.soa.esb.listeners.gateway.mina.UdpGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Config mapper class for the UDP Listener.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public class UdpListenerMapper {
+
+ public static Element map(final Element root, final UdpListenerDocument.UdpListener listener, final XMLBeansModel model) throws ConfigurationException
+ {
+ final Element listenerNode = YADOMUtil.addElement(root, "listener");
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+
+ listenerNode.setAttribute("gatewayClass", UdpGatewayListener.class.getName());
+
+ // Map the host, port, and handler class
+ listenerNode.setAttribute(UdpGatewayConfig.HOST_ATTR, listener.getHost());
+ listenerNode.setAttribute(UdpGatewayConfig.PORT_ATTR, listener.getPort().toString());
+ listenerNode.setAttribute(UdpGatewayConfig.HANDLER_CLASS_ATTR, listener.getHandlerClass());
+
+ return listenerNode;
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/UdpListenerMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/UntypedListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/UntypedListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/UntypedListenerMapper.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Bus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.DualListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Listener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Provider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.impl.BusImpl;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.impl.DualListenerImpl;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.impl.BusProviderImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Perform a mapping for an "untyped" listener configuration.
+ * <p/>
+ * By "untyped" we mean that the listener type is not defined in the XSD, but instead is being
+ * defined using the base <listener> type, mapping all it's associated
+ * <property> values (including those of the associated bus and provider) onto the listener
+ * ConfigTree as attributes.
+ * <p/>
+ * This is effectively like the base transform - if we don't have a mapper for the listener, this one is applied.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class UntypedListenerMapper {
+
+ /**
+ * Perform the mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener The listener to be mapped into the ConfigTree.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, DualListener listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ assertListenerConfigOK(listener, model);
+
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+
+ if(listener.getIsGateway()) {
+ listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));
+
+ MapperUtil.mapEPRProperties(listener, listenerNode, model);
+ } else {
+ Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+ MapperUtil.mapEPRProperties(listener, eprNode, model);
+
+ // Remove any empty attributes set on the EPR config...
+ YADOMUtil.removeEmptyAttributes(eprNode);
+ }
+
+ // Remove any empty attributes set on the listener config...
+ YADOMUtil.removeEmptyAttributes(listenerNode);
+
+ return listenerNode;
+ }
+
+ /**
+ * Assert that a valid mapping can be performed from the supplied listener, and the bus + provider it reverences.
+ * @param listener The listener to be checked.
+ * @param model The config model instance.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid mappng request.
+ */
+
+ private static void assertListenerConfigOK(Listener listener, XMLBeansModel model) throws ConfigurationException {
+
+ // Note we're purposely performing instanceof comparisons here...
+
+ if(listener.getClass() != DualListenerImpl.class) {
+ throw new ConfigurationException("Can only use the " + UntypedListenerMapper.class.getName() + " mapper on the base listener type. Cannot use on " + listener.getClass().getName());
+ }
+ Bus bus = model.getBus(listener.getBusidref());
+ if(bus.getClass() != BusImpl.class) {
+ throw new ConfigurationException("The base Listener config [" + listener.getName() + "] must reference a base Bus config type (<bus>).");
+ }
+ Provider provider = model.getProvider(bus);
+ if(provider.getClass().isAssignableFrom(BusProviderImpl.class)) {
+ throw new ConfigurationException("A base Bus config type (<bus>) must be contained within a base Provider type (<bus-provider>).");
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/UntypedListenerMapper.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/XMLBeansModel.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/XMLBeansModel.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/XMLBeansModel.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,703 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers130;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.jboss.internal.soa.esb.publish.ActionContractPublisher;
+import org.jboss.internal.soa.esb.publish.ContractProvider;
+import org.jboss.internal.soa.esb.publish.ContractPublisher;
+import org.jboss.internal.soa.esb.publish.Publish;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.camel.CamelContextContainer;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.config.ServiceContract;
+import org.jboss.soa.esb.listeners.config.ServicePublisher;
+import org.jboss.soa.esb.listeners.config.WebserviceInfo;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.AbstractScheduledListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Bus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.BusProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.DualListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.GatewayOnlyListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Listener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ListenersDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.MepType;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Provider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.Schedule;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ActionDocument.Action;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ActionsDocument.Actions;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.CamelDocument.Camel;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.CamelDocument.Camel.CamelContext;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.CamelDocument.Camel.CamelContext.RoutesBuilder;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.GlobalsDocument.Globals;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.GlobalsDocument.Globals.WarSecurity;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JbossesbDocument.Jbossesb;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.PropertyDocument.Property;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ProvidersDocument.Providers;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ScheduleProviderDocument.ScheduleProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ServiceDocument.Service;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.ServicesDocument.Services;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.w3c.dom.Document;
+
+/**
+ * XMLBeans based model implementation.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class XMLBeansModel {
+
+ /**
+ * XMLBeans config model instance.
+ */
+ private Jbossesb jbossesb;
+
+ /**
+ * Constructor.
+ * @param xmlBeansDoc XMLBeans config model.
+ */
+ public XMLBeansModel(Jbossesb jbossesb) {
+ this.jbossesb = jbossesb;
+ }
+
+ /**
+ * Get the list of ESB Gateway Listeners from the configuration.
+ * @return The list of ESB Gateway Listeners from the configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException Bad configuration.
+ */
+ public List<Listener> getGatewayListeners() throws ConfigurationException {
+ return getListeners(true);
+ }
+
+ /**
+ * Get the list of ESB Aware Listeners from the configuration.
+ * @return The list of ESB Aware Listeners from the configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException Bad configuration.
+ */
+ public List<Listener> getESBAwareListeners() throws ConfigurationException {
+ return getListeners(false);
+ }
+
+ /**
+ * Get the Service to which the supplied {@link org.jboss.soa.esb.listeners.config.xbeanmodel110.Listener} configuration instance is bound.
+ * @param listener The listener instance (Gateway or ESB Aware).
+ * @return The Service to which the
+ */
+ public Service getService(Listener listener) {
+ List<Service> services = getServices();
+
+ for(Service service : services) {
+ ListenersDocument.Listeners listeners = service.getListeners();
+
+ if(listeners != null) {
+ List<Listener> listenerList = listeners.getAbstractListenerList();
+
+ if(listenerList != null) {
+ for(Listener serviceListener : listenerList) {
+ if(serviceListener == listener) {
+ return service;
+ }
+ }
+ }
+ }
+ }
+
+ throw new IllegalStateException("No Service instance found for the supplied Listener instance. This should not be possible if the Listener instance was provided by this configuration. Where has this Listener instance come from?");
+ }
+
+ /**
+ * Get the Service list.
+ * @return Service list.
+ */
+ public List<Service> getServices() {
+ final Services services = jbossesb.getServices();
+ if (services != null) {
+ return jbossesb.getServices().getServiceList();
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ /**
+ * Get the <bus> configuration matching the supplied busid reference value.
+ * @param busid The required <bus> configuration reference value.
+ * @return The Bus configuration instance.
+ * @throws org.jboss.soa.esb.ConfigurationException Unknown busid reference value.
+ */
+ public Bus getBus(String busid) throws ConfigurationException {
+ Bus bus = getOptionalBus(busid);
+
+ if(bus == null) {
+ throw new ConfigurationException("Invalid ESB Configuration: No <bus> configuration matching busid reference value [" + busid + "].");
+ }
+
+ return bus;
+ }
+
+ /**
+ * Get the <bus> configuration matching the supplied busid reference value.
+ * @param busid The required <bus> configuration reference value.
+ * @return The Bus configuration instance.
+ */
+ public Bus getOptionalBus(String busid) {
+ Providers providers = jbossesb.getProviders();
+
+ if(providers != null) {
+ List<Provider> providerList = providers.getProviderList();
+
+ for(Provider provider : providerList) {
+ if(provider instanceof BusProvider) {
+ List<Bus> buses = ((BusProvider)provider).getBusList();
+
+ for(Bus bus : buses) {
+ if(bus.getBusid().equals(busid)) {
+ return bus;
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the <provider> configuration containing the supplied Bus configuration instance.
+ * @param bus The Bus config instance whose Provider is being sought.
+ * @return The Provider configuration instance.
+ */
+ public Provider getProvider(Bus bus) {
+ Providers providers = jbossesb.getProviders();
+
+ if(providers != null) {
+ List<Provider> providerList = providers.getProviderList();
+
+ for(Provider provider : providerList) {
+ if(provider instanceof BusProvider) {
+ List<Bus> buses = ((BusProvider)provider).getBusList();
+
+ for(Bus installedBus : buses) {
+ if(installedBus == bus) {
+ return provider;
+ }
+ }
+ }
+ }
+ }
+
+ throw new IllegalStateException("No Provider instance found for the supplied Bus config instance. This should not be possible if the Bus instance was provided by this configuration. Where has this Bus instance come from?");
+ }
+
+ /**
+ * Get the <provider> configuration containing the supplied Bus configuration instance.
+ * @param providerType The Bus Provider type is being sought.
+ * @return The Provider configuration instance.
+ */
+ public Provider getProvider(Class<? extends BusProvider> providerType) {
+ Providers providers = jbossesb.getProviders();
+
+ if(providers != null) {
+ List<Provider> providerList = providers.getProviderList();
+
+ for(Provider provider : providerList) {
+ if(providerType.isAssignableFrom(provider.getClass())) {
+ return provider;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public Schedule getSchedule(final String id) {
+ if((id == null) || (jbossesb.getProviders() == null)) {
+ return null;
+ }
+
+ List<Provider> providers = jbossesb.getProviders().getProviderList();
+
+ for(Provider provider : providers) {
+ if(provider instanceof ScheduleProvider) {
+ final ScheduleProvider scheduleProvider = (ScheduleProvider)provider ;
+ final List<Schedule> schedules = scheduleProvider.getScheduleList() ;
+ for(Schedule schedule: schedules) {
+ if (id.equals(schedule.getScheduleid())) {
+ return schedule ;
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public ScheduleProvider getScheduleProvider() {
+ if(jbossesb.getProviders() == null) {
+ return null;
+ }
+
+ List<Provider> providers = jbossesb.getProviders().getProviderList();
+
+ for(Provider provider : providers) {
+ if(provider instanceof ScheduleProvider) {
+ return (ScheduleProvider) provider;
+ }
+ }
+
+ return null;
+ }
+
+ public int getScheduledListenerCount() {
+ int count = 0 ;
+ if (jbossesb.getServices() != null) {
+ final List<Service> services = getServices() ;
+ for(Service service: services) {
+ final ListenersDocument.Listeners listeners = service.getListeners() ;
+ if (listeners != null) {
+ for (Listener listener: listeners.getAbstractListenerList()) {
+ if (listener instanceof AbstractScheduledListener) {
+ count++ ;
+ }
+ }
+ }
+ }
+ }
+ return count ;
+ }
+
+ public static boolean isGateway(Listener listener)
+ {
+ if(listener instanceof GatewayOnlyListener) {
+ return true;
+ } else if(listener instanceof DualListener) {
+ return ((DualListener)listener).getIsGateway();
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the list of ESB Listeners based on their Gateway flag.
+ * @return The list of ESB Aware or Gateway Listeners from the configuration.
+ * @param isGateway Is the listener a gateway or ESB aware listener.
+ * @throws org.jboss.soa.esb.ConfigurationException Bad configuration.
+ */
+ private List<Listener> getListeners(boolean isGateway) throws ConfigurationException {
+ List<Listener> gateways = new ArrayList<Listener>();
+ if (jbossesb.getServices() != null) {
+ List<Service> services = getServices();
+
+ for(Service service : services) {
+ boolean listenerAdded = false;
+ ListenersDocument.Listeners listeners = service.getListeners();
+
+ if(listeners != null) {
+ for(Listener listener : listeners.getAbstractListenerList()) {
+ if(isGateway(listener) == isGateway) {
+ gateways.add(listener);
+ listenerAdded = true;
+ }
+ }
+ }
+
+ // Make sure each Service config has a message aware listener...
+ // http://jira.jboss.com/jira/browse/JBESB-648
+ if(!exposesInVMListener(service) && !isGateway && !listenerAdded) {
+ throw new ConfigurationException("Service configuration for Service '" + service.getCategory() + ":" + service.getName() + "' doesn't define a Message-Aware Listener (i.e. is-gateway='false').");
+ }
+ }
+ }
+
+ return gateways;
+ }
+
+ /**
+ * Gets the setting for the number of seconds between reloads.
+ *
+ * @return The param reload seconds config value.
+ */
+ public String getParameterReloadSecs() {
+ return jbossesb.getParameterReloadSecs().getStringValue();
+ }
+
+ public static String getProperty(List<Property> properties, String name, String defaultVal) {
+ for (Property property : properties) {
+ if(property.getName().equals(name)) {
+ return property.getValue();
+ }
+ }
+
+ return defaultVal;
+ }
+
+ public static boolean exposesInVMListener(Service service) {
+ if(service.xgetInvmScope() != null && service.xgetInvmScope().getStringValue() != null) {
+ return (service.xgetInvmScope().getStringValue().equals("GLOBAL"));
+ }
+
+ String systemDefaultScope = System.getProperty(Environment.DEFAULT_INVM_SCOPE, "GLOBAL");
+ String defaultScope = ModulePropertyManager.getPropertyManager("core").getProperty(Environment.DEFAULT_INVM_SCOPE, systemDefaultScope);
+
+ return defaultScope.equals("GLOBAL");
+ }
+
+ /**
+ * Verify the schedule provider configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException
+ */
+ public void verifyScheduleProviderConfig()
+ throws ConfigurationException {
+ Providers providersConfig = jbossesb.getProviders();
+
+ if(providersConfig == null) {
+ return;
+ }
+
+ List<Provider> providers = providersConfig.getProviderList();
+ int numScheduleProviders = 0;
+
+ for(Provider provider : providers) {
+ if(provider instanceof ScheduleProvider) {
+ numScheduleProviders++;
+ }
+ }
+
+ if(numScheduleProviders > 1) {
+ throw new ConfigurationException("Configuration contains " + numScheduleProviders + " <schedule-provider> configurations. Only one of this provider type can exist per configuration.");
+ }
+ }
+
+
+ /**
+ * Get a map of service publishers provided by each service.
+ *
+ * @return The map of service publishers, keyed by service.
+ */
+ public Map<org.jboss.soa.esb.Service, List<ServicePublisher>> getServicePublishers() {
+ List<Service> serviceConfigs = getServices();
+ final Map<org.jboss.soa.esb.Service, List<ServicePublisher>> servicePublishers = new LinkedHashMap<org.jboss.soa.esb.Service, List<ServicePublisher>>() ;
+
+ for (Service docService : serviceConfigs) {
+ ContractPublisher publisher = getContractPublisher(docService);
+ final org.jboss.soa.esb.Service service = new org.jboss.soa.esb.Service(docService.getCategory(), docService.getName()) ;
+ ServicePublisher servicePublisher = new ServicePublisher(service.getName(), service.getCategory(), publisher);
+
+ servicePublisher.setDescription(docService.getDescription());
+ addPublisher(servicePublishers, service, servicePublisher) ;
+ }
+
+ return servicePublishers ;
+ }
+
+ /**
+ * Get the contract publisher for the service.
+ * @param service The current service definition.
+ * @return The contract publisher of null if none present.
+ */
+ private static ContractPublisher getContractPublisher(Service service) {
+ if(service.getActions() == null || service.getActions().getActionList() == null) {
+ return null;
+ }
+
+ for (Action action : service.getActions().getActionList()) {
+ Class<Class> actionClass;
+
+ try {
+ actionClass = (Class<Class>) ClassUtil.forName(action.getClass1(), ServicePublisher.class);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException("Failed to find action class '" + action.getClass1() + "'.", e);
+ }
+
+ Publish publishAnnotation = (Publish) actionClass.getAnnotation(Publish.class);
+ if (publishAnnotation != null) {
+ Class publisherClass;
+ ActionContractPublisher publisher = null;
+
+ publisherClass = publishAnnotation.value();
+ try {
+ publisher = (ActionContractPublisher) publisherClass.newInstance();
+ final org.jboss.soa.esb.listeners.config.Action actionInfo = new org.jboss.soa.esb.listeners.config.Action(
+ action.getName(), action.getClass1(), action.getProcess(), toProperties(action.getPropertyList())) ;
+
+ if(actionInfo.getProperties().getProperty("publishContract", "true").equals("true")) {
+ publisher.setActionConfig(actionInfo);
+ // JBESB-3034
+ publisher = ActionContractPublisher.ProxyFactory.createContextClassLoaderProxy(publisher);
+ return publisher;
+ }
+ } catch (ClassCastException e) {
+ throw new RuntimeException("Action Contract Publisher class '" + publisherClass.getName() + "' must implement " + ActionContractPublisher.class.getName());
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to instantiate Contract Publisher '" + publisherClass.getName() + "'. Class must implement a public default constructor.", e);
+ }
+ }
+ }
+
+ // No publisher configured on any of the actions in the processing chain...
+ return null;
+ }
+
+
+ /**
+ * Add the publisher into map for the specified service.
+ * @param servicePublishers The service publishers
+ * @param service The service name
+ * @param publisher The publisher
+ */
+ private static void addPublisher(final Map<org.jboss.soa.esb.Service, List<ServicePublisher>> servicePublishers,
+ final org.jboss.soa.esb.Service service, final ServicePublisher publisher)
+ {
+ final List<ServicePublisher> publishers = servicePublishers.get(service) ;
+ if (publishers != null) {
+ publishers.add(publisher);
+ } else {
+ final List<ServicePublisher> newPublishers = new ArrayList<ServicePublisher>() ;
+ newPublishers.add(publisher) ;
+ servicePublishers.put(service, newPublishers) ;
+ }
+ }
+
+ /**
+ * Generate the ESB Aware configuration document.
+ * @return The ESB aware configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException Error creating configuration.
+ */
+ public Document generateESBAwareConfig()
+ throws ConfigurationException
+ {
+ // Generate and serialise the configuration for the ESB Aware listeners...
+ ESBAwareGenerator awareGenerator = new ESBAwareGenerator(this);
+ return awareGenerator.generate();
+ }
+
+ /**
+ * Generate the gateway configuration document.
+ * @return The gateway configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException Error creating configuration.
+ */
+ public Document generateGatewayConfig()
+ throws ConfigurationException
+ {
+ // Generate and serialise the configuration for the Gateway listeners...
+ GatewayGenerator gatewayGenerator = new GatewayGenerator(this);
+ return gatewayGenerator.generate();
+ }
+
+ /**
+ * Get the properties from the document.
+ * @param configProperties The document properties.
+ * @return The properties.
+ */
+ public static Properties toProperties(List<Property> configProperties) {
+ Properties properties = new Properties();
+
+ for(Property property : configProperties) {
+ String name = property.getName();
+ String value = property.getValue();
+
+ if(value != null) {
+ properties.setProperty(name, value);
+ }
+ // TODO: https://jira.jboss.org/jira/browse/JBESB-2381
+ }
+
+ return properties;
+ }
+
+ /**
+ * Get the list of actions in this deployment.
+ * @return a list of actions or null if none present.
+ */
+ public Set<String> getActions()
+ {
+ final Services services = jbossesb.getServices() ;
+ if (services != null)
+ {
+ final Set<String> actionClasses = new HashSet<String>() ;
+
+ for(final Service service : services.getServiceList())
+ {
+ final Actions actions = service.getActions() ;
+ if (actions != null)
+ {
+ for (final Action action: actions.getActionList())
+ {
+ actionClasses.add(action.getClass1()) ;
+ }
+ }
+ }
+
+ return actionClasses ;
+ }
+ return null ;
+ }
+
+
+ /**
+ * Get the list of services which require a webservice endpoint.
+ * @return The list of services.
+ */
+ public List<WebserviceInfo> getWebserviceServices()
+ {
+ final List<WebserviceInfo> endpointServices = new ArrayList<WebserviceInfo>() ;
+ final Services services = jbossesb.getServices() ;
+ if (services != null)
+ {
+ for(final Service service : services.getServiceList())
+ {
+ final Actions actions = service.getActions() ;
+ if (actions != null)
+ {
+ if (!actions.isSetWebservice() || actions.getWebservice())
+ {
+ final String inXsd = actions.getInXsd() ;
+ if (inXsd != null)
+ {
+ final WebserviceInfo webserviceInfo = new WebserviceInfo(
+ new org.jboss.soa.esb.Service(service.getCategory(), service.getName()),
+ actions.getInXsd(), actions.getOutXsd(), actions.getFaultXsd(),
+ service.getDescription(), MepType.REQUEST_RESPONSE.equals(actions.getMep()),
+ actions.getRequestLocation(), actions.getResponseLocation(), actions.getAddressing()) ;
+ endpointServices.add(webserviceInfo) ;
+ }
+ }
+ }
+ }
+ }
+ return endpointServices ;
+ }
+
+ public List<ServiceContract> getServiceContracts()
+ {
+ final List<ServiceContract> serviceContractList = new ArrayList<ServiceContract>() ;
+ final Services services = jbossesb.getServices() ;
+ if (services != null)
+ {
+ for(final Service service : services.getServiceList())
+ {
+ final Actions actions = service.getActions() ;
+ if (actions != null)
+ {
+ for (Action action : actions.getActionList())
+ {
+ Class<?> actionClass;
+ try {
+ actionClass = (Class<?>)ClassUtil.forName(action.getClass1(), ServiceContract.class);
+ } catch (ClassNotFoundException cnfe) {
+ throw new RuntimeException(cnfe);
+ } catch (NoClassDefFoundError ncdfe) {
+ throw new RuntimeException(ncdfe);
+ }
+ Publish publishAnnotation = (Publish)actionClass.getAnnotation(Publish.class);
+ if (publishAnnotation != null) {
+ Class<?> publisherClass = publishAnnotation.value();
+ if (ContractProvider.class.isAssignableFrom(publisherClass)) {
+ ContractProvider provider;
+ try {
+ provider = (ContractProvider)publisherClass.newInstance();
+ Properties properties = toProperties(action.getPropertyList());
+ provider.setContractProperties(properties);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to create ContractProvider", e);
+ }
+ ServiceContract serviceContract = new ServiceContract(
+ new org.jboss.soa.esb.Service(service.getCategory(), service.getName()),
+ service.getDescription(),
+ provider
+ );
+ serviceContractList.add(serviceContract);
+ break; // first Action with a ContractProvider wins!
+ }
+ }
+ }
+ }
+ }
+ }
+ return serviceContractList;
+ }
+
+ public List<CamelContextContainer> getCamelContextContainers() {
+ final List<CamelContextContainer> camelContextContainerList = new ArrayList<CamelContextContainer>();
+ Camel camel = jbossesb.getCamel();
+ if (camel != null) {
+ List<CamelContext> camelContextList = camel.getCamelContextList();
+ if (camelContextList != null) {
+ for (CamelContext camelContext : camelContextList) {
+ ConfigTree camelContextConfig = new ConfigTree(CamelContextContainer.CAMEL_CONTEXT);
+ camelContextConfig.setAttribute(CamelContextContainer.FACTORY_CLASS, camelContext.getFactoryClass());
+ List<RoutesBuilder> routesBuilderList = camelContext.getRoutesBuilderList();
+ if (routesBuilderList != null) {
+ for (RoutesBuilder routesBuilder: routesBuilderList) {
+ ConfigTree routesBuilderConfig = new ConfigTree(CamelContextContainer.ROUTES_BUILDER, camelContextConfig);
+ routesBuilderConfig.setAttribute(CamelContextContainer.CLASS, routesBuilder.getClass1());
+ }
+ }
+ try {
+ camelContextContainerList.add(new CamelContextContainer(camelContextConfig));
+ } catch (ConfigurationException ce) {
+ throw new RuntimeException("Failed to create CamelContextContainer", ce);
+ }
+ }
+ }
+ }
+ return camelContextContainerList;
+ }
+
+ public String getAuthDomain()
+ {
+ WarSecurity warSecurity = getWarSecurity();
+ if (warSecurity != null)
+ {
+ return warSecurity.getDomain();
+ }
+ return null;
+ }
+
+ public String getAuthMethod()
+ {
+ WarSecurity warSecurity = getWarSecurity();
+ if (warSecurity != null)
+ {
+ return warSecurity.getMethod().toString();
+ }
+ return null;
+ }
+
+ private WarSecurity getWarSecurity()
+ {
+ Globals globals = jbossesb.getGlobals();
+ if (globals != null)
+ {
+ return globals.getWarSecurity();
+ }
+ return null;
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers130/XMLBeansModel.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model101SchemaParser.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model101SchemaParser.java 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model101SchemaParser.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -21,6 +21,7 @@
package org.jboss.soa.esb.listeners.config.model;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -31,6 +32,7 @@
import org.apache.xmlbeans.XmlException;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.camel.CamelContextContainer;
import org.jboss.soa.esb.listeners.config.ServiceContract;
import org.jboss.soa.esb.listeners.config.ServicePublisher;
import org.jboss.soa.esb.listeners.config.WebserviceInfo;
@@ -166,6 +168,11 @@
{
return model.getServiceContracts() ;
}
+
+ public List<CamelContextContainer> getCamelContextContainers()
+ {
+ return Collections.emptyList();
+ }
/**
* This feature in not implemented in the 1.0.1 version of the schema.
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model110SchemaParser.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model110SchemaParser.java 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model110SchemaParser.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -21,6 +21,7 @@
package org.jboss.soa.esb.listeners.config.model;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -31,6 +32,7 @@
import org.apache.xmlbeans.XmlException;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.camel.CamelContextContainer;
import org.jboss.soa.esb.listeners.config.ServiceContract;
import org.jboss.soa.esb.listeners.config.ServicePublisher;
import org.jboss.soa.esb.listeners.config.WebserviceInfo;
@@ -165,6 +167,11 @@
{
return model.getServiceContracts() ;
}
+
+ public List<CamelContextContainer> getCamelContextContainers()
+ {
+ return Collections.emptyList();
+ }
/**
* This feature in not implemented in the 1.0.1 version of the schema.
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model120SchemaParser.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model120SchemaParser.java 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model120SchemaParser.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -21,6 +21,7 @@
package org.jboss.soa.esb.listeners.config.model;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -30,6 +31,7 @@
import org.apache.xmlbeans.XmlException;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.camel.CamelContextContainer;
import org.jboss.soa.esb.listeners.config.ServiceContract;
import org.jboss.soa.esb.listeners.config.ServicePublisher;
import org.jboss.soa.esb.listeners.config.WebserviceInfo;
@@ -164,6 +166,11 @@
{
return model.getServiceContracts() ;
}
+
+ public List<CamelContextContainer> getCamelContextContainers()
+ {
+ return Collections.emptyList();
+ }
public String getAuthDomain()
{
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model130SchemaParser.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model130SchemaParser.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model130SchemaParser.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,184 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.config.model;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.xmlbeans.XmlException;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.camel.CamelContextContainer;
+import org.jboss.soa.esb.listeners.config.ServiceContract;
+import org.jboss.soa.esb.listeners.config.ServicePublisher;
+import org.jboss.soa.esb.listeners.config.WebserviceInfo;
+import org.jboss.soa.esb.listeners.config.mappers130.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.xbeanmodel130.JbossesbDocument.Factory;
+import org.w3c.dom.Document;
+
+/**
+ * Schema parser for jbossesb-1.3.0.xsd schema.
+ *
+ * <a href='mailto:Kevin.Conner at jboss.com>Kevin Conner</a>
+ */
+class Model130SchemaParser implements SchemaParser
+{
+ /**
+ * The namespace associated with this parser.
+ */
+ static final String NAMESPACE = "http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd" ;
+
+ /**
+ * The schema resource for validation.
+ */
+ static final String SCHEMA = "/jbossesb-1.3.0.xsd";
+
+ /**
+ * Obtain a model adapter from the specified stream.
+ * @param reader The XML stream reader.
+ * @return The model adapter
+ * @throws javax.xml.stream.XMLStreamException for errors during parsing.
+ */
+ public ModelAdapter parse(final XMLStreamReader reader)
+ throws ModelException
+ {
+ try
+ {
+ return new Model130Adapter(new XMLBeansModel(Factory.parse(reader).getJbossesb())) ;
+ }
+ catch (final XmlException xmle)
+ {
+ throw new ModelException("Error during schema parsing", xmle) ;
+ }
+ }
+
+ /**
+ * Model adapter for the jbossesb-1.3.0.xsd schema.
+ *
+ * <a href='mailto:Kevin.Conner at jboss.com>Kevin Conner</a>
+ *
+ */
+ private static final class Model130Adapter implements ModelAdapter
+ {
+ /**
+ * The model for jbossesb-1.3.0.xsd.
+ */
+ private final XMLBeansModel model ;
+
+ /**
+ * Create the jbossesb-1.3.0 model adapter.
+ * @param model The jbossesb-1.3.0 model.
+ */
+ Model130Adapter(final XMLBeansModel model)
+ {
+ this.model = model ;
+ }
+
+ /**
+ * Verify the schedule provider configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException
+ */
+ public void verifyScheduleProviderConfig()
+ throws ConfigurationException
+ {
+ model.verifyScheduleProviderConfig() ;
+ }
+
+ /**
+ * Get a map of service publishers provided by each service.
+ *
+ * @return The map of service publishers, keyed by service.
+ */
+ public Map<Service, List<ServicePublisher>> getServicePublishers()
+ {
+ return model.getServicePublishers() ;
+ }
+
+
+ /**
+ * Generate the ESB Aware configuration document.
+ * @return The ESB aware configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException Error creating configuration.
+ */
+ public Document generateESBAwareConfig()
+ throws ConfigurationException
+ {
+ return model.generateESBAwareConfig() ;
+ }
+
+ /**
+ * Generate the gateway configuration document.
+ * @return The gateway configuration.
+ * @throws org.jboss.soa.esb.ConfigurationException Error creating configuration.
+ */
+ public Document generateGatewayConfig()
+ throws ConfigurationException
+ {
+ return model.generateGatewayConfig() ;
+ }
+
+ /**
+ * Get the list of actions in this deployment.
+ * @return a list of actions or null if none present.
+ */
+ public Set<String> getActions()
+ {
+ return model.getActions() ;
+ }
+
+ /**
+ * Get the list of services which require a webservice endpoint.
+ * @return The list of services.
+ */
+ public List<WebserviceInfo> getWebserviceServices()
+ {
+ return model.getWebserviceServices() ;
+ }
+
+ /**
+ * Get the list of service contracts.
+ * @return The list of service contracts.
+ */
+ public List<ServiceContract> getServiceContracts()
+ {
+ return model.getServiceContracts() ;
+ }
+
+ public List<CamelContextContainer> getCamelContextContainers()
+ {
+ return model.getCamelContextContainers();
+ }
+
+ public String getAuthDomain()
+ {
+ return model.getAuthDomain();
+ }
+
+ public String getAuthMethod()
+ {
+ return model.getAuthMethod();
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/Model130SchemaParser.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelAdapter.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelAdapter.java 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelAdapter.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -27,6 +27,7 @@
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.camel.CamelContextContainer;
import org.jboss.soa.esb.listeners.config.ServiceContract;
import org.jboss.soa.esb.listeners.config.ServicePublisher;
import org.jboss.soa.esb.listeners.config.WebserviceInfo;
@@ -88,6 +89,12 @@
public List<ServiceContract> getServiceContracts() ;
/**
+ * Get the list of camel context containers.
+ * @return The list of camel context containers.
+ */
+ public List<CamelContextContainer> getCamelContextContainers() ;
+
+ /**
* Gets the global authentication domain.
*
* @return String The name of the authentication domain.
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelParser.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelParser.java 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/src/org/jboss/soa/esb/listeners/config/model/ModelParser.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -74,12 +74,13 @@
SCHEMA_PARSERS.put(Model101SchemaParser.NAMESPACE, new Model101SchemaParser()) ;
SCHEMA_PARSERS.put(Model110SchemaParser.NAMESPACE, new Model110SchemaParser()) ;
SCHEMA_PARSERS.put(Model120SchemaParser.NAMESPACE, new Model120SchemaParser()) ;
+ SCHEMA_PARSERS.put(Model130SchemaParser.NAMESPACE, new Model130SchemaParser()) ;
Schema schema = null ;
try
{
schema = XMLHelper.getSchema(new String[] {Model101SchemaParser.SCHEMA,
- Model110SchemaParser.SCHEMA, Model120SchemaParser.SCHEMA}) ;
+ Model110SchemaParser.SCHEMA, Model120SchemaParser.SCHEMA, Model130SchemaParser.SCHEMA}) ;
}
catch (SAXException saxe)
{
Modified: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/tests/build.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/tests/build.xml 2010-05-15 01:05:41 UTC (rev 32894)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/rosetta/tests/build.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -21,6 +21,7 @@
<property name="model101.classes" location="${gendir}/classes" />
<property name="model110.classes" location="${gendir}/classes110" />
<property name="model120.classes" location="${gendir}/classes120" />
+ <property name="model130.classes" location="${gendir}/classes130" />
<property name="org.jboss.esb.test.persistdb.dir" location="${org.jboss.esb.internal.dest}/testdb"/>
@@ -39,6 +40,7 @@
<pathelement location="${model101.classes}"/>
<pathelement location="${model110.classes}"/>
<pathelement location="${model120.classes}"/>
+ <pathelement location="${model130.classes}"/>
<pathelement location="${org.jboss.esb.module.classes.dir}"/>
<pathelement location="${org.jboss.esb.root.dir}/rosetta/tests/resources/etc"/>
<pathelement location="${org.jboss.esb.module.tests.conf.dir}"/>
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/build.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/build.xml (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/build.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,22 @@
+<project name="Quickstart_helloworld_camel" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="runtest" depends="compile"
+ description="">
+ <echo>Runs Test</echo>
+ <!--
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage" failonerror="true">
+ <arg value="Hello World"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ -->
+ </target>
+
+</project>
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/build.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/deployment.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/deployment.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,2 @@
+<jbossesb-deployment>
+</jbossesb-deployment>
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/deployment.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/jboss-esb.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,20 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd" parameterReloadSecs="5">
+
+ <camel>
+ <camel-context>
+ <routes-builder class="org.jboss.soa.esb.samples.quickstart.helloworld_camel.HelloWorldRouteBuilder"/>
+ </camel-context>
+ </camel>
+
+ <services>
+ <service category="helloworld_camel" name="service1" description="Hello World" invmScope="GLOBAL">
+ <actions mep="OneWay">
+ <action name="action1" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Hello World"/>
+ </action>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/jboss-esb.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/log4j.xml
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/log4j.xml 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id$ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="DEBUG"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/log4j.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/readme.txt
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/readme.txt (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/readme.txt 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,18 @@
+Overview:
+=========
+ The purpose of the helloworld quickstart sample is to prove that the ESB is
+ is properly configured and happy. As well as to demonstrate the needed
+ minimal files to make a basic ESB component execute.
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 3. Switch back to Application Server console to see the output from the ESB
+ 4. In this folder ("Window1"), type 'ant undeploy'.
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/readme.txt
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/esb/samples/quickstart/helloworld_camel/HelloWorldRouteBuilder.java
===================================================================
--- labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/esb/samples/quickstart/helloworld_camel/HelloWorldRouteBuilder.java (rev 0)
+++ labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/esb/samples/quickstart/helloworld_camel/HelloWorldRouteBuilder.java 2010-05-15 09:56:08 UTC (rev 32895)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2010
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworld_camel;
+
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * HelloWorldRouteBuilder.
+ *
+ * @author david at jboss.org
+ */
+public class HelloWorldRouteBuilder extends RouteBuilder
+{
+
+ public void configure() throws Exception
+ {
+ from("file:///home/dward/tmp/camel/?delete=true")
+ .to("jbossesb://service?category=helloworld_camel&name=service1");
+ }
+
+}
Property changes on: labs/jbossesb/workspace/dward/JBESB_4_8_Camel/product/samples/quickstarts/helloworld_camel/src/org/jboss/soa/esb/samples/quickstart/helloworld_camel/HelloWorldRouteBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the jboss-svn-commits
mailing list