[jboss-svn-commits] JBL Code SVN: r29281 - in labs/jbossesb/workspace/bsutter: JBW_Chicago_Demos and 47 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 9 17:33:09 EDT 2009
Author: burrsutter
Date: 2009-09-09 17:33:08 -0400 (Wed, 09 Sep 2009)
New Revision: 29281
Added:
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/build.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/deployment.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/http-exception-mappings.properties
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jboss-esb.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jbossesb-properties.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jndi.properties
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/juddi.properties
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/lib/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/lib/jdom.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/lib/rome-1.0.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/log4j.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/readme.txt
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/scripts/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/scripts/check-origin.groovy
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/smooks-config.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/samples/quickstart/atom_publisher2/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/samples/quickstart/atom_publisher2/MyAction.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/Customer.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/OrderHeader.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/OrderItem.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/StoreAction.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/transforms/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/transforms/from-dvdstore.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/transforms/from-petstore.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/.classpath
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/.project
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/FruitCup.drl
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/build.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/deployment.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jbm-queue-service.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jboss-esb.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jbossesb-properties.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jndi.properties
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/juddi.properties
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/lib/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/log4j.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/readme.txt
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/scripts/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/scripts/MessageInjectionConsole.groovy
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Apple.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/MyAction.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Orange.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Thing.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/build.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/deployment.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jbm-queue-service.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jboss-esb.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jbossesb-properties.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jndi.properties
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/juddi.properties
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/infinispan-core.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jaxb-api-2.1.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jaxb-impl-2.1.3.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jboss-common-core-2.2.14.GA.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jboss-logging-spi-2.1.0.GA.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jboss-transaction-api-1.0.1.GA.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jcip-annotations-1.0.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jgroups-2.8.0.CR1.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/log4j-1.2.14.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/marshalling-api-1.2.0.CR3.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/river-1.2.0.CR3.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/log4j.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/readme.txt
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/scripts/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/scripts/MessageInjectionConsole.groovy
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/jboss/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/jboss/soa/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/jboss/soa/esb/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/jboss/soa/esb/samples/quickstart/infinispandemo/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/jboss/soa/esb/samples/quickstart/infinispandemo/MyAction.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/.classpath
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/.project
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/OrderCount.drl
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/SampleOrder1.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/SampleOrder2.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/build.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/deployment.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/images/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/images/gear1.gif
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jbm-queue-service.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jboss-esb.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jbossesb-properties.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jndi.properties
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/juddi.properties
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/lib/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/lib/swing-layout-1.0.jar
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/listener.log
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/log4j.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/readme.txt
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/smooks-res.xml
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/ServiceAlertMonitor.form
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/ServiceAlertMonitor.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/MyAction.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/RulesCallbackInvoker.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/SetupMessage.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/Customer.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/DVDStoreAction.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/OrderHeader.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/OrderItem.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/test/
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/test/ReceiveJMSMessage.java
labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/test/SendJMSMessage.java
Log:
Initial creation
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/build.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/build.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/build.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,20 @@
+<project name="Quickstart_atom_publisher2" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="deploy.exploded" value="true"/>
+
+ <property name="additional.deploys" value="http-exception-mappings.properties,smooks-config.xml,scripts/**,transforms/**" />
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="quickstart-specific-assemblies">
+ <copy todir="${classes}">
+ <fileset dir="${basedir}" includes="scripts/**/*"/>
+ </copy>
+ </target>
+
+</project>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/deployment.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/deployment.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,2 @@
+<jbossesb-deployment>
+</jbossesb-deployment>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/http-exception-mappings.properties
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/http-exception-mappings.properties (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/http-exception-mappings.properties 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1 @@
+org.jboss.soa.esb.samples.quickstart.atom_publisher.MyActionException=502
\ No newline at end of file
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jboss-esb.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,88 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd"
+ parameterReloadSecs="5">
+
+ <providers>
+ <http-provider name="http">
+ <http-bus busid="http_gateway"/>
+ <!-- Global exception mappings file... -->
+ <exception mappingsFile="/http-exception-mappings.properties" />
+ </http-provider>
+
+ <fs-provider name="FileSystemProvider">
+ <fs-bus busid="inboundOrderChannel">
+ <fs-message-filter
+ directory="C:\tmp\inboundOrders"
+ error-delete="false"
+ error-suffix=".error"
+ error-directory="C:\tmp\inboundOrders"
+ input-suffix=".xml"
+ post-delete="false"
+ post-suffix=".done"
+ post-directory="C:\tmp\inboundOrders"
+ work-suffix=".working"/>
+ </fs-bus>
+
+ <fs-bus busid="inboundOrderChannelESB">
+ <fs-message-filter directory="C:\tmp\inboundOrders"
+ error-delete="false" error-suffix=".esberror"
+ input-suffix=".xml.esb" post-delete="true" post-suffix=".esbdone"
+ post-directory="C:\tmp\inboundOrders"
+ work-suffix=".esbworking"/>
+ </fs-bus>
+ </fs-provider>
+ </providers>
+
+ <services>
+ <service category="Sales2" name="List" description="" invmScope="GLOBAL">
+ <listeners>
+ <!-- Receives: http://<host>:<port>/Quickstart_atom_publisher2/http/sales2/* -->
+ <http-gateway name="sales" busidref="http_gateway" urlPattern="sales2/*" />
+ </listeners>
+ <actions mep="RequestResponse">
+ <action name="createAtomFeed"
+ class="org.jboss.soa.esb.samples.quickstart.atom_publisher2.MyAction"
+ process="process"/>
+ </actions>
+ </service>
+
+ <service category="Sales2" name="inboundOrders"
+ description="retrieve Orders from the file-system">
+ <listeners>
+ <fs-listener name="inboundOrderChannelGatewayListener"
+ busidref="inboundOrderChannel"
+ is-gateway="true"
+ poll-frequency-seconds="1"/>
+ <fs-listener name="inboundOrderChannelESBListener"
+ busidref="inboundOrderChannelESB" />
+ </listeners>
+ <actions mep="OneWay">
+ <action name="print_action" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="false" />
+ <property name="message" value="Before check-origin" />
+ </action>
+
+ <action name="discover-message-origin"
+ class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
+ <property name="script" value="/scripts/check-origin.groovy" />
+ </action>
+
+ <!-- Transform XML to POJOs... -->
+ <action name="transform" class="org.jboss.soa.esb.smooks.SmooksAction">
+ <property name="smooksConfig" value="/smooks-config.xml" />
+ <property name="resultType" value="JAVA" />
+ </action>
+
+ <action name="print" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="false"/>
+ </action>
+
+ <action name="addNewOrder"
+ class="org.jboss.soa.esb.samples.quickstart.atom_publisher2.MyAction"
+ process="addNewOrder" />
+ </actions>
+ </service>
+ </services>
+
+
+</jbossesb>
\ No newline at end of file
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jbossesb-properties.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jndi.properties
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jndi.properties (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/jndi.properties 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/juddi.properties
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/juddi.properties (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/juddi.properties 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/lib/jdom.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/lib/jdom.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/lib/rome-1.0.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/lib/rome-1.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/log4j.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/log4j.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | 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>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/readme.txt
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/readme.txt (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/readme.txt 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,31 @@
+Overview:
+=========
+ The purpose of the http_gateway quickstart sample is to demonstarte how to
+ configue a http gateway to pass the http request into ESB service.
+
+
+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 '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open the web brower and send http requests to the following addresses. Be sure to
+ check the Server console after executing each request:
+ a) http://localhost:8080/Quickstart_http_gateway/http/sales/a/b/c - Will be routed to the Sales:List
+ service. Will return some details about the request. This Service's <http-gateway> references a
+ "secureFriends" bus, which contains login configurations.
+ b) http://localhost:8080/Quickstart_http_gateway/http/index/XXXX/yyy?a=1,b=2 - Will be routed to the Index:List
+ service. Will return some details about the request. This Service's <http-listener> does not refer
+ to any bus and so simply uses the "default" http bus.
+ c) http://localhost:8080/Quickstart_http_gateway/http/Exceptions/Exception1 - Will be routed to the
+ Exceptions:Exception1 service. This service throws a "MyActionException", resulting in a
+ 502 (Bad Gateway) status being returned in accordance with the Exception to HTTP status code
+ mappings defined globally on the <http-provider>.
+ d) http://localhost:8080/Quickstart_http_gateway/http/Exceptions/Exception2 - Will be routed to the
+ Exceptions:Exception2 service. This service also throws a "MyActionException", but the <http-gateway>
+ on this service overrides the globally defined Exception to HTTP status code mappings defined globally
+ on the <http-provider> to return a 503 (Service Unavailable) status for the "MyActionException" exception.
+ 3. In this folder ("Window1"), type 'ant undeploy'.
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/scripts/check-origin.groovy
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/scripts/check-origin.groovy (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/scripts/check-origin.groovy 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,14 @@
+import org.jboss.soa.esb.message.*
+
+def messageText = new String(message.getBody().get());
+def order = new XmlParser().parseText(messageText);
+
+if(order.OrderLines.size() == 1) {
+ println("DVDStore Order");
+ message.getProperties().setProperty(Properties.MESSAGE_PROFILE, "from:dvdstore");
+} else if(order.LineItems.size() == 1) {
+ println("Petstore Order");
+ message.getProperties().setProperty(Properties.MESSAGE_PROFILE, "from:petstore");
+}
+
+println "Message from property: " + message.getProperties().getProperty(Properties.MESSAGE_PROFILE);
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/smooks-config.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/smooks-config.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/smooks-config.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd">
+
+ <profiles>
+ <profile base-profile="from:dvdstore" />
+ <profile base-profile="from:petstore" />
+ </profiles>
+
+ <import file="classpath:/transforms/from-dvdstore.xml" />
+ <import file="classpath:/transforms/from-petstore.xml" />
+
+</smooks-resource-list>
\ No newline at end of file
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/samples/quickstart/atom_publisher2/MyAction.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/samples/quickstart/atom_publisher2/MyAction.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/samples/quickstart/atom_publisher2/MyAction.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,139 @@
+/*
+ * 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.samples.quickstart.atom_publisher2;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.gateway.http.HttpRequest;
+import org.jboss.soa.esb.actions.routing.http.HttpResponse;
+import javax.servlet.http.HttpServletResponse;
+import org.jboss.soa.esb.Service;
+
+import org.jboss.soa.esb.store.Customer;
+import org.jboss.soa.esb.store.OrderHeader;
+
+//import com.thoughtworks.xstream.XStream;
+
+import com.sun.syndication.feed.synd.*;
+import com.sun.syndication.io.SyndFeedOutput;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class MyAction extends AbstractActionPipelineProcessor {
+
+ protected ConfigTree _config;
+ private Service service;
+ private static final DateFormat DATE_PARSER = new SimpleDateFormat("yyyy-MM-dd");
+ private static List entries = new ArrayList();
+ // using a static is a horrible idea, just trying to make this demo simple
+ // if I really wanted to share data between services then using JBossCache
+ // would like make the most sense.
+ private SyndEntry entry;
+ private SyndContent description;
+
+ public MyAction(ConfigTree config) {
+ _config = config;
+ service = new Service(_config.getParent().getAttribute(
+ ListenerTagNames. SERVICE_CATEGORY_NAME_TAG),
+ _config.getParent().getAttribute(ListenerTagNames.SERVICE_NAME_TAG));
+ }
+ public void initialise() throws ActionLifecycleException {
+ System.out.println("\n %%%%% initialise() %%%%% ");
+
+ /*
+ entry = new SyndEntryImpl();
+ entry.setTitle("Sales News");
+ entry.setLink("http://www.cnn.com");
+
+ entry.setPublishedDate(new java.util.Date());
+ description = new SyndContentImpl();
+ description.setType("text/plain");
+ description.setValue("Amazing things have happened!!!");
+ entry.setDescription(description);
+ entries.add(entry);
+ */
+ }
+ public void destroy() throws ActionLifecycleException {
+ System.out.println("\n %%%%% destroy() %%%%% ");
+ }
+ public Message process(Message message) throws ActionProcessingException {
+
+ System.out.println("&&&&&&&&&&&&& MyAction.process &&&&&&&&&&&&&&&&&&");
+
+ try {
+ SyndFeed feed = new SyndFeedImpl();
+ feed.setFeedType("atom_1.0");
+
+ feed.setTitle("ESB News (atom_publisher2)");
+ feed.setLink("http://localhost:8080/Quickstart_atom_publisher/http/sales");
+ feed.setDescription("This feed has been created using JBossESB+Rome");
+
+ feed.setEntries(entries);
+ Writer writer = new StringWriter();
+ SyndFeedOutput output = new SyndFeedOutput();
+ output.output(feed,writer);
+ writer.close();
+ String response = writer.toString();
+ //System.out.println(response);
+ message.getBody().add(response);
+
+ HttpResponse responseInfo = new HttpResponse(HttpServletResponse.SC_OK);
+ responseInfo.setContentType("application/x.atom+xml");
+ responseInfo.setResponse(message);
+
+ } catch (Exception e) {
+ e.printStackTrace(System.out);
+ throw new ActionProcessingException(e.getMessage());
+ }
+ return message;
+
+ }
+ public Message addNewOrder(Message message) throws ActionProcessingException {
+ System.out.println("&&&&&&&&&&&&& MyAction.addNewOrder &&&&&&&&&&&&&&&&&&");
+ Map resultMap = (Map) message.getBody().get();
+ OrderHeader header = (OrderHeader) resultMap.get("orderHeader");
+
+ entry = new SyndEntryImpl();
+ entry.setTitle("Sales News - New Order $" + header.getTotalAmount());
+ entry.setLink("http://www.cnn.com");
+
+ entry.setPublishedDate(new java.util.Date());
+ description = new SyndContentImpl();
+ description.setType("text/plain");
+ description.setValue("New Order: " + header);
+ entry.setDescription(description);
+
+ entries.add(entry);
+ System.out.println("Order: " + header);
+ //System.out.println("Entries: " + entries);
+ System.out.println("&&&&&&&&&&&&& MyAction.addNewOrder &&&&&&&&&&&&&&&&&&");
+ return message;
+ }
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/Customer.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/Customer.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/Customer.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,107 @@
+/*
+ * 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.store;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class Customer implements Serializable{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ // <Customer userName="user1" firstName="Harry" lastName="Potter" state="SD"/>
+ private String userName;
+ private String firstName;
+ private String lastName;
+ private String state;
+ private int status;
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+ public int getStatus() {
+ return this.status;
+ }
+ /**
+ * @return Returns the firstName.
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+ /**
+ * @param firstName The firstName to set.
+ */
+ public void setFirstName(String firstName) {
+ //System.out.println("**** firstName: " + firstName);
+ this.firstName = firstName;
+ }
+ /**
+ * @return Returns the lastName.
+ */
+ public String getLastName() {
+ return lastName;
+ }
+ /**
+ * @param lastName The lastName to set.
+ */
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+ /**
+ * @return Returns the state.
+ */
+ public String getState() {
+ return state;
+ }
+ /**
+ * @param state The state to set.
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+ /**
+ * @return Returns the userName.
+ */
+ public String getUserName() {
+ return userName;
+ }
+ /**
+ * @param userName The userName to set.
+ */
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return userName + "," + firstName + "," + lastName + "," + state;
+ }
+
+
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/OrderHeader.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/OrderHeader.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/OrderHeader.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,139 @@
+/*
+ * 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.store;
+
+import java.util.Calendar;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class OrderHeader implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ // <Order orderId="1" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="0" netAmount="59.97" totalAmount="64.92" tax="4.95">
+ private String orderId;
+ private Calendar orderDate;
+ private String statusCode;
+ private double netAmount;
+ private double totalAmount;
+ private double tax;
+ private double orderDiscount;
+ private int orderPriority;
+
+ public void setOrderPriority(int orderPriority) {
+ this.orderPriority = orderPriority;
+ }
+ public int getOrderPriority() {
+ return this.orderPriority;
+ }
+
+ public void setOrderDiscount(double orderDiscount) {
+ this.orderDiscount = orderDiscount;
+ }
+ public double getOrderDiscount() {
+ return orderDiscount;
+ }
+ /**
+ * @return Returns the netAmount.
+ */
+ public double getNetAmount() {
+ return netAmount;
+ }
+ /**
+ * @param netAmount The netAmount to set.
+ */
+ public void setNetAmount(double netAmount) {
+ this.netAmount = netAmount;
+ }
+ /**
+ * @return Returns the orderDate.
+ */
+ public Calendar getOrderDate() {
+ return orderDate;
+ }
+ /**
+ * @param orderDate The orderDate to set.
+ */
+ public void setOrderDate(Calendar orderDate) {
+ this.orderDate = orderDate;
+ }
+ /**
+ * @return Returns the orderId.
+ */
+ public String getOrderId() {
+ return orderId;
+ }
+ /**
+ * @param orderId The orderId to set.
+ */
+ public void setOrderId(String orderId) {
+ this.orderId = orderId;
+ }
+ /**
+ * @return Returns the statusCode.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+ /**
+ * @param statusCode The statusCode to set.
+ */
+ public void setStatusCode(String statusCode) {
+ this.statusCode = statusCode;
+ }
+ /**
+ * @return Returns the tax.
+ */
+ public double getTax() {
+ return tax;
+ }
+ /**
+ * @param tax The tax to set.
+ */
+ public void setTax(double tax) {
+ this.tax = tax;
+ }
+ /**
+ * @return Returns the totalAmount.
+ */
+ public double getTotalAmount() {
+ return totalAmount;
+ }
+ /**
+ * @param totalAmount The totalAmount to set.
+ */
+ public void setTotalAmount(double totalAmount) {
+ this.totalAmount = totalAmount;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return orderId + ", " + (orderDate == null?null:orderDate.getTime()) + ", " + statusCode + ", " + netAmount + ", " + totalAmount + ", " + tax + ", ";
+ }
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/OrderItem.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/OrderItem.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/OrderItem.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,114 @@
+/*
+ * 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.store;
+
+import java.io.Serializable;
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class OrderItem implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ // <OrderLine position="1" quantity="1">
+ // <Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+ // </OrderLine>
+ private int position;
+ private int quantity;
+ private String productId;
+ private String title;
+ private double price;
+
+ /**
+ * @return Returns the position.
+ */
+ public int getPosition() {
+ return position;
+ }
+ /**
+ * @param position The position to set.
+ */
+ public void setPosition(int position) {
+ //System.out.println("**** position: " + position);
+ this.position = position;
+ }
+ /**
+ * @return Returns the price.
+ */
+ public double getPrice() {
+ return price;
+ }
+ /**
+ * @param price The price to set.
+ */
+ public void setPrice(double price) {
+ //System.out.println("**** price: " + price);
+ this.price = price;
+ }
+ /**
+ * @return Returns the productId.
+ */
+ public String getProductId() {
+ return productId;
+ }
+ /**
+ * @param productId The productId to set.
+ */
+ public void setProductId(String productId) {
+ this.productId = productId;
+ }
+ /**
+ * @return Returns the quantity.
+ */
+ public int getQuantity() {
+ return quantity;
+ }
+ /**
+ * @param quantity The quantity to set.
+ */
+ public void setQuantity(int quantity) {
+ this.quantity = quantity;
+ }
+ /**
+ * @return Returns the title.
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title The title to set.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return position + "," + quantity + "," + productId + "," + title + "," + price;
+
+ }
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/StoreAction.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/StoreAction.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/src/org/jboss/soa/esb/store/StoreAction.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,71 @@
+/*
+ * 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.store;
+
+import java.util.List;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Store action.
+ * <p/>
+ * This action uses bean value objects that were prepopulated by Smooks in an earlier action on the pipline.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class StoreAction extends AbstractActionPipelineProcessor {
+
+ public StoreAction(ConfigTree configTree) { }
+
+ public Message process(Message message) throws ActionProcessingException {
+
+ StringBuffer results = new StringBuffer();
+ // "order", "customer", "orderItem" is set in the smooks config file: from-dvdstore.xml
+ OrderHeader header = (OrderHeader) message.getBody().get("orderHeader");
+ Customer customer = (Customer) message.getBody().get("customer");
+ List orderItems = (List) message.getBody().get("orderItemList");
+ // System.out.println("************************\n\n");
+ // System.out.println(header.toString());
+ // System.out.println(customer.toString());
+ // System.out.println(orderItems.toString());
+ // System.out.println("************************\n\n");
+ results.append("Demonstrates Smooks ability to rip the XML into Objects\n");
+ results.append("********** StoreAction - Order Value Objects Populated ***********\n");
+ results.append("Header: " + header + "\n");
+ results.append("Customer: " + customer + "\n");
+ if(orderItems != null) {
+ results.append("Order Items (" + orderItems.size() + "):\n");
+ for(int i = 0; i < orderItems.size(); i++) {
+ results.append("\t" + i + ": " + orderItems.get(i) + "\n");
+ }
+ }
+ results.append("\n****************************************************************** ");
+ message.getBody().add("OrderHeader",header);
+ message.getBody().add("Customer",customer);
+ message.getBody().add("OrderItems",orderItems);
+ // Take this "parsed" and reformatted output
+ message.getBody().add(results.toString());
+ return message;
+ }
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/transforms/from-dvdstore.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/transforms/from-dvdstore.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/transforms/from-dvdstore.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,42 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+ xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
+ default-target-profile="from:dvdstore">
+
+ <!-- Populate the OrderHeader -->
+ <jb:bean beanId="orderHeader" class="org.jboss.soa.esb.store.OrderHeader" createOnElement="order">
+ <jb:value property="orderId" data="Order/@orderId" />
+ <jb:value property="orderDate" data="Order/@orderDate" decoder="Calendar">
+ <jb:decodeParam name="format">EEE MMM dd HH:mm:ss z yyyy</jb:decodeParam>
+ <jb:decodeParam name="locale-language">en</jb:decodeParam>
+ <jb:decodeParam name="locale-country">US</jb:decodeParam>
+ </jb:value>
+ <jb:value property="statusCode" data="Order/@statusCode" />
+ <jb:value property="netAmount" data="Order/@netAmount" />
+ <jb:value property="totalAmount" data="Order/@totalAmount" />
+ <jb:value property="tax" data="Order/@tax" />
+ </jb:bean>
+
+ <!-- Populate the Customer -->
+ <jb:bean beanId="customer" class="org.jboss.soa.esb.store.Customer" createOnElement="customer">
+ <jb:value property="userName" data="customer/@userName" />
+ <jb:value property="firstName" data="customer/@firstName" />
+ <jb:value property="lastName" data="customer/@lastName" />
+ <jb:value property="state" data="customer/@state" />
+ </jb:bean>
+
+ <!-- Populate the OrderItem list -->
+ <jb:bean beanId="orderItemList" class="java.util.ArrayList" createOnElement="orderlines">
+ <jb:wiring beanIdRef="orderItem" />
+ </jb:bean>
+
+ <!-- Populate the OrderItem instance -->
+ <jb:bean beanId="orderItem" class="org.jboss.soa.esb.store.OrderItem" createOnElement="orderlines/orderline">
+ <jb:value property="position" data="orderline/@position" />
+ <jb:value property="quantity" data="orderline/@quantity" />
+ <jb:value property="productId" data="orderline/product/@productId" />
+ <jb:value property="title" data="orderline/product/@title" />
+ <jb:value property="price" data="orderline/product/@price" />
+ </jb:bean>
+
+</smooks-resource-list>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/transforms/from-petstore.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/transforms/from-petstore.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/atom_publisher2/transforms/from-petstore.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,40 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
+ xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
+ default-target-profile="from:petstore">
+
+ <!-- Populate the OrderHeader -->
+ <jb:bean beanId="orderHeader" class="org.jboss.soa.esb.store.OrderHeader" createOnElement="order">
+ <jb:value property="orderId" data="Order/@orderId" />
+ <jb:value property="orderDate" data="Order/@orderDate" decoder="Calendar">
+ <jb:decodeParam name="format">EEE MMM dd HH:mm:ss z yyyy</jb:decodeParam>
+ <jb:decodeParam name="locale-language">en</jb:decodeParam>
+ <jb:decodeParam name="locale-country">US</jb:decodeParam>
+ </jb:value>
+ <jb:value property="statusCode" data="Order/@status" />
+ <jb:value property="totalAmount" data="Order/@totalPrice" />
+ </jb:bean>
+
+ <!-- Populate the Customer -->
+ <jb:bean beanId="customer" class="org.jboss.soa.esb.store.Customer" createOnElement="order">
+ <jb:value property="userName" data="order/@userName" />
+ <jb:value property="firstName" data="order/@shipToFirstName" />
+ <jb:value property="lastName" data="order/@shipToLastName" />
+ <jb:value property="state" data="order/@shipState" />
+ </jb:bean>
+
+ <!-- Populate the OrderItem list -->
+ <jb:bean beanId="orderItemList" class="java.util.ArrayList" createOnElement="LineItems">
+ <jb:wiring beanIdRef="orderItem" />
+ </jb:bean>
+
+ <!-- Populate the OrderItem instance -->
+ <jb:bean beanId="orderItem" class="org.jboss.soa.esb.store.OrderItem" createOnElement="LineItems/LineItem">
+ <jb:value property="position" data="LineItem/@lineNumber" />
+ <jb:value property="quantity" data="LineItem/@quantity" />
+ <jb:value property="productId" data="LineItem/Item/@itemId" />
+ <jb:value property="price" data="LineItem/Item/@listPrice" />
+ <jb:value property="title" data="LineItem/Item/@name" />
+ </jb:bean>
+
+</smooks-resource-list>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/.classpath
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/.classpath (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/.classpath 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/.project
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/.project (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/.project 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>basic_cep</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/FruitCup.drl
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/FruitCup.drl (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/FruitCup.drl 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,21 @@
+package org.jboss.soa.esb.services.rules
+import org.jboss.soa.esb.message.Message;
+
+import org.jboss.soa.esb.samples.quickstart.basic_cep.Apple;
+
+global org.jboss.soa.esb.message.Message message;
+
+declare Apple
+ @role( event )
+ @expires( 5s )
+end
+
+
+rule "Grand Apple Total Over Last 5 secs"
+when
+ $total : Number() from accumulate(
+ Apple ( $count : amount ) over window:time( 5s ) from entry-point "FruitCupEntryPoint",
+ sum( $count ) )
+then
+ System.out.println("Rules Found Total Apples in last 5 secs: " + $total);
+end
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/build.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/build.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/build.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,12 @@
+<project name="Quickstart_basic_cep" default="run"
+ basedir=".">
+
+ <description>${ant.project.name} ${line.separator}</description>
+
+ <property name="additional.deploys" value="FruitCup.drl,scripts/**" />
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml" />
+
+
+</project>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/deployment.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/deployment.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,5 @@
+<jbossesb-deployment>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_Basic_CEP_ESB</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_Basic_CEP_ESB_reply</depends>
+</jbossesb-deployment>
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jbm-queue-service.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_Basic_CEP_ESB"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_Basic_CEP_ESB_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jboss-esb.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,45 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_Basic_CEP_ESB"
+ />
+ </jms-bus>
+ </jms-provider>
+ </providers>
+ <services>
+ <service category="MyGroovy"
+ name="ACustomService"
+ description="EPR Description" >
+ <listeners>
+ <groovy-listener name="groovy-client" script="MessageInjectionConsole" is-gateway="true" />
+ <jms-listener name="ESBListener"
+ busidref="quickstartEsbChannel"/>
+ </listeners>
+ <actions mep="RequestResponse">
+ <action name="greeting2" class="org.jboss.soa.esb.samples.quickstart.basic_cep.MyAction"/>
+ <action name="print_action" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="false" />
+ <property name="message" value="After MyAction" />
+ </action>
+
+
+ <action class="org.jboss.soa.esb.actions.BusinessRulesProcessor"
+ name="FruitCup">
+ <property name="ruleSet" value="FruitCup.drl" />
+ <property name="ruleReload" value="false" />
+ <property name="stateful" value="true" />
+ <property name="object-paths">
+ <object-path esb="body.TheApple" entry-point="FruitCupEntryPoint" />
+ </property>
+ </action>
+
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jbossesb-properties.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool-size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jndi.properties
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jndi.properties (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/jndi.properties 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/juddi.properties
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/juddi.properties (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/juddi.properties 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/log4j.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/log4j.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | 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"/>
+
+ <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="INFO"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/readme.txt
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/readme.txt (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/readme.txt 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,33 @@
+Overview:
+=========
+ The purpose of the groovy_gateway quickstart example is to demonstrate
+ the a service that has its message fed to it via a GUI console. This example
+ includes a simple Groovy-based console that is automatically invoked when
+ the example executes. You can then send in messages sync or asych.
+
+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. Switch back to Application Server console to see the output from the ESB
+ 3. The Message Injection Console will pop up automatically, enter some text and hit Send.
+ 4. In this folder ("Window1"), type 'ant undeploy'.
+
+Things to Consider:
+===================
+ This is a fairly standard jboss-esb.xml with fairly basic Action classes. The
+ trick is this line in jboss-esb.xml
+ <groovy-listener name="groovy-client" script="/scripts/MessageInjectionConsole.groovy" is-gateway="true" />
+ Note: the MessageInjectionConsole.groovy will likely move to an "internal" JBoss ESB jar and out of
+ this particular project.
+ The Groovy listener will execute any Groovy script upon service boot up. It is expected into inject a message
+ into the action pipeline.
+
+ This example is a nice tool for you to use to be able to interactive test your action chains.
+
+ Note: if you accidently close the Message Injection Console window, you might need to restart the component,
+ not the entire ESB, just the .esb.
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/scripts/MessageInjectionConsole.groovy
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/scripts/MessageInjectionConsole.groovy (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/scripts/MessageInjectionConsole.groovy 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+import groovy.swing.SwingBuilder
+import java.awt.*
+
+/**
+ * Simple Groovy Gateway script that starts a Swing form through which you can
+ * inject messages into the target service. Useful for testing and prototyping.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+
+def targetService = "Target Service: " + deliveryAdapter.getDeliveryAdapter().getServiceCategory() + ":" + deliveryAdapter.getDeliveryAdapter().getServiceName()
+def numRows = 7
+def numCols = 50
+
+swing = new SwingBuilder()
+sendMessage = swing.action(name:'SendMessage', closure:this.&sendMessageToTarget, mnemonic:'R')
+
+frame = swing.frame(title:'Message Injection Console', size:[600,400], location:[200,200]) {
+ panel(layout:new BorderLayout()) {
+ panel(layout:new BorderLayout(), constraints: BorderLayout.NORTH) {
+ label(text: targetService, constraints: BorderLayout.NORTH)
+ label(text: 'Message In:', constraints: BorderLayout.WEST)
+ textArea(id:'messageInTB', columns: numCols, rows: numRows, constraints: BorderLayout.EAST)
+ }
+ panel(layout:new FlowLayout()) {
+ button(text: 'Send Message', action:sendMessage)
+ comboBox(id: 'synchasync', items:["Asynchronous", "Synchronous"], selectedIndex:0);
+ }
+ panel(layout:new BorderLayout(), constraints: BorderLayout.SOUTH) {
+ label(text: 'Message Out:', constraints: BorderLayout.WEST)
+ textArea(id: 'messageOutTB', columns: numCols, rows: numRows, constraints: BorderLayout.EAST)
+ }
+ }
+}
+frame.pack()
+frame.show()
+
+def sendMessageToTarget(event) {
+ swing.messageOutTB.text = ""
+ if(swing.synchasync.selectedIndex == 0) {
+ deliveryAdapter.deliverAsync(swing.messageInTB.text)
+ } else {
+ swing.messageOutTB.text = deliveryAdapter.deliverSync(swing.messageInTB.text, 20000)
+ }
+}
+
+// Wait until the gateway is told to shutdown....
+while(!gateway.waitUntilStopping(500)) {
+}
+
+frame.dispose()
\ No newline at end of file
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Apple.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Apple.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Apple.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -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-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.basic_cep;
+import java.io.Serializable;
+
+public class Apple implements Serializable{
+ private String name;
+ private int amount;
+ public Apple(String name) {
+ this.name = name;
+ amount = 1;
+ }
+ public int getAmount() {
+ return amount;
+ }
+ public void setAmount(int newAmount) {
+ this.amount = newAmount;
+ }
+
+}
\ No newline at end of file
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/MyAction.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/MyAction.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/MyAction.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,51 @@
+/*
+ * 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.samples.quickstart.basic_cep;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.body.content.BytesBody;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+
+public class MyAction extends AbstractActionLifecycle
+{
+
+ public Message process(Message message) throws ActionProcessingException {
+ String content = (String) message.getBody().get();
+ System.out.println("Received: " + content);
+
+ Apple myApple = new Apple("MyApple");
+ myApple.setAmount(Integer.parseInt(content));
+ message.getBody().add("Added a " + content);
+ message.getBody().add("TheApple",myApple);
+ // response
+ return message;
+ }
+
+
+ protected ConfigTree _config;
+
+ public MyAction(ConfigTree config) { _config = config; }
+
+
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Orange.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Orange.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Orange.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,31 @@
+/*
+ * 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.samples.quickstart.basic_cep;
+
+public class Orange {
+ private String name;
+ public int amount;
+ public Orange(String name) {
+ this.name = name;
+ amount = 1;
+ }
+
+}
\ No newline at end of file
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Thing.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Thing.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/basic_cep/src/org/jboss/soa/esb/samples/quickstart/basic_cep/Thing.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,31 @@
+/*
+ * 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.samples.quickstart.basic_cep;
+
+public class Thing {
+ private String name;
+ public int amount;
+ public Thing(String name) {
+ this.name = name;
+ amount = 1;
+ }
+
+}
\ No newline at end of file
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/build.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/build.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/build.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,12 @@
+<project name="Quickstart_infinispanDemo" default="run"
+ basedir=".">
+
+ <description>${ant.project.name} ${line.separator}</description>
+
+ <property name="additional.deploys" value="scripts/**" />
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml" />
+
+
+</project>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/deployment.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/deployment.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,5 @@
+<jbossesb-deployment>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_infinispanDemo_ESB</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_infinispanDemo_ESB_reply</depends>
+</jbossesb-deployment>
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jbm-queue-service.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_infinispanDemo_ESB"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_infinispanDemo_ESB_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jboss-esb.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,33 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_infinispanDemo_ESB"
+ />
+ </jms-bus>
+ </jms-provider>
+ </providers>
+ <services>
+ <service category="infinispanDemo"
+ name="ACustomService"
+ description="EPR Description" >
+ <listeners>
+ <groovy-listener name="groovy-client" script="/scripts/MessageInjectionConsole.groovy" is-gateway="true" />
+ <jms-listener name="ESBListener"
+ busidref="quickstartEsbChannel"/>
+ </listeners>
+ <actions mep="RequestResponse">
+ <action name="greeting2" class="org.jboss.soa.esb.samples.quickstart.infinispandemo.MyAction"/>
+ <action name="print_action" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="false" />
+ <property name="message" value="After MyAction" />
+ </action>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jbossesb-properties.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool-size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jndi.properties
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jndi.properties (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/jndi.properties 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/juddi.properties
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/juddi.properties (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/juddi.properties 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/infinispan-core.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/infinispan-core.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jaxb-api-2.1.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jaxb-api-2.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jaxb-impl-2.1.3.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jaxb-impl-2.1.3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jboss-common-core-2.2.14.GA.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jboss-common-core-2.2.14.GA.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jboss-logging-spi-2.1.0.GA.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jboss-logging-spi-2.1.0.GA.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jboss-transaction-api-1.0.1.GA.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jboss-transaction-api-1.0.1.GA.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jcip-annotations-1.0.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jcip-annotations-1.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jgroups-2.8.0.CR1.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/jgroups-2.8.0.CR1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/log4j-1.2.14.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/log4j-1.2.14.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/marshalling-api-1.2.0.CR3.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/marshalling-api-1.2.0.CR3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/river-1.2.0.CR3.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/lib/river-1.2.0.CR3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/log4j.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/log4j.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | 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"/>
+
+ <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="INFO"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/readme.txt
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/readme.txt (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/readme.txt 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,33 @@
+Overview:
+=========
+ The purpose of the groovy_gateway quickstart example is to demonstrate
+ the a service that has its message fed to it via a GUI console. This example
+ includes a simple Groovy-based console that is automatically invoked when
+ the example executes. You can then send in messages sync or asych.
+
+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. Switch back to Application Server console to see the output from the ESB
+ 3. The Message Injection Console will pop up automatically, enter some text and hit Send.
+ 4. In this folder ("Window1"), type 'ant undeploy'.
+
+Things to Consider:
+===================
+ This is a fairly standard jboss-esb.xml with fairly basic Action classes. The
+ trick is this line in jboss-esb.xml
+ <groovy-listener name="groovy-client" script="/scripts/MessageInjectionConsole.groovy" is-gateway="true" />
+ Note: the MessageInjectionConsole.groovy will likely move to an "internal" JBoss ESB jar and out of
+ this particular project.
+ The Groovy listener will execute any Groovy script upon service boot up. It is expected into inject a message
+ into the action pipeline.
+
+ This example is a nice tool for you to use to be able to interactive test your action chains.
+
+ Note: if you accidently close the Message Injection Console window, you might need to restart the component,
+ not the entire ESB, just the .esb.
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/scripts/MessageInjectionConsole.groovy
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/scripts/MessageInjectionConsole.groovy (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/scripts/MessageInjectionConsole.groovy 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+import groovy.swing.SwingBuilder
+import java.awt.*
+
+/**
+ * Simple Groovy Gateway script that starts a Swing form through which you can
+ * inject messages into the target service. Useful for testing and prototyping.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+
+def targetService = "Target Service: " + deliveryAdapter.getDeliveryAdapter().getServiceCategory() + ":" + deliveryAdapter.getDeliveryAdapter().getServiceName()
+def numRows = 3
+def numCols = 30
+
+swing = new SwingBuilder()
+sendMessage = swing.action(name:'SendMessage', closure:this.&sendMessageToTarget, mnemonic:'R')
+
+frame = swing.frame(title:'Message Injection Console2', size:[600,400], location:[200,200]) {
+ panel(layout:new BorderLayout()) {
+ panel(layout:new BorderLayout(), constraints: BorderLayout.NORTH) {
+ label(text: targetService, constraints: BorderLayout.NORTH)
+ label(text: 'Message In:', constraints: BorderLayout.WEST)
+ textArea(id:'messageInTB', columns: numCols, rows: numRows, constraints: BorderLayout.EAST, font: new Font('Monospaced',Font.PLAIN,20))
+ }
+ panel(layout:new FlowLayout()) {
+ button(text: 'Send Message', action:sendMessage)
+ comboBox(id: 'synchasync', items:["Asynchronous","Synchronous"], selectedIndex:1);
+ }
+ panel(layout:new BorderLayout(), constraints: BorderLayout.SOUTH) {
+ label(text: 'Message Out:', constraints: BorderLayout.WEST)
+ textArea(id: 'messageOutTB', columns: numCols, rows: numRows, constraints: BorderLayout.EAST, font: new Font('Monospaced',Font.PLAIN,20))
+ }
+ }
+}
+frame.pack()
+frame.show()
+
+def sendMessageToTarget(event) {
+ swing.messageOutTB.text = ""
+ if(swing.synchasync.selectedIndex == 0) {
+ deliveryAdapter.deliverAsync(swing.messageInTB.text)
+ } else {
+ swing.messageOutTB.text = deliveryAdapter.deliverSync(swing.messageInTB.text, 20000)
+ }
+}
+
+// Wait until the gateway is told to shutdown....
+while(!gateway.waitUntilStopping(500)) {
+}
+
+frame.dispose()
\ No newline at end of file
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/jboss/soa/esb/samples/quickstart/infinispandemo/MyAction.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/jboss/soa/esb/samples/quickstart/infinispandemo/MyAction.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/infinispanDemo/src/org/jboss/soa/esb/samples/quickstart/infinispandemo/MyAction.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,93 @@
+/*
+ * 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.samples.quickstart.infinispandemo;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.body.content.BytesBody;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.CacheManager;
+import org.infinispan.Cache;
+import org.infinispan.config.GlobalConfiguration;
+import org.infinispan.config.Configuration;
+import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
+
+public class MyAction extends AbstractActionPipelineProcessor
+{
+ CacheManager manager = null;
+ Cache cache = null;
+ GlobalConfiguration gc = null;
+ Configuration c = null;
+
+ public void initialise() throws ActionLifecycleException {
+ System.out.println("\n initialise");
+ gc = new GlobalConfiguration();
+ gc.setTransportClass(JGroupsTransport.class.getName());
+ gc.setClusterName("Infinispan_ESB_Demo");
+ c = new Configuration();
+ c.setCacheMode(Configuration.CacheMode.DIST_SYNC);
+ // c.setL1CacheEnabled(true);
+ // c.setL1Lifespan(60000);
+ // c.setRehashRpcTimeout(60000);
+ // c.setNumOwners(2);
+ manager = new DefaultCacheManager(gc,c);
+ cache = manager.getCache();
+ }
+ public void destroy() throws ActionLifecycleException {
+ System.out.println("\n destroy");
+
+ }
+ public Message process(Message message) throws ActionProcessingException {
+ String content = (String) message.getBody().get();
+ System.out.println("Received: " + content);
+ String[] keyvalue = new String[2];
+
+ String results;
+ // if the content is something:somethingelse we assume put
+ if (content.indexOf(":") > 0) {
+ keyvalue = content.split(":");
+ results = keyvalue[0] + "=" + keyvalue[1];
+ cache.put(keyvalue[0], keyvalue[1]);
+ System.out.println("Added: " + results);
+ } else { // we assume get and the content is the key
+ if (!cache.containsKey(content)) {
+ results = "Key='"+content + "' not found in cache";
+ } else {
+ results = "Found: '" + cache.get(content) + "' bound to '" + content +"'";
+ }
+ }
+
+ System.out.println("Returning: " + results);
+ message.getBody().add(results);
+ return message;
+ }
+
+
+ protected ConfigTree _config;
+
+ public MyAction(ConfigTree config) { _config = config; }
+
+
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/.classpath
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/.classpath (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/.classpath 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="lib/swing-layout-1.0.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/.project
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/.project (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/.project 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>simple_cep</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/OrderCount.drl
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/OrderCount.drl (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/OrderCount.drl 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,40 @@
+package org.jboss.soa.esb.services.rules
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.samples.quickstart.simple_cep.dvdstore.OrderHeader;
+import org.jboss.soa.esb.samples.quickstart.simple_cep.RulesCallbackInvoker;
+
+global org.jboss.soa.esb.message.Message message;
+
+declare OrderHeader
+ @role( event )
+ @expires( 15s )
+end
+
+rule "Grand Order Total Over Last 15 Seconds"
+when
+ $total : Number() from accumulate(
+ OrderHeader( $orderTotal : totalAmount ) over window:time( 15s ) from entry-point "OrderEntryPoint",
+ sum( $orderTotal ) )
+then
+ System.out.println("Total in the last 15 Seconds: " + $total);
+end
+
+rule "Grand Order Total Over Last 15 Seconds Exceeds $150"
+when
+ $total : Number(intValue >= 150) from accumulate(
+ OrderHeader( $orderTotal : totalAmount ) over window:time( 15s ) from entry-point "OrderEntryPoint",
+ sum( $orderTotal ) )
+then
+ System.out.println("15 Seconds Total GREATER than $150: " + $total);
+ RulesCallbackInvoker.send("Orders Over $150");
+end
+
+rule "Grand Order Total Over Last 15 Seconds Below $150"
+when
+ $total : Number(intValue < 150) from accumulate(
+ OrderHeader( $orderTotal : totalAmount ) over window:time( 15s ) from entry-point "OrderEntryPoint",
+ sum( $orderTotal ) )
+then
+ System.out.println("15 Seconds Total LESS than $150: " + $total);
+end
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/SampleOrder1.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/SampleOrder1.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/SampleOrder1.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,12 @@
+<Order xmlns="http://org.jboss.soa.esb/Order" orderId="1" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="2"
+netAmount="59.97" totalAmount="64.92" tax="4.95">
+ <Customer userName="user1" firstName="Harry" lastName="Fletcher" state="SD"/>
+ <OrderLines>
+ <OrderLine position="1" quantity="1">
+ <Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+ </OrderLine>
+ <OrderLine position="2" quantity="1">
+ <Product productId="299" title="Pulp Fiction" price="29.99"/>
+ </OrderLine>
+ </OrderLines>
+</Order>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/SampleOrder2.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/SampleOrder2.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/SampleOrder2.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,9 @@
+<Order xmlns="http://org.jboss.soa.esb/Order" orderId="2" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="2"
+netAmount="59.97" totalAmount="34.94" tax="4.95">
+ <Customer userName="user1" firstName="Harry" lastName="Fletcher" state="SD"/>
+ <OrderLines>
+ <OrderLine position="2" quantity="1">
+ <Product productId="299" title="Pulp Fiction" price="29.99"/>
+ </OrderLine>
+ </OrderLines>
+</Order>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/build.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/build.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/build.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,41 @@
+<project name="Quickstart_simple_cep" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="additional.deploys" value="OrderCount.drl,smooks-res.xml"/>
+ <property name="deploy.exploded" value="true"/>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+
+ <target name="runtest" depends="compile"
+ description="will receive JMS message to tigger the actions in the ESB">
+ <echo>Runs Test JMS Sender</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.simple_cep.test.SendJMSMessage" failonerror="true">
+ <arg value="SampleOrder1.xml"/>
+ <classpath refid="exec-classpath" />
+ </java>
+ </target>
+ <target name="runtest2" depends="compile"
+ description="will receive JMS message to tigger the actions in the ESB">
+ <echo>Runs Test JMS Sender</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.simple_cep.test.SendJMSMessage" failonerror="true">
+ <arg value="SampleOrder2.xml"/>
+ <classpath refid="exec-classpath" />
+ </java>
+ </target>
+
+ <target name="startMonitor" depends="compile" description="Monitors Alerts">
+ <echo>Starting the Swing-based Service Monitor</echo>
+ <java fork="yes" classname="ServiceAlertMonitor" failonerror="true">
+ <arg value="Monitor"/>
+ <arg value="quickstart_Simple_CEP_monitor"/>
+ <arg value="images/gear1.gif"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+</project>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/deployment.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/deployment.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=smooks.esb</depends>
+ <depends>jboss.esb:deployment=jbrules.esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_Simple_CEP_Request_GW</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_Simple_CEP_Request_ESB</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_Simple_CEP_Callback_ESB</depends>
+</jbossesb-deployment>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/images/gear1.gif
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/images/gear1.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jbm-queue-service.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_Simple_CEP_Request_GW"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_Simple_CEP_Request_ESB"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_Simple_CEP_Callback_ESB"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_Simple_CEP_monitor"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ </server>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jboss-esb.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,117 @@
+<?xml version="1.0"?>
+<jbossesb
+ xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+ <providers>
+
+ <fs-provider name="FileSystemProvider">
+ <fs-bus busid="inboundOrderChannel">
+ <fs-message-filter
+ directory="C:\tmp\inboundOrders\CEP"
+ error-delete="false"
+ error-suffix=".error"
+ error-directory="C:\tmp\inboundOrders\CEP"
+ input-suffix=".xml"
+ post-delete="false"
+ post-suffix=".done"
+ post-directory="C:\tmp\inboundOrders\CEP"
+ work-suffix=".working"/>
+ </fs-bus>
+
+ <fs-bus busid="inboundOrderChannelESB">
+ <fs-message-filter directory="C:\tmp\inboundOrders\CEP"
+ error-delete="false" error-suffix=".esberror"
+ input-suffix=".xml.esb" post-delete="true" post-suffix=".esbdone"
+ post-directory="C:\tmp\inboundOrders\CEP"
+ work-suffix=".esbworking"/>
+ </fs-bus>
+ </fs-provider>
+ <jms-provider connection-factory="ConnectionFactory" name="JBossMQ">
+ <jms-bus busid="quickstartGwChannel">
+ <jms-message-filter
+ dest-name="queue/quickstart_Simple_CEP_Request_GW" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-name="queue/quickstart_Simple_CEP_Request_ESB" dest-type="QUEUE"/>
+ </jms-bus>
+ <jms-bus busid="quickstartCallbackEsbChannel">
+ <jms-message-filter
+ dest-name="queue/quickstart_Simple_CEP_Callback_ESB" dest-type="QUEUE"/>
+ </jms-bus>
+ </jms-provider>
+ </providers>
+ <services>
+ <service category="Simple_CEPServices_ESB"
+ description="The Main Entry Point" name="Simple_CEP_Service_ESB">
+ <listeners>
+ <jms-listener busidref="quickstartGwChannel" is-gateway="true" name="TheGateway"/>
+ <jms-listener busidref="quickstartEsbChannel" name="MainESBChannel"/>
+ </listeners>
+ <actions mep="OneWay">
+ <action class="org.jboss.soa.esb.actions.SystemPrintln" name="print_action">
+ <property name="message" value="INBOUND DATA"/>
+ <property name="printfull" value="false"/>
+ </action>
+ <action
+ class="org.jboss.soa.esb.actions.converters.SmooksTransformer" name="transform">
+ <property name="resource-config" value="/smooks-res.xml"/>
+ </action>
+ <action
+ class="org.jboss.soa.esb.samples.quickstart.simple_cep.SetupMessage" name="fixUpMessage"/>
+ <action class="org.jboss.soa.esb.actions.BusinessRulesProcessor" name="OrderCountHistory">
+ <property name="ruleSet" value="OrderCount.drl"/>
+ <property name="ruleReload" value="true"/>
+ <property name="stateful" value="true"/>
+ <property name="object-paths">
+ <object-path entry-point="OrderEntryPoint" esb="body.TheOrderHeader"/>
+ </property>
+ </action>
+ </actions>
+ </service>
+ <service category="Simple_CEPServices_ESB"
+ description="File System Poller" name="FileSystemInputOrders">
+ <listeners>
+ <fs-listener name="inboundOrderChannelGatewayListener"
+ busidref="inboundOrderChannel"
+ is-gateway="true"
+ poll-frequency-seconds="1"/>
+ <fs-listener name="inboundOrderChannelESBListener"
+ busidref="inboundOrderChannelESB" />
+ </listeners>
+ <actions mep="OneWay">
+ <action class="org.jboss.soa.esb.actions.StaticRouter" name="routeAction">
+ <property name="destinations">
+ <route-to service-category="Simple_CEPServices_ESB" service-name="Simple_CEP_Service_ESB"/>
+ </property>
+ </action>
+ </actions>
+ </service>
+
+ <service category="Simple_CEPServices_ESB" name="RulesCallBack"
+ description="Called when Rules find something interesting">
+ <listeners>
+ <jms-listener busidref="quickstartCallbackEsbChannel" name="CallbackESBChannel"/>
+ </listeners>
+ <actions mep="OneWay">
+ <action class="org.jboss.soa.esb.actions.SystemPrintln" name="print_action">
+ <property name="message" value="Callback DATA"/>
+ <property name="printfull" value="false"/>
+ </action>
+ <action name="notificationAction"
+ class="org.jboss.soa.esb.actions.Notifier">
+ <property name="okMethod" value="notifyOK" />
+ <property name="notification-details">
+ <NotificationList type="OK">
+ <target class="NotifyQueues">
+ <messageProp name="quickstart" value="quickstart_Simple_CEP_monitor"/>
+ <queue jndiName="queue/quickstart_Simple_CEP_monitor">
+ </queue>
+ </target>
+ </NotificationList>
+ </property>
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jbossesb-properties.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool-size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jndi.properties
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jndi.properties (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/jndi.properties 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/juddi.properties
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/juddi.properties (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/juddi.properties 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/lib/swing-layout-1.0.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/lib/swing-layout-1.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/listener.log
===================================================================
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/log4j.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/log4j.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | 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"/>
+
+ <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="org.milyn">
+ <priority value="ERROR"/>
+ </category>
+
+ <category name="quickstarts">
+ <priority value="ERROR"/>
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/readme.txt
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/readme.txt (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/readme.txt 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,66 @@
+Overview:
+=========
+ This example has three "teams" of order processors. All new orders that flow
+ into the system are evaluated via the rules engine. These routing rules will
+ determine which team receives the order for actually processing. In the case
+ of the green team, the order is first transformed to a different format prior
+ to routing.
+ This quickstart also show how namepaces can be used with xpath expressions.
+
+
+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. In a command terminal window in this folder ("Window2"), type
+ 'ant receiveBlue'.
+ 3. In a command terminal window in this folder ("Window3"), type
+ 'ant receiveRed'.
+ 4. In a command terminal window in this folder ("Window4"), type
+ 'ant receiveGreen'.
+ 5. In "Window1", type 'ant runtest'.
+ 6. Switch back to the Application Server console, "Window2", "Window3" and
+ "Window4" to see the output from the ESB
+ 7. When finished, interrupt the receivers using Ctrl-C.
+ 8. Undpeloy the esb archive, type 'ant undeploy'.
+
+Things to Consider:
+===================
+ The routing depends on the statusCode attribute in the SampleOrder.xml file.
+ It would be relatively simple to modify this example to include a service
+ (listener & action combination) to introduce "scoring" rules logic that sets
+ the status code of the message prior to sending it on to the CBR.
+
+ Change the statusCode to select another destination
+ 0 - Blue
+ 1 - Red
+ 2 - Green
+
+ Extra Credit: Open FunCBRRules-XPath.drl and change the routes to the following:
+ Blue for statusCode="1"
+ Red for statusCode="0"
+ Green for statusCode="2"
+ Then "ant runtest" again, the rule changes are picked up on-the-fly due to the
+ <property name="ruleReload" value="true"/> on the CBR Action in the jboss-esb.xml
+
+ Extra Credit 2: Open jboss-esb.xml and find the GreenService
+ replace "<!-- Inject the transformer actions here -->"
+ with:
+ <action name="transform" class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+ <property name="resource-config" value="/smooks-res.xml" />
+ </action>
+
+ <action name="convertPOJO2Message" class="org.jboss.soa.esb.dvdstore.DVDStoreAction" />
+ <!-- this will send everything to the console -->
+ <action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="true"/>
+ </action>
+
+ Then "ant runtest". The jboss-esb.xml changes will be picked up automatically assuming
+ you are running with "bootstrapper" via "ant run". If you are running as a .esb archive
+ then you'll need to edit the jboss-esb.xml in the deploy folder of your ESB Server or your
+ Application Server.
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/smooks-res.xml
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/smooks-res.xml (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/smooks-res.xml 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
+
+ <!-- Populate the OrderHeader -->
+ <jb:bean beanId="orderHeader" class="org.jboss.soa.esb.samples.quickstart.simple_cep.dvdstore.OrderHeader" createOnElement="order">
+ <jb:value property="orderId" data="Order/@orderId" />
+ <jb:value property="orderDate" data="Order/@orderDate" decoder="Calendar">
+ <jb:decodeParam name="format">EEE MMM dd HH:mm:ss z yyyy</jb:decodeParam>
+ <jb:decodeParam name="locale-language">en</jb:decodeParam>
+ <jb:decodeParam name="locale-country">US</jb:decodeParam>
+ </jb:value>
+ <jb:value property="statusCode" data="Order/@statusCode" />
+ <jb:value property="netAmount" data="Order/@netAmount" />
+ <jb:value property="totalAmount" data="Order/@totalAmount" />
+ <jb:value property="tax" data="Order/@tax" />
+ <jb:wiring property="customer" beanIdRef="customer"/>
+ </jb:bean>
+
+ <!-- Populate the Customer -->
+ <jb:bean beanId="customer" class="org.jboss.soa.esb.samples.quickstart.simple_cep.dvdstore.Customer" createOnElement="customer">
+ <jb:value property="userName" data="customer/@userName" />
+ <jb:value property="firstName" data="customer/@firstName" />
+ <jb:value property="lastName" data="customer/@lastName" />
+ <jb:value property="state" data="customer/@state" />
+ </jb:bean>
+
+ <!-- Populate the OrderItem list -->
+ <jb:bean beanId="orderItemList" class="java.util.ArrayList" createOnElement="orderlines">
+ <jb:wiring beanIdRef="orderItem" />
+ </jb:bean>
+
+ <!-- Populate the OrderItem instance -->
+ <jb:bean beanId="orderItem" class="org.jboss.soa.esb.samples.quickstart.simple_cep.dvdstore.OrderItem" createOnElement="orderlines/orderline">
+ <jb:value property="position" data="orderline/@position" />
+ <jb:value property="quantity" data="orderline/@quantity" />
+ <jb:value property="productId" data="orderline/product/@productId" />
+ <jb:value property="title" data="orderline/product/@title" />
+ <jb:value property="price" data="orderline/product/@price" />
+ </jb:bean>
+
+</smooks-resource-list>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/ServiceAlertMonitor.form
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/ServiceAlertMonitor.form (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/ServiceAlertMonitor.form 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
+ <Properties>
+ <Property name="defaultCloseOperation" type="int" value="3"/>
+ <Property name="title" type="java.lang.String" value="Service Alert Monitor"/>
+ </Properties>
+ <SyntheticProperties>
+ <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ </SyntheticProperties>
+ <Events>
+ <EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosing"/>
+ </Events>
+ <AuxValues>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="jScrollPane1" alignment="0" pref="265" max="32767" attributes="0"/>
+ <Component id="jButton1" alignment="0" pref="265" max="32767" attributes="0"/>
+ <Component id="jLabel3" alignment="0" pref="265" max="32767" attributes="0"/>
+ <Component id="jLabel1" alignment="0" pref="265" max="32767" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel1" min="-2" pref="39" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jScrollPane1" min="-2" pref="98" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jLabel3" pref="84" max="32767" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jButton1" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Tahoma" size="18" style="0"/>
+ </Property>
+ <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="cc" green="0" red="0" type="rgb"/>
+ </Property>
+ <Property name="horizontalAlignment" type="int" value="0"/>
+ <Property name="text" type="java.lang.String" value="Service Alert Monitor"/>
+ </Properties>
+ </Component>
+ <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+ <AuxValues>
+ <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+ </AuxValues>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JTextArea" name="textAreaOrderQueue">
+ <Properties>
+ <Property name="columns" type="int" value="20"/>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Arial" size="14" style="0"/>
+ </Property>
+ <Property name="rows" type="int" value="5"/>
+ <Property name="tabSize" type="int" value="2"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Component class="javax.swing.JButton" name="jButton1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Clear"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel3">
+ <Properties>
+ <Property name="horizontalAlignment" type="int" value="0"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+</Form>
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/ServiceAlertMonitor.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/ServiceAlertMonitor.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/ServiceAlertMonitor.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,192 @@
+/*
+ * ServiceAlertMonitor2.java
+ *
+ * Created on November 21, 2006, 12:10 AM
+ */
+import javax.swing.UIManager;
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.jms.JMSException;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueSession;
+import javax.jms.TextMessage;
+import javax.jms.Message;
+import javax.jms.QueueReceiver;
+import javax.jms.MessageListener;
+
+/**
+ *
+ * @author burr
+ */
+public class ServiceAlertMonitor extends javax.swing.JFrame implements MessageListener {
+ InitialContext iniCtx = null;
+ QueueConnectionFactory qcf = null;
+ QueueConnection conn = null;
+ QueueSession receiverSession = null;
+ Queue receiverQueue = null;
+ QueueReceiver queueReceiver = null;
+
+ String imageName = "images/javawork.gif";
+
+ /** Creates new form ServiceAlertMonitor */
+ public ServiceAlertMonitor(String serviceName, String queueName, String imageName) {
+ initComponents();
+ this.jLabel1.setText(serviceName);
+ try {
+ if (iniCtx == null) iniCtx = new InitialContext();
+ if (qcf == null) qcf = (QueueConnectionFactory) iniCtx.lookup("ConnectionFactory");
+ if (conn == null) {
+ conn = qcf.createQueueConnection();
+ conn.start();
+ }
+ String responseQueueName = "queue/" + queueName;
+ this.imageName = imageName;
+ receiverQueue = (Queue) iniCtx.lookup(responseQueueName);
+ receiverSession = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ queueReceiver = receiverSession.createReceiver(receiverQueue);
+ queueReceiver.setMessageListener(this);
+ } catch (Exception e) {
+ System.out.println(e);
+ }
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
+ private void initComponents() {
+ jLabel1 = new javax.swing.JLabel();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ textAreaOrderQueue = new javax.swing.JTextArea();
+ jButton1 = new javax.swing.JButton();
+ jLabel3 = new javax.swing.JLabel();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+ setTitle("Service Alert Monitor");
+ addWindowListener(new java.awt.event.WindowAdapter() {
+ public void windowClosing(java.awt.event.WindowEvent evt) {
+ formWindowClosing(evt);
+ }
+ });
+
+ jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18));
+ jLabel1.setForeground(new java.awt.Color(0, 0, 204));
+ jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+ jLabel1.setText("Service Alert Monitor");
+
+ textAreaOrderQueue.setColumns(20);
+ textAreaOrderQueue.setFont(new java.awt.Font("Arial", 0, 14));
+ textAreaOrderQueue.setRows(5);
+ textAreaOrderQueue.setTabSize(2);
+ jScrollPane1.setViewportView(textAreaOrderQueue);
+
+ jButton1.setText("Clear");
+ jButton1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton1ActionPerformed(evt);
+ }
+ });
+
+ jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+
+ org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .addContainerGap()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE)
+ .add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE)
+ .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE)
+ .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 39, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 98, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jButton1)
+ .addContainerGap())
+ );
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
+ try {
+ if (queueReceiver != null) queueReceiver.close();
+ if (receiverSession != null) receiverSession.close();
+
+ } catch (JMSException e) {
+ System.out.println(e);
+ }
+ }//GEN-LAST:event_formWindowClosing
+
+ boolean on = false;
+ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
+ textAreaOrderQueue.setText("");
+ this.jLabel3.setIcon(null);
+ //this.jLabel3.setVisible(false);
+ }//GEN-LAST:event_jButton1ActionPerformed
+
+
+ public void onMessage(Message msg) {
+ try {
+ String textMessage = ((TextMessage)msg).getText();
+ textAreaOrderQueue.setText(textMessage);
+ java.io.File x = new java.io.File(imageName);
+ System.out.println(x.getAbsolutePath());
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(x.getAbsolutePath()); // animated gif
+ this.jLabel3.setIcon(icon);
+ this.jLabel3.setVisible(true);
+ } catch (Exception e) {
+ System.err.println(e);
+ textAreaOrderQueue.setText("ERROR: " + e.getMessage());
+ }
+ }
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) throws Exception {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ System.out.println(args[0]);
+ final String tempServiceName = args[0];
+ System.out.println(args[1]);
+ final String tempQueueName = args[1];
+ System.out.println(args[2]);
+ final String tempImageName = args[2];
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ ServiceAlertMonitor frame = new ServiceAlertMonitor(tempServiceName,tempQueueName,tempImageName);
+
+ // center the window
+ Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
+ frame.setLocation(d.width/2 - frame.getWidth()/2,
+ d.height/2 - frame.getHeight()/2);
+ frame.setVisible(true);
+ }
+ });
+ }
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton jButton1;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JTextArea textAreaOrderQueue;
+ // End of variables declaration//GEN-END:variables
+
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/MyAction.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/MyAction.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/MyAction.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -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-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.simple_cep;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+
+public class MyAction extends AbstractActionLifecycle
+{
+
+ protected ConfigTree _config;
+
+ public MyAction(ConfigTree config) { _config = config; }
+
+ public Message noOperation(Message message) { return message; }
+
+ public Message displayMessage(Message message) throws Exception{
+ logHeader();
+ System.out.println("Body: " + message.getBody().get());
+ logFooter();
+ return message;
+ }
+
+ public void exceptionHandler(Message message, Throwable exception) {
+ logHeader();
+ System.out.println("!ERROR!");
+ System.out.println(exception.getMessage());
+ System.out.println("For Message: ");
+ System.out.println(message.getBody().get());
+ logFooter();
+ }
+
+
+ // This makes it easier to read on the console
+ private void logHeader() {
+ System.out.println("\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ }
+ private void logFooter() {
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
+ }
+
+
+}
\ No newline at end of file
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/RulesCallbackInvoker.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/RulesCallbackInvoker.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/RulesCallbackInvoker.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -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.samples.quickstart.simple_cep;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+
+public class RulesCallbackInvoker
+{
+ public static void send(String msg) {
+ try {
+ ServiceInvoker invoker = new ServiceInvoker("Simple_CEPServices_ESB","RulesCallBack");
+ Message requestMessage;
+ requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+ requestMessage.getBody().add(msg);
+ invoker.deliverAsync(requestMessage);
+ } catch (MessageDeliverException mde) {
+ System.out.println("Eating this Exception: " + mde);
+ }
+ }
+
+}
\ No newline at end of file
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/SetupMessage.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/SetupMessage.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/SetupMessage.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,74 @@
+/*
+ * 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.samples.quickstart.simple_cep;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.samples.quickstart.simple_cep.dvdstore.Customer;
+import org.jboss.soa.esb.samples.quickstart.simple_cep.dvdstore.OrderHeader;
+
+import java.util.Map;
+
+public class SetupMessage extends AbstractActionPipelineProcessor {
+ private Logger logger = Logger.getLogger(SetupMessage.class);
+ private int status = 0;
+
+ public Message process(Message message) throws ActionProcessingException {
+ Map transformedBeans = (Map) message.getBody().get("EXTRACTED_BEANS_HASH");
+
+ if(transformedBeans != null) {
+ OrderHeader header = (OrderHeader) transformedBeans.get("orderHeader");
+ Customer customer = (Customer) transformedBeans.get("customer");
+ message.getBody().add("TheOrderHeader", header);
+ message.getBody().add("TheCustomer", customer);
+
+ status = header.getStatusCode();
+/*
+ if (status == 0 ) {
+ message.getProperties().setProperty("dispose", false);
+ message.getProperties().setProperty("continue", false);
+
+ }
+
+ if (status == 1 ) {
+ message.getProperties().setProperty("dispose", false);
+ message.getProperties().setProperty("continue", true);
+ }
+
+ if (status == 2 ) {
+ message.getProperties().setProperty("dispose", true);
+ message.getProperties().setProperty("continue", true);
+ }
+*/
+ logger.info("Moved the transformed Order Header and Customer");
+ }
+
+ return message;
+ }
+
+ public SetupMessage(ConfigTree configTree) {
+ // status = Integer.parseInt(configTree.getAttribute("status"));
+ }
+
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/Customer.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/Customer.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/Customer.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,113 @@
+/*
+ * 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.samples.quickstart.simple_cep.dvdstore;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class Customer implements Serializable {
+
+ // <Customer userName="user1" firstName="Harry" lastName="Potter" state="SD"/>
+ private String userName;
+ private String firstName;
+ private String lastName;
+ private String state;
+ private int status;
+ private double orderDiscount;
+
+ /**
+ * @return Returns the firstName.
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+ /**
+ * @param firstName The firstName to set.
+ */
+ public void setFirstName(String firstName) {
+ //System.out.println("**** firstName: " + firstName);
+ this.firstName = firstName;
+ }
+ /**
+ * @return Returns the lastName.
+ */
+ public String getLastName() {
+ return lastName;
+ }
+ /**
+ * @param lastName The lastName to set.
+ */
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+ /**
+ * @return Returns the state.
+ */
+ public String getState() {
+ return state;
+ }
+ /**
+ * @param state The state to set.
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+ /**
+ * @return Returns the userName.
+ */
+ public String getUserName() {
+ return userName;
+ }
+ /**
+ * @param userName The userName to set.
+ */
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return userName + "," + firstName + "," + lastName + "," + state + "," + status;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public double getOrderDiscount() {
+ return this.orderDiscount;
+ }
+
+ public void setOrderDiscount(double orderDiscount) {
+ this.orderDiscount = orderDiscount;
+ }
+
+
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/DVDStoreAction.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/DVDStoreAction.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/DVDStoreAction.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,71 @@
+/*
+ * 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.samples.quickstart.simple_cep.dvdstore;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * DVD Store action.
+ * <p/>
+ * This action uses bean value objects that were prepopulated by Smooks in an earlier action on the pipline.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class DVDStoreAction extends AbstractActionPipelineProcessor {
+
+ public DVDStoreAction(ConfigTree configTree) {
+
+ }
+
+ public Message process(Message message) throws ActionProcessingException {
+ HashMap beanHash = (HashMap) message.getBody().get("EXTRACTED_BEANS_HASH");
+
+ StringBuffer results = new StringBuffer();
+ if(beanHash != null) {
+ OrderHeader header = (OrderHeader) beanHash.get("orderHeader");
+ Customer customer = (Customer) beanHash.get("customer");
+ List orderItems = (List) beanHash.get("orderItemList");
+ results.append("Demonstrates Smooks ability to rip the XML into Objects\n");
+ results.append("********* DVDStoreAction - Order Value Objects Populated *********\n");
+ results.append("Header: " + header + "\n");
+ results.append("Customer: " + customer + "\n");
+ if(orderItems != null) {
+ results.append("Order Items (" + orderItems.size() + "):\n");
+ for(int i = 0; i < orderItems.size(); i++) {
+ results.append("\t" + i + ": " + orderItems.get(i) + "\n");
+ }
+ }
+ results.append("\n****************************************************************** ");
+ } else {
+ results.append("\n*** No beanhash found!");
+ }
+
+ // Take this "parsed" output and make it a new message
+ message.getBody().add("parsed_results",results.toString());
+ return message;
+ }
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/OrderHeader.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/OrderHeader.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/OrderHeader.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,150 @@
+/*
+ * 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.samples.quickstart.simple_cep.dvdstore;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+import java.io.Serializable;
+import java.util.Calendar;
+
+public class OrderHeader implements Serializable {
+
+ // <Order orderId="1" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="0" netAmount="59.97" totalAmount="64.92" tax="4.95">
+ private String orderId;
+ private Calendar orderDate;
+ private int statusCode;
+ private double netAmount;
+ private double totalAmount;
+ private double tax;
+ private int orderPriority = 1;
+ private double orderDiscount;
+
+ private Customer customer;
+
+ /**
+ * @return Returns the netAmount.
+ */
+ public double getNetAmount() {
+ return netAmount;
+ }
+ /**
+ * @param netAmount The netAmount to set.
+ */
+ public void setNetAmount(double netAmount) {
+ // System.out.println("**** netAmount: " + netAmount);
+ this.netAmount = netAmount;
+ }
+ /**
+ * @return Returns the orderDate.
+ */
+ public Calendar getOrderDate() {
+ return orderDate;
+ }
+ /**
+ * @param orderDate The orderDate to set.
+ */
+ public void setOrderDate(Calendar orderDate) {
+ this.orderDate = orderDate;
+ }
+ /**
+ * @return Returns the orderId.
+ */
+ public String getOrderId() {
+ return orderId;
+ }
+ /**
+ * @param orderId The orderId to set.
+ */
+ public void setOrderId(String orderId) {
+ this.orderId = orderId;
+ }
+ /**
+ * @return Returns the statusCode.
+ */
+ public int getStatusCode() {
+ return statusCode;
+ }
+ /**
+ * @param statusCode The statusCode to set.
+ */
+ public void setStatusCode(int statusCode) {
+ this.statusCode = statusCode;
+ }
+ /**
+ * @return Returns the tax.
+ */
+ public double getTax() {
+ return tax;
+ }
+ /**
+ * @param tax The tax to set.
+ */
+ public void setTax(double tax) {
+ this.tax = tax;
+ }
+ /**
+ * @return Returns the totalAmount.
+ */
+ public double getTotalAmount() {
+ return totalAmount;
+ }
+ /**
+ * @param totalAmount The totalAmount to set.
+ */
+ public void setTotalAmount(double totalAmount) {
+ this.totalAmount = totalAmount;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return orderId + ", " + orderDate + ", " + statusCode + ", " + netAmount + ", " + totalAmount + ", " + tax + ", customer=" + customer;
+ }
+
+ public int getOrderPriority() {
+ return this.orderPriority;
+ }
+
+ public void setOrderPriority(int orderPriority) {
+ this.orderPriority = orderPriority;
+ }
+
+ public double getOrderDiscount() {
+ return this.orderDiscount;
+ }
+
+ public void setOrderDiscount(double orderDiscount) {
+ this.orderDiscount = orderDiscount;
+ }
+
+ public Customer getCustomer() {
+ return this.customer;
+ }
+
+ public void setCustomer(Customer customer) {
+ this.customer = customer;
+ }
+
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/OrderItem.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/OrderItem.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/dvdstore/OrderItem.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -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.samples.quickstart.simple_cep.dvdstore;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class OrderItem implements Serializable {
+
+ // <OrderLine position="1" quantity="1">
+ // <Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+ // </OrderLine>
+ private int position;
+ private int quantity;
+ private String productId;
+ private String title;
+ private double price;
+
+ /**
+ * @return Returns the position.
+ */
+ public int getPosition() {
+ return position;
+ }
+ /**
+ * @param position The position to set.
+ */
+ public void setPosition(int position) {
+ //System.out.println("**** position: " + position);
+ this.position = position;
+ }
+ /**
+ * @return Returns the price.
+ */
+ public double getPrice() {
+ return price;
+ }
+ /**
+ * @param price The price to set.
+ */
+ public void setPrice(double price) {
+ //System.out.println("**** price: " + price);
+ this.price = price;
+ }
+ /**
+ * @return Returns the productId.
+ */
+ public String getProductId() {
+ return productId;
+ }
+ /**
+ * @param productId The productId to set.
+ */
+ public void setProductId(String productId) {
+ this.productId = productId;
+ }
+ /**
+ * @return Returns the quantity.
+ */
+ public int getQuantity() {
+ return quantity;
+ }
+ /**
+ * @param quantity The quantity to set.
+ */
+ public void setQuantity(int quantity) {
+ this.quantity = quantity;
+ }
+ /**
+ * @return Returns the title.
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title The title to set.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return position + "," + quantity + "," + productId + "," + title + "," + price;
+
+ }
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/test/ReceiveJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/test/ReceiveJMSMessage.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/test/ReceiveJMSMessage.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,140 @@
+/*
+ * 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.samples.quickstart.simple_cep.test;
+
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueSession;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+public class ReceiveJMSMessage {
+ QueueConnection conn = null;
+ QueueSession receiverSession = null;
+ Queue receiverQueue = null;
+ QueueReceiver queueReceiver = null;
+ InitialContext iniCtx = null;
+ QueueConnectionFactory qcf = null;
+ String receiveQueueName = "queue/quickstart_funcbr_response";
+ private boolean initialised ;
+
+ public ReceiveJMSMessage() {
+
+ }
+ public void receiveOne() {
+ if (!initialised) {
+ initialise() ;
+ }
+
+ if (receiverQueue != null) {
+ try {
+ TextMessage msg = (TextMessage) queueReceiver.receive();
+ if (msg != null) {
+ System.out.println("*********************************************************");
+ System.out.println(msg.getText());
+ System.out.println("*********************************************************");
+ }
+ } catch (final Exception ex) {
+ cleanup() ;
+ System.out.println(ex.getMessage()) ;
+ }
+ }
+
+ if (!initialised) {
+ System.out.println("Pausing before reinitialising") ;
+ try {
+ Thread.sleep(5000) ;
+ } catch (final InterruptedException ie) {
+ // do nothing
+ }
+ }
+ }
+
+ private void initialise()
+ {
+ try {
+ if (iniCtx == null) iniCtx = new InitialContext();
+ if (qcf == null) qcf = (QueueConnectionFactory) iniCtx.lookup("ConnectionFactory");
+ if (conn == null) {
+ conn = qcf.createQueueConnection();
+ conn.start();
+ }
+ receiverQueue = (Queue) iniCtx.lookup(receiveQueueName);
+ receiverSession = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ queueReceiver = receiverSession.createReceiver(receiverQueue);
+ initialised = true ;
+ System.out.println("Initialised") ;
+ } catch (final Exception ex) {
+ cleanup() ;
+ }
+ }
+
+ public void cleanup() {
+ System.out.println("Closing connections");
+ queueReceiver = null ;
+ receiverSession = null ;
+ receiverQueue = null ;
+ if (receiverSession!=null) {
+ try {
+ receiverSession.close();
+ } catch (final Exception ex) {
+ // Do nothing ;
+ }
+ }
+ if (conn!=null) {
+ try {
+ conn.close() ;
+ } catch (final Exception ex) {
+ // Do nothing ;
+ }
+ }
+ conn = null ;
+ qcf = null ;
+ iniCtx = null ;
+ initialised = false ;
+ System.out.println("Closing completed");
+ }
+
+ public static void main(String[] args) {
+ final ReceiveJMSMessage receiver = new ReceiveJMSMessage();
+
+ if ((args.length > 0) && (args[0] != null)) {
+ receiver.receiveQueueName = args[0];
+ System.out.println("Receiving on: " + receiver.receiveQueueName );
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ public void run() {
+ receiver.cleanup() ;
+ }
+ }) ;
+ while (true) { // loop until I'm killed
+ receiver.receiveOne();
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {break;}
+ }
+
+ } else {
+ System.out.println("Usage <queue-name>");
+ }
+ }
+}
Added: labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/workspace/bsutter/JBW_Chicago_Demos/simple_cep/src/org/jboss/soa/esb/samples/quickstart/simple_cep/test/SendJMSMessage.java 2009-09-09 21:33:08 UTC (rev 29281)
@@ -0,0 +1,127 @@
+/*
+ * 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.samples.quickstart.simple_cep.test;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.jms.JMSException;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueSession;
+import javax.jms.QueueSender;
+import javax.jms.ObjectMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+import java.util.Properties;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_Simple_CEP_Request_GW");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ tm.setStringProperty("jbesbfilename", "SimpleCEPTest.log");
+ send.send(tm);
+ send.close();
+ }
+
+ public String readAsciiFile(String fileName) throws IOException {
+ FileReader fr = null;
+ char[] thechars = null;
+
+ try {
+ File thefile = new File( fileName );
+ fr = new FileReader( thefile );
+ int size = (int) thefile.length();
+ thechars = new char[size];
+
+ int count, index = 0;
+
+ // read in the bytes from the input stream
+ while( ( count = fr.read( thechars, index, size ) ) > 0 ) {
+ size -= count;
+ index += count;
+ }
+ } catch(Exception e) {
+ System.out.println(e);
+ }
+ finally {
+ if( fr != null )
+ fr.close();
+ }
+ return new String(thechars);
+
+ } // readAsciiFile
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ String fileName = "SampleOrder1.xml";
+ if (args != null && args[0].length() !=0) {
+ fileName=args[0];
+ }
+ String fileContent = sm.readAsciiFile(fileName);
+ System.out.println("---------------------------------------------");
+ System.out.println(fileContent);
+ System.out.println("---------------------------------------------");
+ sm.sendAMessage(fileContent);
+ sm.stop();
+
+ }
+
+}
More information about the jboss-svn-commits
mailing list