[jboss-svn-commits] JBL Code SVN: r20574 - in labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts: business_ruleservice_ruleAgent and 14 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jun 18 05:17:53 EDT 2008
Author: beve
Date: 2008-06-18 05:17:53 -0400 (Wed, 18 Jun 2008)
New Revision: 20574
Added:
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/SampleDriver.xml
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/build.xml
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/deployment.xml
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbm-queue-service.xml
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbmq-queue-service.xml
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jboss-esb.xml
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbossesb-properties.xml
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jndi.properties
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/juddi.properties
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/lib/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/log4j.xml
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/processDefinition/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/readme.txt
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/brmsdeployedrules-unfiltered.properties
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/brmsdeployedrules.properties
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/cache/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/cache/http%3A%2F%2Flocalhost%3A8080%2Fdrools-jbrms%2Forg.drools.brms.JBRMS%2Fpackage%2Forg.jboss.soa.esb.services.rules%2FLATEST
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/insurancepolicy.jar
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/package/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/package/org.jboss.soa.esb.services.rules.pkg
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/smooks-res.xml
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/services/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/services/rules/
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/services/rules/Driver.java
labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/services/rules/Policy.java
Log:
New quickstart that demonstrates a ruleservice using a RuleAgent.
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/SampleDriver.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/SampleDriver.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/SampleDriver.xml 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,3 @@
+<Policy type="COMPREHENSIVE" >
+ <Driver name="Bill Smith" age="30" priorClaims="0" locationRiskProfile="LOW" />
+</Policy>
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/build.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/build.xml 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,31 @@
+<project name="Quickstart_business_ruleservice_ruleAgent" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="additional.deploys" value="ruleAgent/brmsdeployedrules.properties ruleAgent/package/org.jboss.soa.esb.services.rules.pkg smooks-res.xml"/>
+
+ <target name="quickstart-specific-assemblies">
+ <copy file="${basedir}/ruleAgent/brmsdeployedrules-unfiltered.properties" tofile="${basedir}/ruleAgent/brmsdeployedrules.properties" overwrite="true" filtering="true">
+ <filterset>
+ <filter token="quickstart.dir" value="${basedir}"/>
+ </filterset>
+ </copy>
+ </target>
+
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+
+ <target name="runtest" depends="compile"
+ description="will receive JMS message to trigger the actions in the ESB">
+ <echo>Runs Test JMS Sender</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.businessrules.test.SendJMSMessage" failonerror="true">
+ <classpath refid="exec-classpath" />
+ </java>
+ </target>
+
+</project>
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/deployment.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/deployment.xml 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=jbrules.esb</depends>
+ <depends>jboss.esb:deployment=smooks.esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_Business_Rules_Request_GW</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_Business_Rules_Request_ESB</depends>
+<depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_Business_Rules_Notify</depends>
+</jbossesb-deployment>
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbm-queue-service.xml 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,21 @@
+<?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_Business_Rules_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_Business_Rules_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_Business_Rules_Notify"
+ 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/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbmq-queue-service.xml 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_Business_Rules_Request_GW">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_Business_Rules_Request_ESB">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_Business_Rules_Notify">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jboss-esb.xml 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,68 @@
+<?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">
+
+ <providers>
+ <jms-provider name="JBossMQ"
+ connection-factory="ConnectionFactory"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-URL="localhost">
+ <jms-bus busid="quickstartGwChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_Business_Rules_Request_GW" />
+ </jms-bus>
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter dest-type="QUEUE"
+ dest-name="queue/quickstart_Business_Rules_Request_ESB" />
+ </jms-bus>
+ </jms-provider>
+ </providers>
+
+ <services>
+
+ <service category="PolicyPricingServices"
+ name="PolicyPricingService" description="Prices the policy application">
+ <listeners>
+ <!-- Gateway -->
+ <jms-listener name="TheGateway"
+ busidref="quickstartGwChannel" maxThreads="1" is-gateway="true" />
+ <jms-listener name="TheESBChannel"
+ busidref="quickstartEsbChannel" maxThreads="1">
+ </jms-listener>
+ </listeners>
+
+ <actions mep="OneWay">
+ <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="message" value="Message before transformation" />
+ </action>
+
+ <action name="transform"
+ class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+ <property name="resource-config"
+ value="/smooks-res.xml" />
+ </action>
+
+ <action name="fixUpMessage"
+ class="org.jboss.soa.esb.samples.quickstart.businessrules.SetupMessage">
+ </action>
+
+ <!-- Use the BRP to calculate the policy price -->
+ <action
+ class="org.jboss.soa.esb.actions.BusinessRulesProcessor"
+ name="PolicyPricing">
+ <property name="ruleSet"
+ value="ruleAgent/brmsdeployedrules.properties" />
+ <property name="object-paths">
+ <object-path esb="body.Driver" />
+ <object-path esb="body.Policy" />
+ </property>
+ </action>
+
+ <action name="reviewMessage"
+ class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
+ <property name="stuff" value="Sent notification: "/>
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jbossesb-properties.xml 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,85 @@
+<?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"/>
+ </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/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jndi.properties
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jndi.properties (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/jndi.properties 2008-06-18 09:17:53 UTC (rev 20574)
@@ -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/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/juddi.properties
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/juddi.properties (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/juddi.properties 2008-06-18 09:17:53 UTC (rev 20574)
@@ -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/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/log4j.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/log4j.xml 2008-06-18 09:17:53 UTC (rev 20574)
@@ -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="WARN"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.milyn">
+ <priority value="ERROR"/>
+ </category>
+
+ <category name="quickstarts">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/readme.txt
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/readme.txt (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/readme.txt 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,55 @@
+Overview:
+=========
+ Demonstrates the use of the BusinessRulesProcessor which uses facts that are
+ POJOs attached to an ESB Message. The example uses Rules to calculate the price
+ of an automobile insurance policy. In particular, this example gets the rules from
+ a rule package that is contained in the file system through the Drools RuleAgent.
+ This rule package can also be retrieved from a URL created by the Drools BRMS.
+
+ Make sure you have run simple_cbr, transformation_XML2POJO and fun_cbr
+ quickstarts as their principles are used in this more complex example.
+
+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.
+
+ A comprehensive description of message transformation can be found in
+ MessageTransformation.pdf, located in the docs/services folder.
+
+ Notice the brmsdeployedrules.properties in the ruleAgent folder. This points
+ the location of the rule package. It can specify a fully qualified file name,
+ or just the directory (if there is only one package file in it). Modify one
+ of these to match the path of your ESB installation.
+
+To Run standalone mode:
+=======================
+ 1. In a command terminal window in the quickstart folder type
+ 'ant deploy-jms-dests'.
+ 2. In a command terminal window in this folder ("Window1"), type 'ant run'.
+ 3. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 4. Switch back to "Window1" to see the output from the ESB
+ 5. When finished, interrupt the ESB using Ctrl-C and, in this folder
+ ("Window1"), type 'ant undeploy-jms-dests'.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 3. Switch back to Application Server console to see the output from the ESB
+ 4. In this folder ("Window1"), type 'ant undeploy'.
+
+What to look at in this Quickstart:
+===================================
+
+ The SendJMSMessage will send a message with the SampleDriver.xml included as a string.
+ A Transformation service will convert the XML to POJOs (Driver and Policy), and put
+ these objects in the message. The message is then sent to the PolicyPricing service
+ which uses the brmsdeployedrules.property to access the rule package, creates a new
+ stateless session, inserts the Driver and Policy from the message, and executes the
+ rules. The console will show the resulting price of the policy that is calculated
+ from the rules.
+
+
\ No newline at end of file
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/brmsdeployedrules-unfiltered.properties
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/brmsdeployedrules-unfiltered.properties (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/brmsdeployedrules-unfiltered.properties 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,11 @@
+newInstance=true
+
+file=@quickstart.dir@/ruleAgent/package/org.jboss.soa.esb.services.rules.pkg
+#dir=/ruleAgent/package
+
+
+#url=http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.jboss.soa.esb.services.rules/LATEST
+#localCacheDir=/ruleAgent/cache
+poll=30
+
+name=insuranceconfig
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/brmsdeployedrules.properties
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/brmsdeployedrules.properties (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/brmsdeployedrules.properties 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,11 @@
+newInstance=true
+
+file=/opt/jboss/esb/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/package/org.jboss.soa.esb.services.rules.pkg
+#dir=/ruleAgent/package
+
+
+#url=http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.jboss.soa.esb.services.rules/LATEST
+#localCacheDir=/ruleAgent/cache
+poll=30
+
+name=insuranceconfig
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/cache/http%3A%2F%2Flocalhost%3A8080%2Fdrools-jbrms%2Forg.drools.brms.JBRMS%2Fpackage%2Forg.jboss.soa.esb.services.rules%2FLATEST
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/cache/http%3A%2F%2Flocalhost%3A8080%2Fdrools-jbrms%2Forg.drools.brms.JBRMS%2Fpackage%2Forg.jboss.soa.esb.services.rules%2FLATEST
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/insurancepolicy.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/insurancepolicy.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/package/org.jboss.soa.esb.services.rules.pkg
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/ruleAgent/package/org.jboss.soa.esb.services.rules.pkg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/smooks-res.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/smooks-res.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/smooks-res.xml 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,28 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+
+ <!-- Populate the Policy -->
+ <resource-config selector="policy">
+ <resource>org.milyn.javabean.BeanPopulator</resource>
+ <param name="beanId">Policy</param>
+ <param name="beanClass">org.jboss.soa.esb.services.rules.Policy</param>
+ <param name="bindings">
+ <binding property="type" selector="policy @type" />
+ </param>
+ </resource-config>
+
+ <!-- Populate the Driver -->
+ <resource-config selector="policy driver">
+ <resource>org.milyn.javabean.BeanPopulator</resource>
+ <param name="beanId">Driver</param>
+ <param name="beanClass">org.jboss.soa.esb.services.rules.Driver</param>
+ <param name="setOn">Policy</param>
+ <param name="bindings">
+ <binding property="name" selector="policy driver @name" />
+ <binding property="age" selector="policy driver @age" type="Integer" />
+ <binding property="priorClaims" selector="policy driver @priorClaims" type="Integer" />
+ <binding property="locationRiskProfile" selector="policy driver @locationRiskProfile" />
+ </param>
+ </resource-config>
+
+</smooks-resource-list>
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java 2008-06-18 09:17:53 UTC (rev 20574)
@@ -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.businessrules;
+
+import java.util.HashMap;
+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.services.rules.Driver;
+import org.jboss.soa.esb.services.rules.Policy;
+
+public class ReviewMessage extends AbstractActionPipelineProcessor {
+ private String input = "Sent Notification to:";
+
+ public Message process(Message message) throws ActionProcessingException {
+
+ Driver driver = (Driver) message.getBody().get("Driver");
+ Policy policy = (Policy) message.getBody().get("Policy");
+ System.out.println("{ ================ " + input);
+ System.out.println("Name: " + driver.getName());
+ System.out.println("Policy Price: " + policy.getBasePrice());
+ System.out.println("} ================ " + input);
+
+
+ return message;
+ }
+
+ public ReviewMessage(ConfigTree configTree) {
+ input = configTree.getAttribute("stuff");
+ }
+
+}
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java 2008-06-18 09:17:53 UTC (rev 20574)
@@ -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.businessrules;
+
+import java.util.HashMap;
+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.services.rules.Driver;
+import org.jboss.soa.esb.services.rules.Policy;
+import org.apache.log4j.Logger;
+
+public class SetupMessage extends AbstractActionPipelineProcessor {
+ private Logger logger = Logger.getLogger(SetupMessage.class);
+
+ public Message process(Message message) throws ActionProcessingException {
+ HashMap transformedBeans = (HashMap) message.getBody().get("EXTRACTED_BEANS_HASH");
+ if(transformedBeans != null) {
+ Driver driver = (Driver) transformedBeans.get("Driver");
+ Policy policy = (Policy) transformedBeans.get("Policy");
+ message.getBody().add("Driver", driver);
+ message.getBody().add("Policy", policy);
+ logger.info("Moved the transformed driver and policy");
+ }
+ return message;
+ }
+
+ public SetupMessage(ConfigTree configTree) {
+
+ }
+
+}
\ No newline at end of file
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.businessrules.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 java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_Business_Rules_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);
+ 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 fileContent = sm.readAsciiFile("SampleDriver.xml");
+ System.out.println("---------------------------------------------");
+ System.out.println(fileContent);
+ System.out.println("---------------------------------------------");
+ sm.sendAMessage(fileContent);
+ sm.stop();
+
+ }
+
+}
\ No newline at end of file
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/services/rules/Driver.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/services/rules/Driver.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/services/rules/Driver.java 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,44 @@
+package org.jboss.soa.esb.services.rules;
+
+import java.io.Serializable;
+
+/**
+ * This represents obviously a driver who is applying for an insurance Policy.
+ * @author Michael Neale
+ *
+ */
+public class Driver implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ private String name = "Mr Joe Blogs";
+ private Integer age = new Integer(30);
+ private Integer priorClaims = new Integer(0);
+ private String locationRiskProfile = "LOW";
+
+ public Integer getAge() {
+ return age;
+ }
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+ public String getLocationRiskProfile() {
+ return locationRiskProfile;
+ }
+ public void setLocationRiskProfile(String locationRiskProfile) {
+ this.locationRiskProfile = locationRiskProfile;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public Integer getPriorClaims() {
+ return priorClaims;
+ }
+ public void setPriorClaims(Integer priorClaims) {
+ this.priorClaims = priorClaims;
+ }
+
+
+}
Added: labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/services/rules/Policy.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/services/rules/Policy.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/services/rules/Policy.java 2008-06-18 09:17:53 UTC (rev 20574)
@@ -0,0 +1,59 @@
+package org.jboss.soa.esb.services.rules;
+
+import java.io.Serializable;
+
+/**
+ * This represents a policy that a driver is applying for.
+ *
+ * Obviously in the real world, there are actuaries to mess things up, but lets just pretend there is
+ * some simple base price and discount that we can calculate with relatively simple rules !
+ *
+ * @author Michael Neale
+ */
+public class Policy implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ private String type = "COMPREHENSIVE";
+ private boolean approved = false;
+ private int discountPercent = 0;
+ private int basePrice;
+ private Driver driver;
+
+ public boolean isApproved() {
+ return approved;
+ }
+ public void setApproved(boolean approved) {
+ this.approved = approved;
+ }
+ public int getDiscountPercent() {
+ return discountPercent;
+ }
+ public void setDiscountPercent(int discountPercent) {
+ this.discountPercent = discountPercent;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public void applyDiscount(int discount) {
+ discountPercent += discount;
+ }
+ public int getBasePrice() {
+ return basePrice;
+ }
+ public void setBasePrice(int basePrice) {
+ this.basePrice = basePrice;
+ }
+ public Driver getDriver() {
+ return driver;
+ }
+ public void setDriver(Driver driver) {
+ this.driver = driver;
+ }
+
+}
More information about the jboss-svn-commits
mailing list