[jboss-svn-commits] JBL Code SVN: r8459 - in labs/jbossesb/trunk/product: core/listeners/src/org/jboss/soa/esb/listeners/config core/listeners/src/org/jboss/soa/esb/listeners/config/mappers core/listeners/tests/src/org/jboss/soa/esb/listeners/config etc/schemas/xml
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Dec 20 16:47:00 EST 2006
Author: kurt.stam at jboss.com
Date: 2006-12-20 16:46:57 -0500 (Wed, 20 Dec 2006)
New Revision: 8459
Modified:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java
labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java
labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml
labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml
labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd
Log:
Adding File System (FS) validation support.
Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java 2006-12-20 21:16:48 UTC (rev 8458)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java 2006-12-20 21:46:57 UTC (rev 8459)
@@ -24,10 +24,12 @@
import java.util.List;
import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.listeners.config.FsListenerDocument.FsListener;
import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
import org.jboss.soa.esb.listeners.config.JmsListenerDocument.JmsListener;
import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
import org.jboss.soa.esb.listeners.config.mappers.ActionMapper;
+import org.jboss.soa.esb.listeners.config.mappers.FsListenerMapper;
import org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapper;
import org.jboss.soa.esb.listeners.config.mappers.NotificationMapper;
import org.jboss.soa.esb.listeners.config.mappers.UntypedListenerMapper;
@@ -92,6 +94,8 @@
// 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 FsListener) {
+ listenerConfigTree = FsListenerMapper.map(root, (FsListener)listener, model);
} else {
listenerConfigTree = UntypedListenerMapper.map(root, listener, model);
}
Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java 2006-12-20 21:16:48 UTC (rev 8458)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java 2006-12-20 21:46:57 UTC (rev 8459)
@@ -83,11 +83,6 @@
mapProperties(provider.getPropertyArray(), target);
// Map the properties from the bus config...
mapProperties(bus.getPropertyArray(), target);
-
- if(!model.getService(listener).getIsGateway()) {
- // And the EPR description.
- target.setAttribute(ListenerTagNames.EPR_DESCRIPTION_TAG, listener.getName());
- }
}
/**
Modified: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java 2006-12-20 21:16:48 UTC (rev 8458)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java 2006-12-20 21:46:57 UTC (rev 8459)
@@ -120,7 +120,7 @@
assertEquals(1, gatewayListener.getMaxThreads());
List<Listener> awareListeners = model.getESBAwareListeners();
- assertEquals(2, awareListeners.size());
+ assertEquals(3, awareListeners.size());
JmsListener awareListener = (JmsListener)awareListeners.get(0);
assertEquals("Bank-Listener", awareListener.getName());
assertEquals("local-jms", awareListener.getBusidref());
Modified: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml 2006-12-20 21:16:48 UTC (rev 8458)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml 2006-12-20 21:46:57 UTC (rev 8459)
@@ -14,6 +14,12 @@
<jms-message-filter dest-type="QUEUE" dest-name="queue/A" selector="service='Reconciliation'" />
</jms-bus>
</jms-provider>
+
+ <fs-provider name="SambaFS">
+ <fs-bus busid="SambaFS-Temp">
+ <fs-message-filter directory="C:/Temp" input-suffix=".txt"/>
+ </fs-bus>
+ </fs-provider>
<provider name="JBossAS">
<property name="my-generic-provider" value="my-generic-provider#someattribvalue" />
@@ -65,7 +71,19 @@
</action>
</actions>
- </service>
+ </service>
+ <service category="Test1" name="FSTest" description="File System Test" is-gateway="false">
+
+ <listeners>
+ <fs-listener name="test-fs-listener"
+ busidref="SambaFS-Temp"
+ maxThreads="1"/>
+ </listeners>
+ <actions>
+ <action name="TestDefaultRouteAction" process="route" class="org.jboss.soa.esb.actions.CbrProxyAction"/>
+ </actions>
+
+ </service>
</services>
</jbossesb>
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml 2006-12-20 21:16:48 UTC (rev 8458)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml 2006-12-20 21:46:57 UTC (rev 8459)
@@ -5,7 +5,7 @@
-->
<jbossesb-listeners parameterReloadSecs="180">
<Bank-Listener listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="2" service-category="Bank" service-description="Bank Reconciliation Service" service-name="Reconciliation">
-<EPR connection-factory="ConnectionFactory" destination-name="queue/B" destination-type="topic" epr-description="Bank-Listener" jndi-URL="jnp://localhost:1099" message-selector="service='Reconciliation'" protocol="jms"/>
+<EPR connection-factory="ConnectionFactory" destination-name="queue/B" destination-type="topic" jndi-URL="jnp://localhost:1099" message-selector="service='Reconciliation'" protocol="jms"/>
<action action="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.CbrProxyAction" process="route" propName="propValue">
This is some complex..
<!-- property -->
@@ -18,7 +18,7 @@
</action>
</Bank-Listener>
<Bank-Listener-Generic listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="2" my-generic-listener="my-generic-listener#someattribvalue" service-category="Bank" service-description="Bank Reconciliation Service" service-name="Reconciliation">
-<EPR epr-description="Bank-Listener-Generic" my-generic-bus="my-generic-bus#someattribvalue" my-generic-provider="my-generic-provider#someattribvalue"/>
+<EPR my-generic-bus="my-generic-bus#someattribvalue" my-generic-provider="my-generic-provider#someattribvalue"/>
<action action="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.CbrProxyAction" process="route" propName="propValue">
This is some complex..
<!-- property -->
@@ -30,4 +30,8 @@
Some CDATA data...
</action>
</Bank-Listener-Generic>
+<test-fs-listener listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="1" service-category="Test1" service-description="File System Test" service-name="FSTest">
+<EPR URL="file:///C:/Temp" errorDelete="true" inputSuffix=".txt" postDelete="true" workSuffix=".esbInProcess"/>
+<action action="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.CbrProxyAction" process="route"/>
+</test-fs-listener>
</jbossesb-listeners>
Modified: labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd
===================================================================
--- labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd 2006-12-20 21:16:48 UTC (rev 8458)
+++ labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd 2006-12-20 21:46:57 UTC (rev 8459)
@@ -220,7 +220,7 @@
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
<xsd:element name="jms-message-filter">
- <xsd:annotation><xsd:documentation xml:lang="en">A JMS filter can add a information to a Queue, or Topic. For example you
+ <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>
@@ -286,6 +286,75 @@
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
- </xsd:element>
-
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ FS Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="fs-message-filter">
+ <xsd:annotation><xsd:documentation xml:lang="en">A FS filter can add a 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 fs-bus.</xsd:documentation></xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="directory" use="required" type="xsd:string">
+ <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" use="required" type="xsd:string">
+ <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 name="work-suffix" use="optional" type="xsd:string" default=".esbInProcess">
+ <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 name="post-delete" use="optional" type="xsd:boolean" default="true">
+ <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 name="post-directory" use="optional" type="xsd:string" default="processed">
+ <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 name="post-suffix" use="optional" type="xsd:string" default=".esbDone">
+ <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 name="error-delete" use="optional" type="xsd:boolean" default="true">
+ <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 name="error-directory" use="optional" type="xsd:string" default="processed">
+ <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 name="error-suffix" use="optional" type="xsd:string" default=".esbERROR">
+ <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 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 ref="jesb:fs-message-filter" maxOccurs="1" minOccurs="0"/>
+ </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:provider"/>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="fs-listener" substitutionGroup="jesb: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:listener">
+ <xsd:sequence>
+ <xsd:element ref="jesb:fs-message-filter" maxOccurs="1" minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
</xsd:schema>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list