Author: objectiser
Date: 2008-08-29 12:12:31 -0400 (Fri, 29 Aug 2008)
New Revision: 288
Added:
cdl/trunk/samples/jbossesb/trailblazer/
cdl/trunk/samples/jbossesb/trailblazer/banks/
cdl/trunk/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.html
cdl/trunk/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.odt
cdl/trunk/samples/jbossesb/trailblazer/banks/build.xml
cdl/trunk/samples/jbossesb/trailblazer/banks/lib/
cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/
cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/Licenses.txt
cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/org.sadun.util.jar
cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/pollmgt.jar
cdl/trunk/samples/jbossesb/trailblazer/banks/log4j.xml
cdl/trunk/samples/jbossesb/trailblazer/banks/monitored_folders/
cdl/trunk/samples/jbossesb/trailblazer/banks/src/
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/Bank.java
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReply.java
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/FileUtil.java
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerFlatFile.java
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java
cdl/trunk/samples/jbossesb/trailblazer/banks/test/
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReplyTest.java
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/FlatFileProcessorTest.java
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java
cdl/trunk/samples/jbossesb/trailblazer/build.xml
cdl/trunk/samples/jbossesb/trailblazer/client/
cdl/trunk/samples/jbossesb/trailblazer/client/jsp/
cdl/trunk/samples/jbossesb/trailblazer/client/jsp/index.jsp
cdl/trunk/samples/jbossesb/trailblazer/client/lib/
cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/
cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/Licenses.txt
cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jaxb-api.jar
cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jboss-jaxws.jar
cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jbossws-client.jar
cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jbossws-core.jar
cdl/trunk/samples/jbossesb/trailblazer/client/resources/
cdl/trunk/samples/jbossesb/trailblazer/client/resources/jaxrpc-mapping.xml
cdl/trunk/samples/jbossesb/trailblazer/client/resources/web.xml
cdl/trunk/samples/jbossesb/trailblazer/client/resources/webservices.xml
cdl/trunk/samples/jbossesb/trailblazer/client/resources/wsdl/
cdl/trunk/samples/jbossesb/trailblazer/client/resources/wsdl/LoanBrokerService.wsdl
cdl/trunk/samples/jbossesb/trailblazer/client/resources/wstools-config.xml
cdl/trunk/samples/jbossesb/trailblazer/client/src/
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/Customer.java
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/CustomerMasterFile.java
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanRequester.java
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerBean.java
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerInterface.java
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java
cdl/trunk/samples/jbossesb/trailblazer/esb/
cdl/trunk/samples/jbossesb/trailblazer/esb/build.xml
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/deployment.xml
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbm-queue-service.xml
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbmq-queue-service.xml
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jboss-esb.xml
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties-monitor.xml
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties.xml
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/log4j.xml
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/smooks-csv2xml.xml
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/smooks-xml2csv.xml
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/xml2csv.xsl
cdl/trunk/samples/jbossesb/trailblazer/esb/lib/
cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/
cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/c3p0-0.9.1-pre9.jar
cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/commons-logging.jar
cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/hsqldb.jar
cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/milyn-smooks-csv-0.1.jar
cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/opencsv-1.6.jar
cdl/trunk/samples/jbossesb/trailblazer/esb/src/
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckCSVToXMLActions.java
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckXMLToCSVActions.java
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/FileBankRequestActions.java
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/NotifyCustomerActions.java
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/HsqldbUtil.java
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/ProcessEmail.java
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TbBootStrapper.java
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TrailblazerProperties.java
cdl/trunk/samples/jbossesb/trailblazer/esb/test/
cdl/trunk/samples/jbossesb/trailblazer/esb/test/src/
cdl/trunk/samples/jbossesb/trailblazer/juddi.properties
cdl/trunk/samples/jbossesb/trailblazer/log4j.xml
cdl/trunk/samples/jbossesb/trailblazer/readme.txt
cdl/trunk/samples/jbossesb/trailblazer/template/
cdl/trunk/samples/jbossesb/trailblazer/template/quote.st
cdl/trunk/samples/jbossesb/trailblazer/trailblazer.properties
Log:
Added modified JBossESB trailblazer example to be used with the validator.
Added: cdl/trunk/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks
Guide.html
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.html
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks
Guide.html 2008-08-29 16:12:31 UTC (rev 288)
@@ -0,0 +1,489 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 11">
+<meta name=Originator content="Microsoft Word 11">
+<link rel=File-List
+href="JBoss%20ESB%20Loan%20Broker%20Banks%20Guide_files/filelist.xml">
+<title>BANKS FOR THE LOANBROKER DEMO</title>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="country-region"/>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="Street"/>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="address"/>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="place"/>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="City"/>
+<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
+ name="State"/>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Author>kstam</o:Author>
+ <o:LastAuthor>kstam</o:LastAuthor>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>7</o:TotalTime>
+ <o:Created>2006-08-03T14:42:00Z</o:Created>
+ <o:LastSaved>2006-08-03T14:42:00Z</o:LastSaved>
+ <o:Pages>1</o:Pages>
+ <o:Words>743</o:Words>
+ <o:Characters>4237</o:Characters>
+ <o:Company>JBoss, Inc.</o:Company>
+ <o:Lines>35</o:Lines>
+ <o:Paragraphs>9</o:Paragraphs>
+ <o:CharactersWithSpaces>4971</o:CharactersWithSpaces>
+ <o:Version>11.6568</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:SpellingState>Clean</w:SpellingState>
+ <w:GrammarState>Clean</w:GrammarState>
+ <w:PunctuationKerning/>
+ <w:ValidateAgainstSchemas/>
+ <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
+ <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
+ <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
+ <w:Compatibility>
+ <w:BreakWrappedTables/>
+ <w:SnapToGridInCell/>
+ <w:WrapTextWithPunct/>
+ <w:UseAsianBreakRules/>
+ <w:DontGrowAutofit/>
+ </w:Compatibility>
+ <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
+ </w:WordDocument>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:LatentStyles DefLockedState="false"
LatentStyleCount="156">
+ </w:LatentStyles>
+</xml><![endif]--><!--[if !mso]><object
+ classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D"
id=ieooui></object>
+<style>
+st1\:*{behavior:url(#ieooui) }
+</style>
+<![endif]-->
+<style>
+<!--
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+h1
+ {mso-style-link:"Heading 1 Char";
+ mso-style-next:Normal;
+ margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:1;
+ font-size:16.0pt;
+ font-family:Arial;
+ mso-font-kerning:16.0pt;}
+h2
+ {mso-style-next:Normal;
+ margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:2;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic;}
+h3
+ {mso-style-next:Normal;
+ margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:3;
+ font-size:13.0pt;
+ font-family:Arial;}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;
+ text-underline:single;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;
+ text-underline:single;}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-locked:yes;
+ mso-style-link:"Heading 1";
+ mso-ansi-font-size:16.0pt;
+ mso-bidi-font-size:16.0pt;
+ font-family:Arial;
+ mso-ascii-font-family:Arial;
+ mso-hansi-font-family:Arial;
+ mso-bidi-font-family:Arial;
+ mso-font-kerning:16.0pt;
+ mso-ansi-language:EN-US;
+ mso-fareast-language:EN-US;
+ mso-bidi-language:AR-SA;
+ font-weight:bold;}
+span.SpellE
+ {mso-style-name:"";
+ mso-spl-e:yes;}
+span.GramE
+ {mso-style-name:"";
+ mso-gram-e:yes;}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+ {mso-style-name:"Table Normal";
+ mso-tstyle-rowband-size:0;
+ mso-tstyle-colband-size:0;
+ mso-style-noshow:yes;
+ mso-style-parent:"";
+ mso-padding-alt:0in 5.4pt 0in 5.4pt;
+ mso-para-margin:0in;
+ mso-para-margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Times New Roman";
+ mso-ansi-language:#0400;
+ mso-fareast-language:#0400;
+ mso-bidi-language:#0400;}
+</style>
+<![endif]-->
+</head>
+
+<body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<h1>JBoss ESB Loan Broker Banks Guide</h1>
+
+<p class=MsoNormal><o:p> </o:p></p>
+
+<p class=MsoNormal>By: Kurt Stam (<a
href="mailto:kurt.stam@jboss.com">kurt.stam@jboss.com</a>)</p>
+
+<p class=MsoNormal><o:p> </o:p></p>
+
+<p class=MsoNormal>JBoss ESB JBoss Labs Home Page: <a
+href="http://labs.jboss.com/portal/jbossesb">http://labs.jboss.com/portal/jbossesb</a></p>
+
+<p class=MsoNormal><o:p> </o:p></p>
+
+<p class=MsoNormal>JBoss ESB Developer Community Forums: <a
+href="http://www.jboss.com/index.html?module=bb&op=viewforum&f=220">http://www.jboss.com/index.html?module=bb&op=viewforum&f=220</a></p>
+
+<p class=MsoNormal><o:p> </o:p></p>
+
+<p
class=MsoNormal>########################################################################</p>
+
+<p class=MsoNormal># JBoss, Home of Professional Open Source</p>
+
+<p class=MsoNormal># Copyright 2006, JBoss Inc., and individual contributors as
+indicated</p>
+
+<p class=MsoNormal># <span class=GramE>by</span> the @authors tag. See
the
+copyright.txt in the distribution for a</p>
+
+<p class=MsoNormal># <span class=GramE>full</span> listing of
individual
+contributors.</p>
+
+<p class=MsoNormal>#</p>
+
+<p class=MsoNormal># <span class=GramE>This</span> is free software;
you can
+redistribute it and/or modify it</p>
+
+<p class=MsoNormal># <span class=GramE>under</span> the terms of the
GNU Lesser
+General Public License as</p>
+
+<p class=MsoNormal># published by the Free Software Foundation; either version
+2.1 of</p>
+
+<p class=MsoNormal># <span class=GramE>the</span> License, or (at your
option)
+any later version.</p>
+
+<p class=MsoNormal>#</p>
+
+<p class=MsoNormal># <span class=GramE>This</span> software is
distributed in
+the hope that it will be useful,</p>
+
+<p class=MsoNormal># <span class=GramE>but</span> WITHOUT ANY WARRANTY;
without
+even the implied warranty of</p>
+
+<p class=MsoNormal><span class=GramE># MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.</span> See the GNU</p>
+
+<p class=MsoNormal><span class=GramE># Lesser General Public License for
more
+details.</span></p>
+
+<p class=MsoNormal>#</p>
+
+<p class=MsoNormal># <span class=GramE>You</span> should have received
a copy
+of the GNU Lesser General Public</p>
+
+<p class=MsoNormal># License along with this software; if not, write to the
+Free</p>
+
+<p class=MsoNormal># Software Foundation, Inc., <st1:Street
w:st="on"><st1:address
+ w:st="on">51 Franklin St</st1:address></st1:Street>, Fifth
Floor, <st1:place
+w:st="on"><st1:City w:st="on">Boston</st1:City>,
<st1:State w:st="on">MA</st1:State></st1:place></p>
+
+<p class=MsoNormal># 02110-1301 <st1:place
w:st="on"><st1:country-region
w:st="on">USA</st1:country-region></st1:place>,
+or see the FSF site:
http://www.fsf.org.</p>
+
+<p
class=MsoNormal>########################################################################</p>
+
+<p class=MsoNormal><b><span
style='font-size:16.0pt;font-family:Arial;
+background:white;mso-highlight:white;mso-font-kerning:16.0pt'><o:p> </o:p></span></b></p>
+
+<p class=MsoNormal><b><span
style='font-size:16.0pt;font-family:Arial;
+background:white;mso-highlight:white;mso-font-kerning:16.0pt'><o:p> </o:p></span></b></p>
+
+<b><span style='font-size:16.0pt;font-family:Arial;mso-fareast-font-family:
+"Times New
Roman";background:white;mso-highlight:white;mso-font-kerning:16.0pt;
+mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA'><br
+clear=all style='page-break-before:always'>
+</span></b>
+
+<p class=MsoNormal><span class=Heading1Char><span
style='font-size:16.0pt;
+background:white;mso-highlight:white'>1.
Introduction</span></span><span
+class=Heading1Char><span
style='font-size:16.0pt'><o:p></o:p></span></span></p>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>As part
+of the Loan Broker Demo, the broker goes out to a few banks to obtain loan
+quotes.</span></p>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>This
+folder contains two banks:</span></p>
+
+<p class=MsoNormal><o:p> </o:p></p>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>1. <span
+class=GramE>a</span> Flat File Based Bank, and</span></p>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>2. <span
+class=GramE>a</span> JMS Based bank.</span></p>
+
+<p class=MsoNormal><o:p> </o:p></p>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>To make
+the demo a little more interesting we have the banks use two different
+protocols (flat file and JMS), and two</span> <span
style='background:white;
+mso-highlight:white'>different message formats (<span
class=SpellE>csv</span>,
+xml). You can customize some of the configuration in the <span
class=SpellE>bank.properties</span>
+file. Not that</span> <span
style='background:white;mso-highlight:white'>the
+banks use to log4j.xml in the current directory. </span></p>
+
+<h2><span style='background:white;mso-highlight:white'>2. Flat File
Based Bank</span></h2>
+
+<h3><span style='background:white;mso-highlight:white'>2.1 Starting
the bank</span></h3>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>The Flat
+File Based Bank uses the property '<span
class=SpellE>file.monitored.directory</span>'
+which by default is set to 'C<span class=GramE>:\</span>Temp\<span
+class=SpellE>BankInput</span>'.</span> <span
style='background:white;
+mso-highlight:white'>You can start this bank by typing:</span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p> </o:p></span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+class=GramE><span style='font-size:10.0pt;font-family:"Courier
New";background:
+white;mso-highlight:white'>ant</span></span><span
style='font-size:10.0pt;
+font-family:"Courier New";background:white;mso-highlight:white'>
<span
+class=SpellE>runFileBank</span></span><span
style='font-size:10.0pt;font-family:
+"Courier New"'><o:p></o:p></span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p> </o:p></span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier New"'>* Not of caution,
there is
+no filter set in the <span class=SpellE>poller</span> code, so it will pick
up
+and try to move any files it finds.<o:p></o:p></span></p>
+
+<h3><span style='background:white;mso-highlight:white'>2.2 Processing
details</span></h3>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>The <span
+class=SpellE>FlatFilePollManager</span> monitors a directory specified in the
+configuration. When a file arrives it</span> <span style='background:white;
+mso-highlight:white'>tries to process the content assuming it contains one line
+with loan request information.</span> <span
style='background:white;mso-highlight:
+white'>So for example the content of the file could read something like
</span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New";background:white;mso-highlight:
+white'><o:p> </o:p></span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New";background:white;mso-highlight:
+white'>23456890<span
class=GramE>,3,4,20000,5</span></span><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p></o:p></span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p> </o:p></span></p>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>The order
+of values needs to be <span class=SpellE>SocialSecurityNumber</span>,
<span
+class=SpellE>CreditScore</span>, <span
class=SpellE>HistoryLength</span>
+[month], <span class=SpellE>LoanAmount</span> [dollar],</span>
<span
+style='background:white;mso-highlight:white'>and finally the <span
+class=SpellE>LoanTerm</span> [month]. The request will be processed and a
<span
+class=SpellE>BankQouteReply</span> is generated. The</span> <span
+style='background:white;mso-highlight:white'>original file is moved to a
+'processed' directory, and the <span
class=SpellE>BankQuoteReply</span> is
+serialized to an 'outgoing' directory from <span class=GramE>the
it</span> can
+be picked up by the system that dropped the request.</span></p>
+
+<h3><span style='background:white;mso-highlight:white'>2.3
Testing</span></h3>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>You can
+test whether or not the bank is working by dropping a file in the monitored
+directory (C:\Temp\BankInput).Let's say we</span> <span
style='background:white;
+mso-highlight:white'>use a file with name 'request.txt'. The file should
be
+ASCII and can contain the following line:</span></p>
+
+<p class=MsoNormal><o:p> </o:p></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New";background:white;mso-highlight:
+white'>23456890<span
class=GramE>,3,4,20000,5</span></span><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p></o:p></span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p> </o:p></span></p>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>The file
+should get moved to the C:\Temp\BankInput\processed directory, and in the
+C:\Temp\ <span class=SpellE>BankInput</span>\outgoing directory a reply file
+should</span> <span
style='background:white;mso-highlight:white'>appear with
+the name 'reply_to_request.txt'. It should contain the
line:</span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p> </o:p></span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New";background:white;mso-highlight:
+white'>8.29<span
class=GramE>,FileBasedBank</span>-1,0</span><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p></o:p></span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p> </o:p></span></p>
+
+<p class=MsoNormal><span class=GramE><span
style='background:white;mso-highlight:
+white'>which</span></span><span
style='background:white;mso-highlight:white'>
+means the </span><span class=SpellE><span
style='font-size:10.0pt;mso-bidi-font-size:
+12.0pt;font-family:"Courier New";mso-bidi-font-family:"Times New
Roman";
+background:white;mso-highlight:white'>QuoteId</span></span><span
+style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:"Courier
New";
+mso-bidi-font-family:"Times New
Roman";background:white;mso-highlight:white'>=FileBasedBank-1</span><span
+style='background:white;mso-highlight:white'>, the </span><span
+style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:"Courier
New";
+mso-bidi-font-family:"Times New
Roman";background:white;mso-highlight:white'>interest=8.29</span><span
+style='background:white;mso-highlight:white'> and the </span><span
+class=SpellE><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
+font-family:"Courier New";mso-bidi-font-family:"Times New
Roman";background:
+white;mso-highlight:white'>errorCode</span></span><span
style='font-size:10.0pt;
+mso-bidi-font-size:12.0pt;font-family:"Courier
New";mso-bidi-font-family:"Times New Roman";
+background:white;mso-highlight:white'>=0</span><span
style='background:white;
+mso-highlight:white'> (which means success). You can check the logging
for</span>
+<span style='background:white;mso-highlight:white'>additional
details.</span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p> </o:p></span></p>
+
+<h2><span style='background:white;mso-highlight:white'>3. JMS Based
Bank</span></h2>
+
+<h3><span style='background:white;mso-highlight:white'>3.1 Starting
the bank</span></h3>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>Before
+starting the bank you need to bring up your JMS provider. For the example this
+is the JBoss AS. We are using</span> <span
style='background:white;mso-highlight:
+white'>the default queues (C and D). The JMS bank uses the properties: <span
+class=SpellE>jms.provider.url</span>, <span
class=SpellE>jms.queue.in</span>
+and <span class=SpellE>jms.queue.out</span>. By</span> <span
style='background:
+white;mso-highlight:white'>default these are set to '<span
class=SpellE>localhost</span>',
+'queue/C' and 'queue/D'. So, by default, it assumes <st1:place
w:st="on"><st1:City
+ w:st="on">JBoss</st1:City> <st1:State
w:st="on">AS</st1:State></st1:place> is
+running on the <span class=SpellE>localhost</span>.</span> <span
+style='background:white;mso-highlight:white'>Next you can start the JMS Based
+bank by typing:</span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p> </o:p></span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+class=GramE><span style='font-size:10.0pt;font-family:"Courier
New";background:
+white;mso-highlight:white'>ant</span></span><span
style='font-size:10.0pt;
+font-family:"Courier New";background:white;mso-highlight:white'>
<span
+class=SpellE>runJMSBank</span></span><span
style='font-size:10.0pt;font-family:
+"Courier New"'><o:p></o:p></span></p>
+
+<h3><span style='background:white;mso-highlight:white'>3.2 Processing
details</span></h3>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>The <span
+class=SpellE>JMSManager</span> listens to an incoming queue (by default queue/C
+on <span class=SpellE>localhost</span>). It consumes the</span>
<span
+style='background:white;mso-highlight:white'>message assuming it is a
<span
+class=SpellE>TextMessage</span>, and that the text is an XML structure that can
+be marshaled</span> <span
style='background:white;mso-highlight:white'>into a <span
+class=SpellE>BankQuoteRequest</span>. The request will be processed and a
<span
+class=SpellE>BankQuote</span> Reply will be serialized to XML</span>
<span
+style='background:white;mso-highlight:white'>and send to the outgoing queue
(by
+default this is queue/D on <span class=SpellE>localhost</span>). If the
+processing results</span> <span
style='background:white;mso-highlight:white'>in
+an error a <span class=SpellE>BankQuoteReply</span> with <span
class=SpellE>ErrorCode</span>
+other then 0 is send to the outgoing queue.</span></p>
+
+<h3><span style='background:white;mso-highlight:white'>3.3
Testing</span></h3>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>The unit
+test <span class=SpellE>JMSProcessorTest</span> drops a <span
class=SpellE>BankQuoteRequest</span>
+Message on the queue/C of <span class=SpellE>localhost</span>. You can
use</span></p>
+
+<p class=MsoNormal><span class=GramE><span
style='background:white;mso-highlight:
+white'>this</span></span><span
style='background:white;mso-highlight:white'>
+test to check the health of the <span class=SpellE>JMSBank</span>. The tests
+can be executed by typing</span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p> </o:p></span></p>
+
+<p class=MsoNormal
style='mso-layout-grid-align:none;text-autospace:none'><span
+class=GramE><span style='font-size:10.0pt;font-family:"Courier
New";background:
+white;mso-highlight:white'>ant</span></span><span
style='font-size:10.0pt;
+font-family:"Courier New";background:white;mso-highlight:white'>
test</span><span
+style='font-size:10.0pt;font-family:"Courier
New"'><o:p></o:p></span></p>
+
+<h1><span style='background:white;mso-highlight:white'>4.
Finally</span></h1>
+
+<p class=MsoNormal><span
style='background:white;mso-highlight:white'>You are
+now ready to run the larger Load Broker Demo itself.</span></p>
+
+</div>
+
+</body>
+
+</html>
Added: cdl/trunk/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker Banks Guide.odt
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/samples/jbossesb/trailblazer/banks/JBoss ESB Loan Broker
Banks Guide.odt
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/banks/build.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/banks/build.xml (rev
0)
+++ cdl/trunk/samples/jbossesb/trailblazer/banks/build.xml 2008-08-29 16:12:31 UTC (rev
288)
@@ -0,0 +1,124 @@
+<project name="BANKS" default="compile" basedir=".">
+
+ <property file="../trailblazer.properties"/>
+ <!-- Some default build locations -->
+
+ <property name="org.jboss.esb.ext.lib.dir"
value="../../../lib/ext"/>
+ <property name="org.jboss.esb.samples.loanbroker.banks.dest"
value="${basedir}/build"/>
+ <property name="org.jboss.esb.samples.loanbroker.banks.classes.dir"
value="${basedir}/build/classes/banks/"/>
+ <property name="org.jboss.esb.samples.loanbroker.banks.testclasses.dir"
value="${basedir}/build/classes/tests/"/>
+ <property name="org.jboss.esb.samples.loanbroker.banks.src.dir"
value="${basedir}/src"/>
+ <property name="org.jboss.esb.samples.loanbroker.banks.test.dir"
value="${basedir}/test"/>
+ <property name="org.jboss.esb.samples.loanbroker.banks.jar.dest"
value="${basedir}/build/dist/lib/"/>
+ <property name="org.jboss.esb.samples.loanbroker.banks.lib.ext.dir"
value="${basedir}/lib/ext"/>
+ <property name="org.jboss.esb.samples.loanbroker.banks.tests.report.dir"
value="${basedir}/build/tests"/>
+
+ <path id="org.jboss.esb.samples.loanbroker.banks.classpath">
+ <fileset dir="${org.jboss.esb.samples.loanbroker.banks.lib.ext.dir}"
includes="*.jar"/>
+ <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="log4j.jar
jbossall-client.jar xstream-1.1.3.jar junit-4.1.jar"/>
+ </path>
+ <path id="org.jboss.esb.samples.loanbroker.banks.testclasspath">
+ <fileset dir="${org.jboss.esb.samples.loanbroker.banks.lib.ext.dir}"
includes="*.jar"/>
+ <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="log4j.jar
jbossall-client.jar xstream-1.1.3.jar junit-4.1.jar"/>
+ <pathelement
location="${org.jboss.esb.samples.loanbroker.banks.classes.dir}"/>
+ <pathelement
location="${org.jboss.esb.samples.loanbroker.banks.testclasses.dir}"/>
+ <pathelement location="."/>
+ </path>
+
+ <target name="clean">
+ <delete dir="${org.jboss.esb.samples.loanbroker.banks.dest}" />
+ </target>
+ <!-- =================================================================== -->
+ <!-- Prepares the directory structure -->
+ <!-- =================================================================== -->
+ <target name="org.jboss.esb.samples.loanbroker.banks.prepare">
+ <mkdir dir="${org.jboss.esb.samples.loanbroker.banks.dest}"/>
+ <mkdir dir="${org.jboss.esb.samples.loanbroker.banks.dest}/dist"/>
+ <mkdir
dir="${org.jboss.esb.samples.loanbroker.banks.dest}/classes/banks"/>
+ <mkdir
dir="${org.jboss.esb.samples.loanbroker.banks.dest}/classes/tests"/>
+ <mkdir dir="${org.jboss.esb.samples.loanbroker.banks.dest}/tests"/>
+ <mkdir dir="${org.jboss.esb.samples.loanbroker.banks.dest}/dist/lib"/>
+ </target>
+
+ <!-- Compilation targets -->
+ <target name="org.jboss.esb.samples.loanbroker.banks.compile"
depends="org.jboss.esb.samples.loanbroker.banks.prepare"
+ description="Compile all classes">
+
+ <javac
+ destdir="${org.jboss.esb.samples.loanbroker.banks.classes.dir}"
+ classpathref="org.jboss.esb.samples.loanbroker.banks.classpath"
+ debug="true"
+ >
+ <src
path="${org.jboss.esb.samples.loanbroker.banks.src.dir}"/>
+ </javac>
+ <javac
+
destdir="${org.jboss.esb.samples.loanbroker.banks.testclasses.dir}"
+ debug="true"
+ classpathref="org.jboss.esb.samples.loanbroker.banks.testclasspath"
+ >
+ <src
path="${org.jboss.esb.samples.loanbroker.banks.test.dir}"/>
+ </javac>
+ </target>
+
+ <!-- javadocs paths -->
+ <path id="org.jboss.esb.samples.loanbroker.banks.javadocs.path">
+ <pathelement path="esb/classes"/>
+ </path>
+
+ <!-- Jar targets -->
+ <target name="org.jboss.esb.samples.loanbroker.banks.jar"
depends="org.jboss.esb.samples.loanbroker.banks.compile">
+ <echo message="Building jar file"/>
+ <delete
file="${org.jboss.esb.samples.loanbroker.banks.dest}/dist/lib/bank.jar" />
+ <jar
destfile="${org.jboss.esb.samples.loanbroker.banks.dest}/dist/lib/bank.jar"
+ basedir="${org.jboss.esb.samples.loanbroker.banks.classes.dir}"
+ includes="**/*.class"
+ />
+ </target>
+
+ <target name="runJMSBank"
depends="org.jboss.esb.samples.loanbroker.banks.jar">
+ <echo>Running JMS Based Bank</echo>
+ <echo>Note that your app-server on host: localhost needs to be up and
running!</echo>
+ <java fork="yes"
classname="org.jboss.soa.esb.samples.loanbroker.banks.ManagerJMS"
failonerror="true">
+ <arg value="${jms.provider.url}"/>
+ <arg value="${jms.queue.in}"/>
+ <arg value="${jms.queue.out}"/>
+ <classpath
refid="org.jboss.esb.samples.loanbroker.banks.testclasspath"/>
+ </java>
+ </target>
+
+ <target name="runFileBank"
depends="org.jboss.esb.samples.loanbroker.banks.jar">
+ <echo>Running File Based Bank</echo>
+ <java fork="yes"
classname="org.jboss.soa.esb.samples.loanbroker.banks.ManagerFlatFile"
failonerror="true" >
+ <classpath
refid="org.jboss.esb.samples.loanbroker.banks.testclasspath"/>
+ <arg value="${file.bank.monitored.dir}" />
+ <arg value="${file.output.directory}" />
+ </java>
+ </target>
+
+ <!-- Short target names -->
+ <target name="compile"
depends="org.jboss.esb.samples.loanbroker.banks.compile"/>
+ <target name="test"
depends="org.jboss.esb.samples.loanbroker.banks.test"/>
+ <target name="jar"
depends="org.jboss.esb.samples.loanbroker.banks.jar"/>
+
+ <!-- ======================================================================
-->
+ <!-- U N I T T E S T S
-->
+ <!-- ======================================================================
-->
+ <target name="org.jboss.esb.samples.loanbroker.banks.test"
depends="org.jboss.esb.samples.loanbroker.banks.compile">
+ <echo message="Running tests for banks"/>
+ <junit printsummary="yes" haltonerror="yes"
haltonfailure="yes" showoutput="no" fork="true">
+ <formatter type="plain" usefile="false"/>
+ <formatter type="xml"/>
+ <batchtest
todir="${org.jboss.esb.samples.loanbroker.banks.tests.report.dir}">
+ <fileset
dir="${org.jboss.esb.samples.loanbroker.banks.test.dir}">
+ <include name="**/**Test.java"/>
+ </fileset>
+ </batchtest>
+ <classpath>
+ <!-- Need the tests src folder because there may be non-compiled test
resources -->
+ <pathelement
location="${org.jboss.esb.samples.loanbroker.banks.test.dir}"/>
+ <path
refid="org.jboss.esb.samples.loanbroker.banks.testclasspath"/>
+ </classpath>
+ </junit>
+ </target>
+
+</project>
Added: cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/Licenses.txt
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/Licenses.txt
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/Licenses.txt 2008-08-29 16:12:31
UTC (rev 288)
@@ -0,0 +1,445 @@
+The jars in this directory are covered by a range of licences, as described
+below.
+
+JBoss jars:
+
+/*
+ *
+ * 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,
+ */
+
+JUnit
+
+ Common Public License Version 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
+LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
+CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate from and are
+distributed by that particular Contributor. A Contribution 'originates' from a
+Contributor if it was added to the Program by such Contributor itself or anyone
+acting on such Contributor's behalf. Contributions do not include additions to
+the Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are
+necessarily infringed by the use or sale of its Contribution alone or when
+combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this
Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement,
+including all Contributors.
+
+2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free copyright license to
+reproduce, prepare derivative works of, publicly display, publicly perform,
+distribute and sublicense the Contribution of such Contributor, if any, and such
+derivative works, in source code and object code form.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
+Patents to make, use, sell, offer to sell, import and otherwise transfer the
+Contribution of such Contributor, if any, in source code and object code form.
+This patent license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other combinations
+which include the Contribution. No hardware per se is licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the licenses
+to its Contributions set forth herein, no assurances are provided by any
+Contributor that the Program does not infringe the patent or other intellectual
+property rights of any other entity. Each Contributor disclaims any liability to
+Recipient for claims brought by any other entity based on infringement of
+intellectual property rights or otherwise. As a condition to exercising the
+rights and licenses granted hereunder, each Recipient hereby assumes sole
+responsibility to secure any other intellectual property rights needed, if any.
+For example, if a third party patent license is required to allow Recipient to
+distribute the Program, it is Recipient's responsibility to acquire that license
+before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright license set
+forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its
+own license agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement; and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title and
+non-infringement, and implied warranties or conditions of merchantability and
+fitness for a particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all liability for
+damages, including direct, indirect, special, incidental and consequential
+damages, such as lost profits;
+
+ iii) states that any provisions which differ from this Agreement are offered
+by that Contributor alone and not by any other party; and
+
+ iv) states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable manner on or
+through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the
+Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if
+any, in a manner that reasonably allows subsequent Recipients to identify the
+originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with
+respect to end users, business partners and the like. While this license is
+intended to facilitate the commercial use of the Program, the Contributor who
+includes the Program in a commercial product offering should do so in a manner
+which does not create potential liability for other Contributors. Therefore, if
+a Contributor includes the Program in a commercial product offering, such
+Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any losses,
damages
+and costs (collectively "Losses") arising from claims, lawsuits and other
legal
+actions brought by a third party against the Indemnified Contributor to the
+extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor to
+control, and cooperate with the Commercial Contributor in, the defense and any
+related settlement negotiations. The Indemnified Contributor may participate in
+any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product
+offering, Product X. That Contributor is then a Commercial Contributor. If that
+Commercial Contributor then makes performance claims, or offers warranties
+related to Product X, those performance claims and warranties are such
+Commercial Contributor's responsibility alone. Under this section, the
+Commercial Contributor would have to defend claims against the other
+Contributors related to those performance claims and warranties, and if a court
+requires any other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
+Recipient is solely responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its exercise of
+rights under this Agreement, including but not limited to the risks and costs of
+program errors, compliance with applicable laws, damage to or loss of data,
+programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
+CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable
+law, it shall not affect the validity or enforceability of the remainder of the
+terms of this Agreement, and without further action by the parties hereto, such
+provision shall be reformed to the minimum extent necessary to make such
+provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to
+a patent applicable to software (including a cross-claim or counterclaim in a
+lawsuit), then any patent licenses granted by that Contributor to such Recipient
+under this Agreement shall terminate as of the date such litigation is filed. In
+addition, if Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
+itself (excluding combinations of the Program with other software or hardware)
+infringes such Recipient's patent(s), then such Recipient's rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to
+comply with any of the material terms or conditions of this Agreement and does
+not cure such failure in a reasonable period of time after becoming aware of
+such noncompliance. If all Recipient's rights under this Agreement terminate,
+Recipient agrees to cease use and distribution of the Program as soon as
+reasonably practicable. However, Recipient's obligations under this Agreement
+and any licenses granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in
+order to avoid inconsistency the Agreement is copyrighted and may only be
+modified in the following manner. The Agreement Steward reserves the right to
+publish new versions (including revisions) of this Agreement from time to time.
+No one other than the Agreement Steward has the right to modify this Agreement.
+IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
+as the Agreement Steward to a suitable separate entity. Each new version of the
+Agreement will be given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the Agreement
+is published, Contributor may elect to distribute the Program (including its
+Contributions) under the new version. Except as expressly stated in Sections
+2(a) and 2(b) above, Recipient receives no rights or licenses to the
+intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to this
+Agreement will bring a legal action under this Agreement more than one year
+after the cause of action arose. Each party waives its rights to a jury trial in
+any resulting litigation.
+
+
+
+XStream, Antlr, Stingtemplate BSD License
+
+Copyright (c) 2003-2005, Joe Walnes
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of
+conditions and the following disclaimer. Redistributions in binary form must reproduce
+the above copyright notice, this list of conditions and the following disclaimer in
+the documentation and/or other materials provided with the distribution.
+
+Neither the name of XStream nor the names of its contributors may be used to endorse
+or promote products derived from this software without specific prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+
+
+pollmgt.jar, org.sadun.util.jar
+
+GNU Lesser General Public License
+
+Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of
this license document, but changing it is not allowed.
+
+ [This is the first released version of the Lesser GPL. It also counts as the
successor of the GNU Library Public License, version 2, hence the version number 2.1.]
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change
it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to
share and change free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially designated
software packages--typically libraries--of the Free Software Foundation and other authors
who decide to use it. You can use it too, but we suggest you first think carefully about
whether this license or the ordinary General Public License is the better strategy to use
in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price. Our
General Public Licenses are designed to make sure that you have the freedom to distribute
copies of free software (and charge for this service if you wish); that you receive source
code or can get it if you want it; that you can change the software and use pieces of it
in new free programs; and that you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you
these rights or to ask you to surrender these rights. These restrictions translate to
certain responsibilities for you if you distribute copies of the library or if you modify
it.
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you
must give the recipients all the rights that we gave you. You must make sure that they,
too, receive or can get the source code. If you link other code with the library, you must
provide complete object files to the recipients, so that they can relink them with the
library after making changes to the library and recompiling it. And you must show them
these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we
offer you this license, which gives you legal permission to copy, distribute and/or modify
the library.
+
+To protect each distributor, we want to make it very clear that there is no warranty for
the free library. Also, if the library is modified by someone else and passed on, the
recipients should know that what they have is not the original version, so that the
original author's reputation will not be affected by problems that might be introduced
by others.
+
+Finally, software patents pose a constant threat to the existence of any free program. We
wish to make sure that a company cannot effectively restrict the users of a free program
by obtaining a restrictive license from a patent holder. Therefore, we insist that any
patent license obtained for a version of the library must be consistent with the full
freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General
Public License. This license, the GNU Lesser General Public License, applies to certain
designated libraries, and is quite different from the ordinary General Public License. We
use this license for certain libraries in order to permit linking those libraries into
non-free programs.
+
+When a program is linked with a library, whether statically or using a shared library,
the combination of the two is legally speaking a combined work, a derivative of the
original library. The ordinary General Public License therefore permits such linking only
if the entire combination fits its criteria of freedom. The Lesser General Public License
permits more lax criteria for linking other code with the library.
+
+We call this license the "Lesser" General Public License because it does Less
to protect the user's freedom than the ordinary General Public License. It also
provides other free software developers Less of an advantage over competing non-free
programs. These disadvantages are the reason we use the ordinary General Public License
for many libraries. However, the Lesser license provides advantages in certain special
circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the widest
possible use of a certain library, so that it becomes a de-facto standard. To achieve
this, non-free programs must be allowed to use the library. A more frequent case is that a
free library does the same job as widely used non-free libraries. In this case, there is
little to gain by limiting the free library to free software only, so we use the Lesser
General Public License.
+
+In other cases, permission to use a particular library in non-free programs enables a
greater number of people to use a large body of free software. For example, permission to
use the GNU C Library in non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users' freedom,
it does ensure that the user of a program that is linked with the Library has the freedom
and the wherewithal to run that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and modification follow. Pay
close attention to the difference between a "work based on the library" and a
"work that uses the library". The former contains code derived from the library,
whereas the latter must be combined with the library in order to run.
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other program which contains
a notice placed by the copyright holder or other authorized party saying it may be
distributed under the terms of this Lesser General Public License (also called "this
License"). Each licensee is addressed as "you".
+
+A "library" means a collection of software functions and/or data prepared so as
to be conveniently linked with application programs (which use some of those functions and
data) to form executables.
+
+The "Library", below, refers to any such software library or work which has
been distributed under these terms. A "work based on the Library" means either
the Library or any derivative work under copyright law: that is to say, a work containing
the Library or a portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is included without
limitation in the term "modification".)
+
+"Source code" for a work means the preferred form of the work for making
modifications to it. For a library, complete source code means all the source code for all
modules it contains, plus any associated interface definition files, plus the scripts used
to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered by this
License; they are outside its scope. The act of running a program using the Library is not
restricted, and output from such a program is covered only if its contents constitute a
work based on the Library (independent of the use of the Library in a tool for writing
it). Whether that is true depends on what the Library does and what the program that uses
the Library does.
+
+1. You may copy and distribute verbatim copies of the Library's complete source code
as you receive it, in any medium, provided that you conspicuously and appropriately
publish on each copy an appropriate copyright notice and disclaimer of warranty; keep
intact all the notices that refer to this License and to the absence of any warranty; and
distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your
option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a
work based on the Library, and copy and distribute such modifications or work under the
terms of Section 1 above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices stating that you
changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no charge to all third
parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a table of data to
be supplied by an application program that uses the facility, other than as an argument
passed when the facility is invoked, then you must make a good faith effort to ensure
that, in the event an application does not supply such function or table, the facility
still operates, and performs whatever part of its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has a purpose that is
entirely well-defined independent of the application. Therefore, Subsection 2d requires
that any application-supplied function or table used by this function must be optional: if
the application does not supply it, the square root function must still compute square
roots.)
+
+ These requirements apply to the modified work as a whole. If identifiable sections of
that work are not derived from the Library, and can be reasonably considered independent
and separate works in themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you distribute the same
sections as part of a whole which is a work based on the Library, the distribution of the
whole must be on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote it.
+
+ Thus, it is not the intent of this section to claim rights or contest your rights to
work written entirely by you; rather, the intent is to exercise the right to control the
distribution of derivative or collective works based on the Library.
+
+ In addition, mere aggregation of another work not based on the Library with the
Library (or with a work based on the Library) on a volume of a storage or distribution
medium does not bring the other work under the scope of this License.
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of
this License to a given copy of the Library. To do this, you must alter all the notices
that refer to this License, so that they refer to the ordinary GNU General Public License,
version 2, instead of to this License. (If a newer version than version 2 of the ordinary
GNU General Public License has appeared, then you can specify that version instead if you
wish.) Do not make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy, so the
ordinary GNU General Public License applies to all subsequent copies and derivative works
made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library into a
program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under
Section 2) in object code or executable form under the terms of Sections 1 and 2 above
provided that you accompany it with the complete corresponding machine-readable source
code, which must be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same place
satisfies the requirement to distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but is designed
to work with the Library by being compiled or linked with it, is called a "work that
uses the Library". Such a work, in isolation, is not a derivative work of the
Library, and therefore falls outside the scope of this License.
+
+However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions of the
Library), rather than a "work that uses the library". The executable is
therefore covered by this License. Section 6 states terms for distribution of such
executables.
+
+When a "work that uses the Library" uses material from a header file that is
part of the Library, the object code for the work may be a derivative work of the Library
even though the source code is not. Whether this is true is especially significant if the
work can be linked without the Library, or if the work is itself a library. The threshold
for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts and
accessors, and small macros and small inline functions (ten lines or less in length), then
the use of the object file is unrestricted, regardless of whether it is legally a
derivative work. (Executables containing this object code plus portions of the Library
will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code
for the work under the terms of Section 6. Any executables containing that work also fall
under Section 6, whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a "work that
uses the Library" with the Library to produce a work containing portions of the
Library, and distribute that work under terms of your choice, provided that the terms
permit modification of the work for the customer's own use and reverse engineering for
debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library is used in it
and that the Library and its use are covered by this License. You must supply a copy of
this License. If the work during execution displays copyright notices, you must include
the copyright notice for the Library among them, as well as a reference directing the user
to the copy of this License. Also, you must do one of these things:
+
+ a) Accompany the work with the complete corresponding machine-readable source code
for the Library including whatever changes were used in the work (which must be
distributed under Sections 1 and 2 above); and, if the work is an executable linked with
the Library, with the complete machine-readable "work that uses the Library", as
object code and/or source code, so that the user can modify the Library and then relink to
produce a modified executable containing the modified Library. (It is understood that the
user who changes the contents of definitions files in the Library will not necessarily be
able to recompile the application to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the Library. A suitable
mechanism is one that (1) uses at run time a copy of the library already present on the
user's computer system, rather than copying library functions into the executable, and
(2) will operate properly with a modified version of the library, if the user installs
one, as long as the modified version is interface-compatible with the version that the
work was made with.
+
+ c) Accompany the work with a written offer, valid for at least three years, to give
the same user the materials specified in Subsection 6a, above, for a charge no more than
the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these materials or that you
have already sent this user a copy.
+
+For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable from it.
However, as a special exception, the materials to be distributed need not include anything
that is normally distributed (in either source or binary form) with the major components
(compiler, kernel, and so on) of the operating system on which the executable runs, unless
that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of other
proprietary libraries that do not normally accompany the operating system. Such a
contradiction means you cannot use both them and the Library together in an executable
that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side in
a single library together with other library facilities not covered by this License, and
distribute such a combined library, provided that the separate distribution of the work
based on the Library and of the other library facilities is otherwise permitted, and
provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work based on the Library,
uncombined with any other library facilities. This must be distributed under the terms of
the Sections above.
+
+ b) Give prominent notice with the combined library of the fact that part of it is a
work based on the Library, and explaining where to find the accompanying uncombined form
of the same work.
+
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as
expressly provided under this License. Any attempt otherwise to copy, modify, sublicense,
link with, or distribute the Library is void, and will automatically terminate your rights
under this License. However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such parties remain in
full compliance.
+
+9. You are not required to accept this License, since you have not signed it. However,
nothing else grants you permission to modify or distribute the Library or its derivative
works. These actions are prohibited by law if you do not accept this License. Therefore,
by modifying or distributing the Library (or any work based on the Library), you indicate
your acceptance of this License to do so, and all its terms and conditions for copying,
distributing or modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library), the
recipient automatically receives a license from the original licensor to copy, distribute,
link with or modify the Library subject to these terms and conditions. You may not impose
any further restrictions on the recipients' exercise of the rights granted herein. You
are not responsible for enforcing compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for
any other reason (not limited to patent issues), conditions are imposed on you (whether by
court order, agreement or otherwise) that contradict the conditions of this License, they
do not excuse you from the conditions of this License. If you cannot distribute so as to
satisfy simultaneously your obligations under this License and any other pertinent
obligations, then as a consequence you may not distribute the Library at all. For example,
if a patent license would not permit royalty-free redistribution of the Library by all
those who receive copies directly or indirectly through you, then the only way you could
satisfy both it and this License would be to refrain entirely from distribution of the
Library.
+
+If any portion of this section is held invalid or unenforceable under any particular
circumstance, the balance of the section is intended to apply, and the section as a whole
is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other
property right claims or to contest validity of any such claims; this section has the sole
purpose of protecting the integrity of the free software distribution system which is
implemented by public license practices. Many people have made generous contributions to
the wide range of software distributed through that system in reliance on consistent
application of that system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of
the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain countries
either by patents or by copyrighted interfaces, the original copyright holder who places
the Library under this License may add an explicit geographical distribution limitation
excluding those countries, so that distribution is permitted only in or among countries
not thus excluded. In such case, this License incorporates the limitation as if written in
the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of the Lesser
General Public License from time to time. Such new versions will be similar in spirit to
the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies a version
number of this License which applies to it and "any later version", you have the
option of following the terms and conditions either of that version or of any later
version published by the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by the Free Software
Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs whose
distribution conditions are incompatible with these, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation, write to
the Free Software Foundation; we sometimes make exceptions for this. Our decision will be
guided by the two goals of preserving the free status of all derivatives of our free
software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY,
TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY
PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING
BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN
IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+END OF TERMS AND CONDITIONS
+How to Apply These Terms to Your New Libraries
+If you develop a new library, and you want it to be of the greatest possible use to the
public, we recommend making it free software that everyone can redistribute and change.
You can do so by permitting redistribution under these terms (or, alternatively, under the
terms of the ordinary General Public License).
+
+To apply these terms, attach the following notices to the library. It is safest to attach
them to the start of each source file to most effectively convey the exclusion of
warranty; and each file should have at least the "copyright" line and a pointer
to where the full notice is found.
+
+ <one line to give the library's name and an idea of what it does.>
Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License along with
this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite
330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your school, if any,
to sign a "copyright disclaimer" for the library, if necessary. Here is a
sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a
library for tweaking knobs) written by James Random Hacker.
+
+ signature of Ty Coon, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
Added: cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/org.sadun.util.jar
===================================================================
(Binary files differ)
Property changes on:
cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/org.sadun.util.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/pollmgt.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/samples/jbossesb/trailblazer/banks/lib/ext/pollmgt.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/banks/log4j.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/banks/log4j.xml (rev
0)
+++ cdl/trunk/samples/jbossesb/trailblazer/banks/log4j.xml 2008-08-29 16:12:31 UTC (rev
288)
@@ -0,0 +1,287 @@
+<?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">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
+ <errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./banks.log"/>
+ <param name="Append" value="false"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern"
value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern"
value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c]
%m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c]
(%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+ <!-- 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="${jboss.server.home.dir}/log/server.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 [%c]
%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ============================== -->
+ <!-- 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
[%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ====================== -->
+ <!-- More Appender examples -->
+ <!-- ====================== -->
+
+ <!-- Buffer events and log them asynchronously
+ <appender name="ASYNC"
class="org.apache.log4j.AsyncAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <appender-ref ref="FILE"/>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="SMTP"/>
+ </appender>
+ -->
+
+ <!-- EMail events to an administrator
+ <appender name="SMTP"
class="org.apache.log4j.net.SMTPAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Threshold" value="ERROR"/>
+ <param name="To" value="admin(a)myhost.domain.com"/>
+ <param name="From" value="nobody(a)myhost.domain.com"/>
+ <param name="Subject" value="JBoss Sever Errors"/>
+ <param name="SMTPHost" value="localhost"/>
+ <param name="BufferSize" value="10"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}]
%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Syslog events
+ <appender name="SYSLOG"
class="org.apache.log4j.net.SyslogAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Facility" value="LOCAL7"/>
+ <param name="FacilityPrinting" value="true"/>
+ <param name="SyslogHost" value="localhost"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}]
%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Log events to JMS (requires a topic to be created)
+ <appender name="JMS"
class="org.apache.log4j.net.JMSAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Threshold" value="ERROR"/>
+ <param name="TopicConnectionFactoryBindingName"
value="java:/ConnectionFactory"/>
+ <param name="TopicBindingName"
value="topic/MyErrorsTopic"/>
+ </appender>
+ -->
+
+ <!-- Log events through SNMP
+ <appender name="TRAP_LOG"
class="org.apache.log4j.ext.SNMPTrapAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="ImplementationClassName"
value="org.apache.log4j.ext.JoeSNMPTrapSender"/>
+ <param name="ManagementHost" value="127.0.0.1"/>
+ <param name="ManagementHostTrapListenPort" value="162"/>
+ <param name="EnterpriseOID" value="1.3.6.1.4.1.24.0"/>
+ <param name="LocalIPAddress" value="127.0.0.1"/>
+ <param name="LocalTrapSendPort" value="161"/>
+ <param name="GenericTrapType" value="6"/>
+ <param name="SpecificTrapType" value="12345678"/>
+ <param name="CommunityString" value="public"/>
+ <param name="ForwardStackTraceWithTrap" value="true"/>
+ <param name="Threshold" value="DEBUG"/>
+ <param name="ApplicationTrapOID"
value="1.3.6.1.4.1.24.12.10.22.64"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
value="%d,%p,[%t],[%c],%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Emit events as JMX notifications
+ <appender name="JMX"
class="org.jboss.monitor.services.JMXNotificationAppender">
+ <errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+
+ <param name="Threshold" value="WARN"/>
+ <param name="ObjectName"
value="jboss.system:service=Logging,type=JMXNotificationAppender"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c]
%m"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+ <category name="org.apache">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+ <category name="org.jgroups">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit jboss axis to INFO as its DEBUG is even more verbose -->
+ <category name="org.jboss.axis">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit JBoss categories
+ <category name="org.jboss">
+ <priority value="INFO"/>
+ </category>
+ -->
+
+ <!-- Limit the JSR77 categories -->
+ <category name="org.jboss.management">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit JBoss webservice category
+ <category name="org.jboss.webservice">
+ <priority value="DEBUG"/>
+ </category>
+ -->
+
+ <!-- Decrease the priority threshold for the org.jboss.varia category
+ <category name="org.jboss.varia">
+ <priority value="DEBUG"/>
+ </category>
+ -->
+
+ <!-- Show the evolution of the DataSource pool in the logs [inUse/Available/Max]
+ <category
name="org.jboss.resource.connectionmanager.JBossManagedConnectionPool">
+ <priority value="TRACE"
class="org.jboss.logging.XLevel"/>
+ </category>
+ -->
+
+ <!--
+ | An example of enabling the custom TRACE level priority that is used
+ | by the JBoss internals to diagnose low level details. This example
+ | turns on TRACE level msgs for the org.jboss.ejb.plugins package and its
+ | subpackages. This will produce A LOT of logging output.
+ <category name="org.jboss.system">
+ <priority value="TRACE"
class="org.jboss.logging.XLevel"/>
+ </category>
+ <category name="org.jboss.ejb.plugins">
+ <priority value="TRACE"
class="org.jboss.logging.XLevel"/>
+ </category>
+ -->
+
+ <!--
+ | Logs these events to SNMP:
+ - server starts/stops
+ - cluster evolution (node death/startup)
+ - When an EJB archive is deployed (and associated verified messages)
+ - When an EAR archive is deployed
+
+ <category name="org.jboss.system.server.Server">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category
name="org.jboss.ha.framework.interfaces.HAPartition.lifecycle">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category name="org.jboss.deployment.MainDeployer">
+ <priority value="ERROR" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category name="org.jboss.ejb.EJBDeployer">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category name="org.jboss.deployment.EARDeployer">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ -->
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+ <!-- Clustering logging -->
+ <!-- Uncomment the following to redirect the org.jgroups and
+ org.jboss.ha categories to a cluster.log file.
+
+ <appender name="CLUSTER"
class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File"
value="${jboss.server.home.dir}/log/cluster.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 [%c]
%m%n"/>
+ </layout>
+ </appender>
+ <category name="org.jgroups">
+ <priority value="DEBUG" />
+ <appender-ref ref="CLUSTER"/>
+ </category>
+ <category name="org.jboss.ha">
+ <priority value="DEBUG" />
+ <appender-ref ref="CLUSTER"/>
+ </category>
+ -->
+
+</log4j:configuration>
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/Bank.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/Bank.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/Bank.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,153 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.math.BigDecimal;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+/**
+ * This Bank is pretty well focussed on doing one thing, which is giving out loans. On
the
+ * reception of a BankQuoteRequest it will compute the interest rate it will return
+ * in the BankQuoteReply.
+ *
+ * Each bank instance can be customized using the parameters bankName, RatePremium and
MaxLoanTerm.
+ *
+ * @author kstam
+ *
+ */
+public class Bank
+{
+ private Logger logger = Logger.getLogger(this.getClass());
+
+ private static final BigDecimal PRIME_RATE = BigDecimal.valueOf(8.0);
+ private static final BigDecimal DEFAULT_RATE_PREMIUM = BigDecimal.valueOf(0.5);
+ private static final int DEFAULT_MAX_LOAN_TERM = 30;
+ private static final String DEFAULT_BANK_NAME = "DefaultBank";
+ private static int _quoteCounter = 0;
+
+ //Default values for bank
+ private String bankName = DEFAULT_BANK_NAME;
+ private BigDecimal ratePremium = DEFAULT_RATE_PREMIUM;
+ private int maxLoanTerm = DEFAULT_MAX_LOAN_TERM;
+
+ /**
+ * The Bank's constructor.
+ *
+ * @param bankName - the name of the bank
+ * @param ratePremium - the premium it charges for the loan
+ * @param maxLoanTerm - the maximum loan term
+ */
+ public Bank(String bankName, BigDecimal ratePremium, int maxLoanTerm) {
+ super();
+ if (bankName!=null) {
+ this.bankName=bankName;
+ }
+ if (ratePremium!=null) {
+ this.ratePremium=ratePremium;
+ }
+ if (maxLoanTerm > 0) {
+ this.maxLoanTerm=maxLoanTerm;
+ }
+ }
+ /**
+ * The bank computes the interest rate based on configuration parameters of the bank
and
+ * the information in the {@link BankQuoteRequest.
+ * @param bankQuoteRequest - the bank quote request containing requests parameters
+ * @return bankQuoteReply - the bank quote replay contaning the interest rate
+ */
+ private BankQuoteReply computeBankQuoteReply(BankQuoteRequest bankQuoteRequest)
+ {
+ BankQuoteReply bankQuoteReply = new BankQuoteReply();
+ if (bankQuoteRequest.loanTerm <= maxLoanTerm) {
+ BigDecimal interestRate=BigDecimal.valueOf((bankQuoteRequest.loanTerm/12.0)/10.0);
+ interestRate=PRIME_RATE.add(ratePremium).add(interestRate);
+ bankQuoteReply.setInterestRate(interestRate.setScale(2, BigDecimal.ROUND_HALF_UP));
+ bankQuoteReply.setErrorCode(0);
+ } else {
+ bankQuoteReply.setInterestRate(BigDecimal.valueOf(0.00).setScale(2,
BigDecimal.ROUND_HALF_UP));
+ bankQuoteReply.setErrorCode(1);
+ }
+ String quoteId=bankName + "-" + _quoteCounter++;
+ bankQuoteReply.setQuoteId(quoteId);
+ bankQuoteReply.setRef(bankQuoteRequest.getRef());
+ bankQuoteReply.setCustomerUID(bankQuoteRequest.getCustomerUID());
+ bankQuoteReply.setCustomerEmail(bankQuoteRequest.customerEmail);
+ return bankQuoteReply;
+ }
+ /**
+ * Processes the Loan Quote request and returns the banks reply.
+ *
+ * @param bankQuoteRequest - the bank quote request
+ * @return bankQuoteReply - the bank quote reply
+ */
+ protected BankQuoteReply processMessage(BankQuoteRequest bankQuoteRequest)
+ {
+ logger.log(Level.INFO, "Bank '" + bankName + "' received a
request for SSN="
+ + bankQuoteRequest.getSsn()
+ + " for $" + bankQuoteRequest.loanAmount
+ + " over " + bankQuoteRequest.loanTerm + " months.");
+ logger.log(Level.DEBUG, bankQuoteRequest);
+
+ BankQuoteReply bankQuoteReply = computeBankQuoteReply(bankQuoteRequest);
+ logger.log(Level.INFO, "Bank '" + bankName + " offers SSN="
+ + bankQuoteRequest.getSsn() + " " + bankQuoteReply);
+
+ return bankQuoteReply;
+ }
+
+ protected BankQuoteRequest getQuoteFromXML(String xml) {
+ BankQuoteRequest quote = new BankQuoteRequest();
+
+ try {
+ DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+ fact.setNamespaceAware(true);
+
+ java.io.InputStream xmlstr=
+ new java.io.ByteArrayInputStream(xml.getBytes());
+
+ DocumentBuilder builder=fact.newDocumentBuilder();
+ org.w3c.dom.Document doc=builder.parse(xmlstr);
+
+ org.w3c.dom.Element tree = doc.getDocumentElement();
+
+ quote.setSsn(Integer.parseInt(tree.getAttribute("ssn")));
+ quote.setRef(tree.getAttribute("ref"));
+ quote.setCreditScore(Integer.parseInt(tree.getAttribute("creditScore")));
+ quote.setHistoryLength(Integer.parseInt(tree.getAttribute("creditHistoryLen")));
+ quote.setLoanAmount(Integer.parseInt(tree.getAttribute("amount")));
+ quote.setLoanTerm(Integer.parseInt(tree.getAttribute("term")));
+ quote.setCustomerUID(tree.getAttribute("customerUID"));
+ quote.customerEmail=tree.getAttribute("customerEmail");
+
+ } catch(Exception ex) {
+ logger.error(ex.getMessage(), ex);
+ }
+
+ return quote;
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReply.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReply.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReply.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,180 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+public class BankQuoteReply implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private BigDecimal interestRate;
+ private String quoteId;
+ private String ref;
+ private int errorCode;
+ private String customerUID;
+ private String customerEmail;
+ private String customerSSN;
+ private String customerName;
+ private String customerAddress;
+ private String customerSalary;
+ private String loanAmount;
+ private String loanDuration;
+
+ /**
+ * Gets the SerialVersionUID.
+ * @return serialVersionUID
+ */
+ public static long getSerialVersionUID() {
+ return serialVersionUID;
+ }
+ /**
+ * Gets the errorCode.
+ * <li>0 - success
+ * <li>1 - loan term exceeds the maximum available loan term
+ * <li>2 - invalid SSN
+ * <li>3 - invalid credit score
+ * <li>4 - invalid credit history length
+ * <li>5 - invalid loan term
+ * <li>6 - invalid message
+ * <li>7 - invalid customerUID
+ * @return errorCode
+ */
+ public int getErrorCode() {
+ return errorCode;
+ }
+ /**
+ * Sets the errorCode.
+ * <li>0 - success
+ * <li>1 - loan term exceeds the maximum available loan term
+ * <li>2 - invalid SSN
+ * <li>3 - invalid credit score
+ * <li>4 - invalid credit history length
+ * <li>5 - invalid loan term
+ * @param errorCode
+ */
+ public void setErrorCode(int errorCode) {
+ this.errorCode = errorCode;
+ }
+ /**
+ * Gets the quoted interest rate.
+ * @return interestRate
+ */
+ public BigDecimal getInterestRate() {
+ return interestRate;
+ }
+ /**
+ * Sets the quoted interest rate.
+ * @param interestRate
+ */
+ public void setInterestRate(BigDecimal interestRate) {
+ this.interestRate = interestRate;
+ }
+ /**
+ * Gets the Quote ID.
+ * @return quoteId
+ */
+ public String getQuoteId() {
+ return quoteId;
+ }
+ /**
+ * Sets the quoteId.
+ * @param quoteId
+ */
+ public void setQuoteId(String quoteId) {
+ this.quoteId = quoteId;
+ }
+ /**
+ * Gets the ref.
+ * @return ref
+ */
+ public String getRef() {
+ return ref;
+ }
+ /**
+ * Sets the ref.
+ * @param ref
+ */
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
+ /**
+ * Returns a human readable string representation of this object.
+ * @return toString
+ */
+ public String toString() {
+ return this.getClass().getSimpleName() + "=["
+ + "interestRate=" + interestRate
+ + ", quoteId=" + quoteId
+ + ", errorCode=" + errorCode
+ + ", customerUID=" + customerUID + "]";
+ }
+ public String getCustomerUID() {
+ return customerUID;
+ }
+ public void setCustomerUID(String customerUID) {
+ this.customerUID = customerUID;
+ }
+ public String getCustomerAddress() {
+ return customerAddress;
+ }
+ public void setCustomerAddress(String customerAddress) {
+ this.customerAddress = customerAddress;
+ }
+ public String getCustomerEmail() {
+ return customerEmail;
+ }
+ public void setCustomerEmail(String customerEmail) {
+ this.customerEmail = customerEmail;
+ }
+ public String getCustomerName() {
+ return customerName;
+ }
+ public void setCustomerName(String customerName) {
+ this.customerName = customerName;
+ }
+ public String getCustomerSalary() {
+ return customerSalary;
+ }
+ public void setCustomerSalary(String customerSalary) {
+ this.customerSalary = customerSalary;
+ }
+ public String getCustomerSSN() {
+ return customerSSN;
+ }
+ public void setCustomerSSN(String customerSSN) {
+ this.customerSSN = customerSSN;
+ }
+ public String getLoanAmount() {
+ return loanAmount;
+ }
+ public void setLoanAmount(String loanAmount) {
+ this.loanAmount = loanAmount;
+ }
+ public String getLoanDuration() {
+ return loanDuration;
+ }
+ public void setLoanDuration(String loanDuration) {
+ this.loanDuration = loanDuration;
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,149 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.io.Serializable;
+
+
+public class BankQuoteRequest implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ public int ssn;
+ public String ref;
+ public int creditScore;
+ public int historyLength;
+ public int loanAmount;
+ public int loanTerm;
+ public String customerUID;
+ public String customerEmail;
+ public String customerSSN;
+ public String customerName;
+ public String customerAddress;
+ public String customerSalary;
+ public String loanDuration;
+
+ /**
+ * Gets for the credit score.
+ * @return credit score
+ */
+ public int getCreditScore() {
+ return creditScore;
+ }
+ /**
+ * Sets the credit score.
+ * @param creditScore
+ */
+ public void setCreditScore(int creditScore) {
+ this.creditScore = creditScore;
+ }
+ /**
+ * Gets the credit history length (in months).
+ * @return credit history length
+ */
+ public int getHistoryLength() {
+ return historyLength;
+ }
+ /**
+ * Sets the credit history length (in months).
+ * @param historyLength
+ */
+ public void setHistoryLength(int historyLength) {
+ this.historyLength = historyLength;
+ }
+ /**
+ * Gets the requested loan amount (in dollar).
+ * @return the loan amount
+ */
+ public int getLoanAmount() {
+ return loanAmount;
+ }
+ /**
+ * Sets the loan amount.
+ * @param loanAmount - the loan amount (in dollar).
+ */
+ public void setLoanAmount(int loanAmount) {
+ this.loanAmount = loanAmount;
+ }
+ /**
+ * Gets the duration of the loan, the term, (in months).
+ * @return loanTerm
+ */
+ public int getLoanTerm() {
+ return loanTerm;
+ }
+ /**
+ * Sets the term (duration) of the loan (in months)
+ * @param loanTerm
+ */
+ public void setLoanTerm(int loanTerm) {
+ this.loanTerm = loanTerm;
+ }
+ /**
+ * Sets the Social Security Number (SSN).
+ * @return ssn
+ */
+ public int getSsn() {
+ return ssn;
+ }
+ /**
+ * Sets the Social Security Number (SSN).
+ * @param ssn
+ */
+ public void setSsn(int ssn) {
+ this.ssn = ssn;
+ }
+ /**
+ * Gets the ref.
+ * @return ref
+ */
+ public String getRef() {
+ return ref;
+ }
+ /**
+ * Sets the ref.
+ * @param ref
+ */
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
+ /**
+ * Returns a human readable string representation of this object.
+ * @return toString
+ */
+ public String toString() {
+ return this.getClass().getSimpleName() + "=["
+ + "ssn=" + ssn
+ + "ref=" + ref
+ + ", creditScore=" + creditScore
+ + ", historyLength=" + historyLength
+ + ", loanAmount=" + loanAmount
+ + ", loanTerm=" + loanTerm
+ + ", customerUID="+ customerUID + "]";
+ }
+
+ public String getCustomerUID() {
+ return customerUID;
+ }
+ public void setCustomerUID(String customerUID) {
+ this.customerUID = customerUID;
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/FileUtil.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/FileUtil.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/FileUtil.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+/**
+ * Utility class for reading a file into a String and back.
+ * @author kstam
+ */
+public class FileUtil {
+ /**
+ * Read the file into a String.
+ * @param file - the file to be read
+ * @return String with the content of the file
+ * @throws IOException - when we can't read the file
+ */
+ public static String readTextFile(File file) throws IOException
+ {
+ StringBuffer sb = new StringBuffer(1024);
+ BufferedReader reader = new BufferedReader(new FileReader(file.getPath()));
+ char[] chars = new char[1];
+ while( (reader.read(chars)) > -1){
+ sb.append(String.valueOf(chars));
+ chars = new char[1];
+ }
+ reader.close();
+ return sb.toString();
+ }
+ /**
+ * Write a String into a file.
+ * @param file - File to which we write the String
+ * @param str - string which will be written
+ * @throws IOException - when we can't write to the file
+ */
+ public static void writeTextFile(File file, String str) throws IOException
+ {
+ BufferedWriter writer = new BufferedWriter(new FileWriter(file.getPath()));
+ writer.write(str);
+ writer.close();
+ }
+
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerFlatFile.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerFlatFile.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerFlatFile.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,208 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.io.File;
+import java.math.BigDecimal;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+import org.apache.log4j.xml.DOMConfigurator;
+import org.sadun.util.polling.BasePollManager;
+import org.sadun.util.polling.CycleEndEvent;
+import org.sadun.util.polling.CycleStartEvent;
+import org.sadun.util.polling.DirectoryLookupEndEvent;
+import org.sadun.util.polling.DirectoryLookupStartEvent;
+import org.sadun.util.polling.DirectoryPoller;
+import org.sadun.util.polling.FileFoundEvent;
+import org.sadun.util.polling.FileSetFoundEvent;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+/**
+ * The FlatFilePollManager monitors a directory specified in the configuration. When a
file arrives it
+ * tries to process the content assuming it contains one line with loan request
information.
+ * So for example the content of the file could read some like
<br>23456890,3,4,20000,5<br>
+ * The order of values needs to be SocialSecurityNumber, CreditScore, HistoryLength
[month], LoanAmount [dollar],
+ * and finally the LoanTerm [month]. The request will be processed and a BankQouteReply
is generated. The
+ * original file is moved to a 'processed' directory, and the BankQuoteReply is
serialized to an 'outgoing'
+ * directory from the it can be picked up by the system that dropped the request.
+ *
+ * @author kstam
+ *
+ */
+class ManagerFlatFile extends BasePollManager
+{
+ private Logger logger = Logger.getLogger(this.getClass());
+
+ private static final String BANK_NAME = "FileBasedBank";
+ private static final BigDecimal RATE_PREMIUM = BigDecimal.valueOf(0.25);
+ private static final int MAXLOANTERM = 120;
+ private static final String QUOTE_SUFFIX = "quote";
+ private String m_outputDir=null;
+
+ public ManagerFlatFile(String outputDir) {
+ m_outputDir = outputDir;
+ }
+
+ /**
+ * Handle to the cycle start event.
+ */
+ public void cycleStarted(CycleStartEvent evt) {
+ logger.log(Level.DEBUG, "Poller awakened "
+ + (evt.getPoller().getFilter() == null ? "(no filtering)" : evt
+ .getPoller().getFilter().toString()));
+ }
+ /**
+ * Handle to the cycle end event.
+ */
+ public void cycleEnded(CycleEndEvent evt) {
+ logger.log(Level.DEBUG, "Poller going to sleep");
+ }
+ /**
+ * Handle to the directory lookup start event.
+ */
+ public void directoryLookupStarted(DirectoryLookupStartEvent evt) {
+ logger.log(Level.DEBUG, "Scanning " + evt.getDirectory());
+ }
+ /**
+ * Handle to the directory lookup end event.
+ */
+ public void directoryLookupEnded(DirectoryLookupEndEvent evt) {
+ logger.log(Level.DEBUG, "Finished scanning " + evt.getDirectory());
+ }
+ /**
+ * Handle to the file set found event. Currenty this is the only event that
+ * is actually used to proces the incoming loan quote requests. Each file
+ * is send to be processed.
+ */
+ public void fileSetFound(FileSetFoundEvent evt) {
+ File[] files = evt.getFiles();
+
+ for (int i = 0; i < files.length; i++) {
+ File file = files[i];
+ processFile(file);
+ }
+ }
+ /**
+ * Handle to the file found event.
+ */
+ public void fileFound(FileFoundEvent evt) {
+ logger.log(Level.DEBUG, evt);
+ // Add artificial delay
+ }
+ /**
+ * Returns the name of this PollManager and a quick summary of what it does.
+ */
+ public String toString() {
+ return "FlatFilePollManager - a pollmanager which processed incoming -flat file
based- loan requests";
+ }
+ /**
+ * Each file is processed assuming it contains one line with loan request information.
+ * So for example the content of the file could read some like
<br>23456890,3,4,20000,5<br>
+ * The order of values needs to be SocialSecurityNumber, CreditScore, HistoryLength
[month], LoanAmount [dollar],
+ * and finally the LoanTerm [month]. The BankQuoteRequest is processed and a
BankQouteReply is generated. The
+ * original file is moved to a processed directory, and the BankQuoteReply is serialized
to an 'outgoing'
+ * directory from the it can be picked up by the system that dropped the request.
+ *
+ * @param file - incoming flat file with loan quote request info.
+ */
+ protected void processFile(File file)
+ {
+ BankQuoteReply bankQuoteReply=new BankQuoteReply();
+ bankQuoteReply.setQuoteId(BANK_NAME);
+ int errorCode=7;
+ String message=null;
+ logger.log(Level.INFO, "Found " + file.getAbsolutePath() );
+
+ try {
+ //Read the content of the file into a String
+ message=FileUtil.readTextFile(file);
+
+ Bank fileBasedBank = new Bank(BANK_NAME, RATE_PREMIUM, MAXLOANTERM);
+
+ BankQuoteRequest bankQuoteRequest = fileBasedBank.getQuoteFromXML(message);
+
+ bankQuoteReply = fileBasedBank.processMessage(bankQuoteRequest);
+ } catch (Throwable e) {
+ //Package up the error, so it can be processed
+ logger.log(Level.ERROR, e.getMessage());
+ bankQuoteReply.setErrorCode(errorCode);
+ }
+
+ try {
+ //Create the outgoing response file
+ File outgoingDir = new File(m_outputDir);
+ if (!outgoingDir.exists()) {
+ outgoingDir.mkdir();
+ }
+ File outgoingFile = new File(outgoingDir + "/" +
file.getName()+"."+QUOTE_SUFFIX);
+
+ logger.log(Level.INFO, "Creating outgoing file " +
outgoingFile.getAbsolutePath());
+ outgoingFile.createNewFile();
+
+ XStream xstream = new XStream(new DomDriver());
+ xstream.alias("quote", BankQuoteReply.class);
+
+ String reply = xstream.toXML(bankQuoteReply);
+
+ logger.log(Level.INFO, "Writing reply " + reply);
+ FileUtil.writeTextFile(outgoingFile, reply);
+
+ // Delete file
+ file.delete();
+
+ } catch (Exception e) {
+ logger.log(Level.ERROR, e.getMessage(), e);
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ DOMConfigurator.configure("log4j.xml");
+ String monitoredDir = "C:/tmp/input";
+ String outputDir = "C:/tmp/output";
+ if (args!=null && args.length > 0) {
+ monitoredDir=args[0];
+ if (args.length > 1) {
+ outputDir=args[1];
+ }
+ }
+System.out.println("MONITOR="+monitoredDir+" OUTPUT="+outputDir);
+ File monitoredDirectory = new File(monitoredDir);
+ if (!monitoredDirectory.exists() || !monitoredDirectory.isDirectory()){
+ System.err.println("Invalid directory " +
monitoredDirectory.getAbsolutePath());
+ System.out.println("Trying to create the directory.");
+ try {
+ monitoredDirectory.mkdir();
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ }
+ }
+ DirectoryPoller poller = new DirectoryPoller(monitoredDirectory);
+ poller.addPollManager(new ManagerFlatFile(outputDir));
+ poller.start();
+ }
+
+
+}
\ No newline at end of file
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,273 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import java.math.BigDecimal;
+import java.util.Properties;
+
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+import org.apache.log4j.xml.DOMConfigurator;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * The JMS Manager listens to an incoming queue (by default queue/A on localhost). It
consumes the
+ * message assuming it is a TextMessage, and that the text is an XML structure that can
be marshalled
+ * into a BankQuoteRequest. The request will be processed and a BankQuoteRequest Reply
will be serialized to XML
+ * and send to the outgoing queue (by default this is queue/B on localhost).
+ *
+ * @author kstam
+ */
+public class ManagerJMS implements javax.jms.MessageListener, ExceptionListener {
+ private static Logger logger = Logger.getLogger(ManagerJMS.class);
+ /** Name of the Bank */
+ private static final String BANK_NAME = "JMSBasedBank";
+ /** Rate premium the bank charges */
+ private static final BigDecimal RATE_PREMIUM = BigDecimal.valueOf(0.50);
+ /** Maximum duration of the loan the bank will accept [months] */
+ private static final int MAXLOANTERM = 120;
+ /** Default incoming queue */
+ private static String QUEUE_IN = "queue/C";
+ /** Default outgoing queue */
+ private static String QUEUE_OUT = "queue/D";
+ /** Properties used when constructing the InitialContext */
+ private static Properties properties = new Properties();
+ /** Queue connection for incoming queue */
+ private QueueConnection inQueueConnection;
+
+ /**
+ * The minimum error delay.
+ */
+ private static final long MIN_ERROR_DELAY = 1000 ;
+ /**
+ * The maximum error delay.
+ */
+ private static final long MAX_ERROR_DELAY = (MIN_ERROR_DELAY << 5) ;
+ /**
+ * The error delay.
+ */
+ private long errorDelay ;
+
+
+ /**
+ * Sets up the queue listener. By default is listenes to queue/A on localhost.
+ */
+ public void listen() throws NamingException, JMSException {
+ //MQ Series
+ //properties.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.mq.jms.context.WMQInitialContextFactory");
+ //properties.put(Context.PROVIDER_URL ,
"dev38:1415/SYSTEM.DEF.SVRCONN");
+ //ActiveMQ
+ //properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+ //properties.put(Context.PROVIDER_URL , "tcp://localhost:61616");
+ //JBossMQ
+ /** Context used to lookup the Queues */
+ InitialContext ctx = getContext();
+ try {
+ logger.info("Looking up connection factory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) ctx
+ .lookup("ConnectionFactory");
+ logger.info("Creating connection");
+ inQueueConnection = qcf.createQueueConnection();
+ logger.info("Creating session");
+ QueueSession qs = inQueueConnection.createQueueSession(false,
+ Session.DUPS_OK_ACKNOWLEDGE);
+ logger.info("Looking up queue=" + QUEUE_IN);
+ Queue inQueue=null;
+ try {
+ inQueue = (Queue) ctx.lookup(QUEUE_IN);
+ } catch (NamingException ne) {
+ inQueue = qs.createQueue(QUEUE_IN);
+ }
+ //Queue
+ QueueReceiver qr = qs.createReceiver(inQueue);
+ qr.setMessageListener(this);
+ inQueueConnection.setExceptionListener(this);
+ inQueueConnection.start();
+ } finally {
+ ctx.close();
+ }
+ }
+
+ private InitialContext getContext() throws NamingException {
+ InitialContext ctx;
+ properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
+ properties.put(Context.PROVIDER_URL , "localhost");
+ ctx = new InitialContext(properties);
+ return ctx;
+ }
+
+ /**
+ * Sets up the queue listener. By default is listenes to queue/A on localhost. It
consumes the
+ * message assuming it is a TextMessage, and that the text is an XML structure that can
be marshalled
+ * into a BankQuoteRequest. The request will be processed and a BankQuoteRequest Reply
will be serialized to XML
+ * and send to the outgoing queue (by default this is queue/B on localhost). If the
processing results
+ * in an error a BankQuoteReply with ErrorCode other then 0 is send to the outgoing
queue.
+ *
+ * @see javax.jms.MessageListener#onMessage(javax.jms.Message)
+ * changed this to use a CSV from the request, left the reply as is - dbrum
+ */
+ public void onMessage(Message message) {
+ QueueConnection outQueueConnection;
+ logger.info("Got message: " + message);
+ try {
+ TextMessage textMessage = (TextMessage) message;
+ String xml = textMessage.getText();
+
+ Bank bank = new Bank(BANK_NAME, RATE_PREMIUM, MAXLOANTERM);
+
+ BankQuoteRequest bankQuoteRequest = bank.getQuoteFromXML(xml);
+
+ BankQuoteReply bankQuoteReply = bank
+ .processMessage(bankQuoteRequest);
+
+ XStream xstream = new XStream(new DomDriver());
+ xstream.alias("quote", BankQuoteReply.class);
+
+ String bankQuoteReplyXML = xstream.toXML(bankQuoteReply);
+
+ logger.log(Level.INFO, "Looking up connection factory");
+ InitialContext ctx = getContext();
+ QueueConnectionFactory qcf = (QueueConnectionFactory) ctx
+ .lookup("ConnectionFactory");
+
+ logger.log(Level.INFO, "Creating connection");
+ outQueueConnection = qcf.createQueueConnection();
+ try {
+ logger.log(Level.INFO, "Creating session");
+ QueueSession qs = outQueueConnection.createQueueSession(false,
+ Session.DUPS_OK_ACKNOWLEDGE);
+ Queue outQueue;
+ try {
+ outQueue = (Queue) ctx.lookup(QUEUE_OUT);
+ } catch (NamingException ne) {
+ outQueue = qs.createQueue(QUEUE_OUT);
+ }
+ TextMessage responseTextMessage = qs.createTextMessage(bankQuoteReplyXML);
+
+ QueueSender queueSender = qs.createSender(outQueue);
+
+ queueSender.send(responseTextMessage);
+ logger.info("message being sent back on " + QUEUE_OUT + "\n" +
responseTextMessage);
+ System.out.println("message being sent back on " + QUEUE_OUT +
"\n" + responseTextMessage);
+ } catch (JMSException je) {
+ logger.log(Level.ERROR, je.getMessage(), je);
+ } finally {
+ outQueueConnection.close();
+ }
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Handle an asynchronous exception.
+ * @param jmsException The asynchronous exception
+ */
+ public void onException(final JMSException jmsException) {
+ errorDelay = MIN_ERROR_DELAY ;
+ logger.warn("JMS Connection lost, attempting to reconnect") ;
+
+ while(true)
+ {
+ try {
+ close() ;
+ } catch (final Exception ex) {} // ignore
+
+ try {
+ listen() ;
+ logger.warn("Established connection, continuing with
processing") ;
+ break ;
+ } catch (final Exception ex) {} // ignore
+
+ logger.warn("Error establishing connection, backing off for " +
errorDelay + " milliseconds") ;
+
+ try {
+ Thread.sleep(errorDelay) ;
+ } catch (final InterruptedException ie) {} // ignore
+
+ if (errorDelay < MAX_ERROR_DELAY)
+ {
+ errorDelay <<= 1 ;
+ }
+ }
+
+
+ }
+
+ /**
+ * Closing the queue connection as to not leak connection resources.
+ */
+ public void close() throws JMSException {
+ if (inQueueConnection != null) {
+ inQueueConnection.close();
+ inQueueConnection = null ;
+ }
+ }
+ /**
+ * Invokes an instance of JMS based bank listener.
+ * @param args - provider url, queue_in, queue_out
+ */
+ public static void main(String[] args) {
+ if (args != null && args.length > 0) {
+ if (args.length > 0) {
+ QUEUE_IN = args[1];
+ if (args.length > 1) {
+ QUEUE_OUT = args[2];
+ }
+ }
+ } else {
+ System.out.println(
+ "Usage: ManagerJMS providerURL, queueIn, queueOut");
+ }
+ System.out.println("Starting JMS Bank Listener...");
+ System.out.println("Listening to Queue '" + QUEUE_IN +
"'.");
+ System.out.println("Responding to Queue '" + QUEUE_OUT +
"'.");
+ DOMConfigurator.configure("log4j.xml");
+ ManagerJMS managerJMS = new ManagerJMS();
+ try {
+ managerJMS.listen();
+ } catch (final Exception ex) {
+ logger.error(ex.getMessage(), ex) ;
+ }
+
+ }
+}
\ No newline at end of file
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReplyTest.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReplyTest.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteReplyTest.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigDecimal;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.junit.Test;
+
+import com.thoughtworks.xstream.XStream;
+
+public class BankQuoteReplyTest {
+
+ private Logger logger = Logger.getLogger(this.getClass());
+
+ /**
+ * Testing the XML layout of a BankQuoteReply
+ */
+ @Test public void obtainExampleXML(){
+ BankQuoteReply bankQuoteReply = new BankQuoteReply();
+ bankQuoteReply.setErrorCode(0);
+ bankQuoteReply.setCustomerUID("unique");
+ bankQuoteReply.setInterestRate(BigDecimal.valueOf(11.7));
+ bankQuoteReply.setQuoteId("JBBANK_1");
+
+ XStream xstream = new XStream();
+ String bankQuoteReplyXml=xstream.toXML(bankQuoteReply);
+ logger.info("xml=\n" + bankQuoteReplyXml);
+ String expectedXml =
+ "<org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteReply>\n"
+ + " <interestRate>11.7</interestRate>\n"
+ + " <quoteId>JBBANK_1</quoteId>\n"
+ + " <errorCode>0</errorCode>\n"
+ + " <customerUID>unique</customerUID>\n"
+ +
"</org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteReply>";
+ assertTrue(expectedXml.equals(bankQuoteReplyXml));
+ }
+
+ public static junit.framework.Test suite() {
+ return new JUnit4TestAdapter(BankQuoteReplyTest.class);
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import static org.junit.Assert.assertTrue;
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.junit.Test;
+
+import com.thoughtworks.xstream.XStream;
+
+public class BankQuoteRequestTest {
+
+ private Logger logger = Logger.getLogger(this.getClass());
+
+ /**
+ * Testing the XML layout of a BankQuoteRequest
+ */
+ @Test public void obtainExampleXML(){
+ BankQuoteRequest bankQuoteRequest = new BankQuoteRequest();
+ bankQuoteRequest.setSsn(123456890);
+ bankQuoteRequest.setCreditScore(3);
+ bankQuoteRequest.setHistoryLength(4);
+ bankQuoteRequest.setLoanTerm(5);
+ bankQuoteRequest.setLoanAmount(20000);
+ bankQuoteRequest.setCustomerUID("unique");
+
+ XStream xstream = new XStream();
+ String bankQuoteRequestXml=xstream.toXML(bankQuoteRequest);
+ logger.info("xml=\n" + bankQuoteRequestXml);
+ String expectedXml =
+ "<org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteRequest>\n"
+ + " <ssn>123456890</ssn>\n"
+ + " <creditScore>3</creditScore>\n"
+ + " <historyLength>4</historyLength>\n"
+ + " <loanAmount>20000</loanAmount>\n"
+ + " <loanTerm>5</loanTerm>\n"
+ + " <customerUID>unique</customerUID>\n"
+ + "</org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteRequest>";
+ assertTrue(expectedXml.equals(bankQuoteRequestXml));
+ }
+
+ public static junit.framework.Test suite() {
+ return new JUnit4TestAdapter(BankQuoteRequestTest.class);
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,72 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigDecimal;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+import org.junit.Test;
+
+public class BankTest {
+
+ private Logger logger = Logger.getLogger(this.getClass());
+
+ /**
+ * Tests the computation of the interestRate for the TestBank.
+ *
+ */
+ @Test public void processLoanRequest(){
+
+ //Building a BankQuoteRequest
+ BankQuoteRequest bankQuoteRequest = new BankQuoteRequest();
+ bankQuoteRequest.setSsn(123456890);
+ bankQuoteRequest.setCreditScore(3);
+ bankQuoteRequest.setHistoryLength(4);
+ bankQuoteRequest.setLoanTerm(72);
+ bankQuoteRequest.setLoanAmount(20000);
+ bankQuoteRequest.setCustomerUID("unique");
+ logger.log(Level.INFO, bankQuoteRequest);
+
+ //Getting a Bank Instance
+ String bankName = "TestBank";
+ BigDecimal ratePrimium = BigDecimal.valueOf(0.25);
+ int maxLoanTerm = 120;
+ Bank bank = new Bank(bankName, ratePrimium, maxLoanTerm);
+
+ //Getting a quote from this bank
+ BankQuoteReply bankQuoteReply = bank.processMessage(bankQuoteRequest);
+ logger.log(Level.INFO, bankQuoteReply);
+
+ //Checking for validity
+ BigDecimal expectedInterestRate = BigDecimal.valueOf(8.85);
+ assertTrue(bankQuoteReply.getInterestRate().equals(expectedInterestRate));
+ }
+
+ public static junit.framework.Test suite() {
+ return new JUnit4TestAdapter(BankTest.class);
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/FlatFileProcessorTest.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/FlatFileProcessorTest.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/FlatFileProcessorTest.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,104 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+import org.junit.Test;
+
+public class FlatFileProcessorTest {
+
+ private Logger logger = Logger.getLogger(this.getClass());
+ private static String FLAT_FILE = "FlatFileProcessorTest.txt";
+ /**
+ * Tests the processing of flat file containing a loan quote request. First
+ * we try to find a temporary directory. When this succeeds we drop a
+ * loan request file in there and try to process it.
+ *
+ */
+ @Test public void processRequest()
+ {
+ File writableDir=null;
+ logger.log(Level.INFO, "Check to see if I can write to /tmp");
+ File tmpDir = new File("/tmp");
+ if (tmpDir.exists() && tmpDir.canWrite()) {
+ writableDir=tmpDir;
+ } else {
+ File tempDir = new File("C:/temp");
+ if (tempDir.exists() && tempDir.canWrite()) {
+ writableDir=tempDir;
+ } else {
+ logger.log(Level.ERROR, "Could not find either /tmp or C:\\Temp for a temporary
"
+ + "writing space.");
+ assertTrue(false);
+ }
+ }
+// We found a temp space so now we can drop in a load request file.
+ try {
+ logger.log(Level.INFO, "Creating " + FLAT_FILE + " file in " +
writableDir.getAbsolutePath());
+ File loanRequestFile = new File(writableDir.getAbsolutePath() + "/"+
FLAT_FILE);
+ if (loanRequestFile.exists()) {
+ loanRequestFile.delete();
+ }
+ loanRequestFile.createNewFile();
+ String str="23456890,3,4,20000,5,unique";
+ FileUtil.writeTextFile(loanRequestFile, str);
+
+ logger.log(Level.INFO, "Processing FlatFileProcessorTest.txt");
+ ManagerFlatFile pollManager = new ManagerFlatFile(null);
+ pollManager.processFile(loanRequestFile);
+
+ //Check to see if the file is now moved.
+ assertFalse(loanRequestFile.exists());
+
+ File replyToFile = null;//new File(writableDir.getAbsolutePath() + "/"
+ // + ManagerFlatFile.OUTGOING_DIR + "/" + ManagerFlatFile.PREFIX
+ // + FLAT_FILE);
+ logger.log(Level.INFO, "Check to see if " + replyToFile.getAbsolutePath()
+ + " exists");
+ assertTrue(replyToFile.exists());
+ logger.log(Level.INFO, "OK");
+
+ //Checking the content of the reply
+ logger.log(Level.INFO, "Check the reply, should be
('8.29,FileBasedBank-0,0,unique'");
+ assertTrue("8.29,FileBasedBank-0,0,unique".equals(FileUtil.readTextFile(replyToFile)));
+ logger.log(Level.INFO, "OK");
+ //Cleaning up
+ replyToFile.delete();
+
+ } catch (Throwable e) {
+ logger.log(Level.ERROR,e.getMessage(),e);
+ assertTrue(false);
+ }
+ }
+
+ public static junit.framework.Test suite() {
+ return new JUnit4TestAdapter(FlatFileProcessorTest.class);
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,93 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.loanbroker.banks;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.Properties;
+
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+import org.junit.Test;
+
+public class JmsProcessorTest {
+
+ private Logger logger = Logger.getLogger(this.getClass());
+
+ /**
+ * This can be activate if the server is running and you want
+ * to drop a message on the queue
+ *
+ */
+ @Test public void sendLoanRequestXML()
+ {
+
+ QueueSession sess;
+ Queue queue;
+ try {
+ Properties properties = new Properties();
+
+ //ActiveMQ
+ //properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+ //properties.put(Context.PROVIDER_URL ,
"tcp://localhost:61616");
+ //JBossMQ
+ properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
+ properties.put(Context.PROVIDER_URL , "localhost");
+ InitialContext ctx = new InitialContext(properties);
+
+ QueueConnectionFactory factory = (QueueConnectionFactory) ctx
+ .lookup("ConnectionFactory");
+ QueueConnection cnn = factory.createQueueConnection();
+ sess = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ queue = sess.createQueue("queue/C");
+ //queue = sess.createQueue("queue/C");
+ String str="23456890,3,4,20000,5,unique,kurt.stam(a)jboss.com";
+ TextMessage msg = sess.createTextMessage(str);
+ QueueSender sender = sess.createSender(queue);
+ sender.send(msg);
+ ctx.close();
+ //if the test gets here without errors it passes.
+ assertTrue(true);
+ } catch (Exception e) {
+ //if it fails it may be because the server is not up and the Queue is not found
+ //I'm not letting the test fail, since we may want to do nightly build/test runs
+ //which may not have the server up.
+ logger.log(Level.ERROR, e.getMessage(), e);
+ logger.log(Level.ERROR, "Is the server up and running?");
+ }
+ }
+
+ public static junit.framework.Test suite() {
+ return new JUnit4TestAdapter(JmsProcessorTest.class);
+ }
+}
Added: cdl/trunk/samples/jbossesb/trailblazer/build.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/build.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/build.xml 2008-08-29 16:12:31 UTC (rev 288)
@@ -0,0 +1,259 @@
+<project name="TRAILBLAZER" default="war"
basedir=".">
+
+ <!-- UPDATE THIS WITH YOUR JBOSS_HOME AND SERVER -->
+ <property name="trailblazer.dir" location="."/>
+ <property name="esb.home.dir"
value="${trailblazer.dir}/../.."/>
+
+ <property name="install.dir"
value="${esb.home.dir}/install"/>
+ <property file="${install.dir}/deployment.properties"/>
+
+ <property name="org.jboss.esb.server.home"
value="/home/jeffyu/deploy/jboss-4.2.2.GA"/>
+ <property name="org.jboss.esb.server.config"
value="default"/>
+ <property name="trailblazer.dir" value="."/>
+
+ <!-- properties for the esb part of the trailblazer -->
+ <property name="esb.dest" value="${basedir}/esb/build"/>
+ <property name="classes.dir"
value="${basedir}/esb/build/classes"/>
+ <property name="esb.testclasses.dir"
value="${basedir}/esb/build/classes/tests/"/>
+ <property name="esb.src.dir" value="${basedir}/esb/src"/>
+ <property name="esb.test.dir" value="${basedir}/esb/test"/>
+ <property name="esb.lib.dir" value="${basedir}/esb/lib"/>
+ <property name="report.dir"
value="${basedir}/esb/build/tests"/>
+
+ <!-- properties for the client(web) part of the trailblazer -->
+ <property name="client.dir" value="${basedir}/client"/>
+ <property name="esb.samples.trailblazer.client.dest"
+ value="${basedir}/client/build"/>
+ <property name="esb.samples.trailblazer.client.classes.dir"
+ value="${basedir}/client/build/classes"/>
+ <property name="esb.samples.trailblazer.client.testclasses.dir"
+ value="${basedir}/client/build/classes/tests/"/>
+ <property name="esb.samples.trailblazer.client.src.dir"
+ value="${basedir}/client/src"/>
+ <property name="esb.samples.trailblazer.client.test.dir"
+ value="${basedir}/client/test"/>
+ <property name="esb.samples.trailblazer.client.lib.dir"
+ value="${basedir}/client/lib"/>
+ <property name="esb.samples.trailblazer.client.tests.report.dir"
+ value="${basedir}/client/build/tests"/>
+
+ <property environment="env" />
+
+ <property name="esb.lib.file" value="jbossesb-rosetta.jar"/>
+ <property name="soa.esb.lib.dist.dir"
value="${esb.home.dir}/lib"/>
+ <property name="soa.esb.lib.src.dir"
value="../../build/jbossesb/lib"/>
+
+ <available file="${esb.lib.file}"
+ filepath="${soa.esb.lib.dist.dir}"
+ property="soa.esb.lib.dir"
+ value="${soa.esb.lib.dist.dir}"/>
+
+ <available file="${esb.lib.file}"
+ filepath="${soa.esb.lib.src.dir}"
+ property="soa.esb.lib.dir"
+ value="${soa.esb.lib.src.dir}"/>
+
+ <property name="soa.esb.lib.ext.dir"
value="${soa.esb.lib.dir}/ext"/>
+
+ <property name="target-server"
value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}"
/>
+
+ <!-- classpath -->
+ <path id="esb.samples.trailblazer.esb.classpath">
+ <fileset dir="${soa.esb.lib.dir}/ext" includes="*.jar"/>
+ <fileset dir="${esb.lib.dir}/ext" includes="*.jar"/>
+ <fileset dir="${org.jboss.esb.server.home}/client"
includes="jbossall-client.jar jbossws-client.jar mail.jar"/>
+ <fileset dir="${soa.esb.lib.dir}" includes="*.jar"/>
+ <fileset dir="${esb.samples.trailblazer.client.lib.dir}/ext"
includes="*.jar"/>
+ </path>
+
+ <!-- classpath for running the listener-->
+ <path id="esb.samples.trailblazer.esb.classpath.run">
+ <fileset dir="${soa.esb.lib.ext.dir}"
+ includes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
+ <fileset dir="${esb.dest}/dist"
includes="trailblazer-esb.jar"/>
+ <fileset dir="${esb.home.dir}/lib/ext" includes="*.jar"
excludes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
+ <fileset dir="${soa.esb.lib.ext.dir}" includes="*.jar"
excludes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
+ <fileset dir="${org.jboss.esb.server.home}/client"
includes="jbossall-client.jar jbossws-client.jar mail.jar"/>
+ <fileset dir="${soa.esb.lib.dir}" includes="*.jar"/>
+ <fileset dir="${esb.lib.dir}/ext" includes="*.jar"/>
+ <!-- for finding the jbossesb-properties.xml file -->
+ <pathelement location="${basedir}"/>
+ </path>
+
+ <path id="esb.samples.trailblazer.esb.classpath.client">
+ <fileset dir="${soa.esb.lib.ext.dir}"/>
+ <fileset dir="${esb.lib.dir}/ext" includes="*.jar"/>
+ <fileset dir="${org.jboss.esb.server.home}/client"
includes="jboss-jaxrpc.jar jbossall-client.jar jbossws-client.jar
mail.jar"/>
+ <fileset
dir="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy/jbossws.sar"
includes="jboss-jaxrpc.jar"/>
+ <fileset dir="${soa.esb.lib.dir}" includes="*.jar"/>
+ <fileset dir="${esb.samples.trailblazer.client.lib.dir}/ext"
includes="*.jar"/>
+ <fileset dir="${esb.dest}/dist"
includes="trailblazer-esb.jar"/>
+ <pathelement location="${classes.dir}"/>
+ </path>
+
+ <target name="clean">
+ <delete dir="${esb.dest}"/>
+ <delete dir="${esb.samples.trailblazer.client.dest}"/>
+ </target>
+
+ <target name="messaging-config">
+ <property name="org.jboss.esb.server.deploy.dir"
+ value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy"/>
+ <condition property="messaging.present">
+ <available
file="${org.jboss.esb.server.deploy.dir}/jboss-messaging"/>
+ </condition>
+ <condition property="messaging.present">
+ <available
file="${org.jboss.esb.server.deploy.dir}/jboss-messaging.sar"/>
+ </condition>
+
+ <condition property="jbossmq.present">
+ <not>
+ <isset property="messaging.present"/>
+ </not>
+ </condition>
+ </target>
+
+ <!-- dependencies specific to JBoss Messaging -->
+ <target name="messaging-dependencies"
if="messaging.present">
+ <property name="jms.service.file"
value="jbm-queue-service.xml"/>
+ <property name="jms.description" value="JBoss
Messaging"/>
+ </target>
+
+ <!-- dependencies specific to JBoss MQ -->
+ <target name="jbossmq-dependencies" if="jbossmq.present">
+ <property name="jms.service.file"
value="jbmq-queue-service.xml"/>
+ <property name="jms.description" value="JBoss MQ"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Prepares the directory structure -->
+ <!-- =================================================================== -->
+ <target name="esb.built" unless="soa.esb.lib.dir">
+ <echo>Please build the ESB with "ant dist" in the ESB
parent</echo>
+ <echo>directory in order to run the Trailblazer application.</echo>
+ <fail>Please build ESB first.</fail>
+ </target>
+
+ <target name="trailblazer.prepare" depends="esb.built,clean"
if="soa.esb.lib.dir">
+ <mkdir dir="${esb.dest}"/>
+ <mkdir dir="${esb.dest}/dist"/>
+ <mkdir dir="${esb.dest}/classes"/>
+ <mkdir dir="${esb.samples.trailblazer.client.dest}"/>
+ <mkdir dir="${esb.samples.trailblazer.client.dest}/dist"/>
+ <mkdir dir="${esb.samples.trailblazer.client.dest}/classes"/>
+ </target>
+
+ <!-- Compilation targets -->
+ <!-- ___________________ -->
+
+ <!-- ESB COMPILATION -->
+ <target name="esb.compile"
+ depends="trailblazer.prepare"
+ description="Compiling Trailblazer ESB classes">
+ <javac
+ destdir="${classes.dir}"
+ classpathref="esb.samples.trailblazer.esb.classpath"
+ debug="true">
+ <src path="${esb.src.dir}"/>
+ </javac>
+ </target>
+
+ <!-- CLIENT(WEB) COMPILATION -->
+ <target name="client.compile"
+ depends="trailblazer.prepare"
+ description="Compiling Trailblazer client classes">
+
+ <javac destdir="${esb.samples.trailblazer.client.classes.dir}"
+ classpathref="esb.samples.trailblazer.esb.classpath.client"
debug="true">
+ <src path="${esb.samples.trailblazer.client.src.dir}"/>
+ </javac>
+ </target>
+
+ <!-- JAR/WAR targets -->
+ <target name="esb.jar" depends="messaging-config,
messaging-dependencies, jbossmq-dependencies, compile" >
+ <property name="esb.build.dir" value="${esb.dest}" />
+
+ <echo>${jms.service.file}</echo>
+
+ <!-- ESB Client JAR -->
+ <echo message="Building Trailblazer ESB archives"/>
+ <jar destfile="${esb.build.dir}/dist/trailblazer-esb.jar"
+ basedir="${classes.dir}"
+ includes="**/*.class" excludes="**/web/*.class">
+ </jar>
+ <!-- ESB Deployment (.esb) -->
+ <copy todir="${esb.build.dir}/META-INF">
+ <fileset dir="esb/conf"
includes="jboss-esb.xml,deployment.xml" />
+ </copy>
+ <jar destfile="${esb.build.dir}/dist/trailblazer.esb">
+ <fileset dir="${classes.dir}"
excludes="**/web/*.class" />
+ <fileset dir="${esb.build.dir}"
includes="META-INF/**" />
+ <fileset dir="${basedir}/esb/conf"
includes="${jms.service.file}"/>
+ <fileset dir="${basedir}/esb/conf"
includes="smooks-*.xml,*.xsl" />
+ <fileset dir="${basedir}/esb/conf"
includes="jbossesb-properties.xml" />
+ <fileset dir="${basedir}"
includes="trailblazer.properties,template/**,models/**" />
+ </jar>
+ </target>
+
+ <target name="war" depends="compile">
+
+ <!-- Web side WAR -->
+ <echo message="Building Trailblazer WAR file"/>
+ <delete file="${esb.samples.trailblazer.client.dest}/dist/trailblazer.war"
/>
+ <war
warfile="${esb.samples.trailblazer.client.dest}/dist/trailblazer.war"
+ webxml="${basedir}/client/resources/web.xml">
+ <classes dir="${esb.samples.trailblazer.client.classes.dir}">
+ <include name="**/loanbroker/*.class"/>
+ <include name="**/trailblazer/web/*.class"/>
+ <include name="trailblazer.properties"/>
+ </classes>
+ <webinf dir="${basedir}/client/resources">
+ <include name="wsdl/*"/>
+ </webinf>
+ <lib dir="${esb.dest}/dist">
+ <include name="trailblazer-esb.jar"/>
+ </lib>
+ <fileset dir="client/jsp">
+ <include name="**/*.jsp"/>
+ </fileset>
+ </war>
+ </target>
+
+
+ <target name="deploy" depends="jar, war">
+ <echo message="Deploying Trailblazer EAR and WAR files to target server
'${target-server}'."/>
+ <copy todir="${target-server}/deploy">
+ <fileset dir="${esb.dest}/dist/"
includes="trailblazer.esb" />
+ <fileset dir="${esb.samples.trailblazer.client.dest}/dist/"
includes="trailblazer.war" />
+ </copy>
+ </target>
+
+ <target name="undeploy">
+ <delete file="${target-server}/deploy/trailblazer.esb"
/>
+ <delete file="${target-server}/deploy/trailblazer.war"
/>
+ </target>
+
+
+ <!-- Short target names -->
+ <target name="compile" depends="esb.compile,client.compile"/>
+ <target name="jar" depends="esb.jar"/>
+
+ <!-- run the ESB listeners -->
+ <!-- set the first argument to 0 for an indefinite run for the listener launcher
-->
+ <!-- arg1 = # of seconds to let the listener threads run -->
+ <!-- arg2 = location of the esb config file which describes the listener
configurations for a Message aware listener config -->
+ <!-- arg3 (if any) = location of the esb config file which describes the listener
configurations for a NON-Message aware listener config (gateway)-->
+ <target name="runESB" depends="jar">
+ <echo>Running ESB Trailblazer listeners</echo>
+ <java fork="yes"
classname="org.jboss.soa.esb.listeners.StandAloneBootStrapper"
failonerror="true">
+ <jvmarg
value="-Dorg.jboss.soa.esb.propertyFile=${trailblazer.dir}/esb/jbossesb-properties.xml"/>
+ <arg value="${trailblazer.dir}/esb/conf/jboss-esb.xml"/>
+ <classpath refid="esb.samples.trailblazer.esb.classpath.run"/>
+ </java>
+ </target>
+
+ <!-- javadocs paths -->
+ <path id="esb.samples.trailblazer.esb.javadocs.path">
+ <pathelement path="esb/classes"/>
+ </path>
+</project>
Added: cdl/trunk/samples/jbossesb/trailblazer/client/jsp/index.jsp
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/client/jsp/index.jsp
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/client/jsp/index.jsp 2008-08-29 16:12:31 UTC
(rev 288)
@@ -0,0 +1,134 @@
+<%@ page
import="org.jboss.soa.esb.samples.trailblazer.web.WebCustomer"%>
+<%@ page
import="org.jboss.soa.esb.samples.trailblazer.loanbroker.LoanRequester"%>
+<%
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+String[] formHeader = {"Name", "Address", "SSN",
"Email", "Salary", "Employer", "LoanAmount",
"LoanDuration"};
+String[] formValue = new String[formHeader.length];
+
+String errors = "";
+int errorCount=0;
+
+for (int i=0; i<formValue.length;i++) {
+ formValue[i] = String.valueOf(request.getParameter(formHeader[i]));
+ //out.write(formHeader[i] + "=" + formValue[i] + "<br>");
+ if ("null".equals(formValue[i]) || formValue[i]==null ||
"".equals(formValue[i])) {
+ formValue[i]="";
+ errorCount++;
+ errors += formHeader[i] + " is a required field<br>";
+ }
+}
+//It's a new form. Let's set some default values.
+if (errorCount==formHeader.length) {
+ formValue[0]="Joe Broke";
+ formValue[1]="1 Spenditall Str., BrokeTown 99999 DC";
+ formValue[2]="1234567890";
+ formValue[3]="joe(a)iliketospendit.com";
+ formValue[4]="50000.00";
+ formValue[5]="Wesayso & Co";
+ formValue[6]="1000.00";
+ formValue[7]="12";
+}
+
+%>
+<html>
+<head>
+<title>JBossESB Loan Broker</title>
+<link rel="shortcut icon" href="/favicon.ico"/>
+<link rel="stylesheet"
href="http://www.jboss.com/themes/jbosstheme/style/custom.css"
type="text/css" media="all">
+<link rel="stylesheet"
href="http://www.jboss.com/themes/jbosstheme/style/global.css"
type="text/css" media="all">
+<link rel="stylesheet"
href="http://www.jboss.com/themes/jbosstheme/style/headings.css"
type="text/css" media="all">
+<link rel="stylesheet"
href="http://www.jboss.com/themes/jbosstheme/style/layout.css"
type="text/css" media="all">
+<link rel="stylesheet"
href="http://www.jboss.com/themes/jbosstheme/style/navigation.css"
type="text/css" media="all">
+<link rel="stylesheet"
href="http://www.jboss.com/themes/jbosstheme/style/pagelayout.css"
type="text/css" media="all">
+<link rel="stylesheet"
href="http://www.jboss.com/themes/jbosstheme/style/tables.css"
type="text/css" media="all">
+
+<link rel="stylesheet"
href="http://www.jboss.com/themes/jbosstheme/style/screen.css"
type="text/css" media="screen">
+<link rel="stylesheet"
href="http://www.jboss.com/themes/jbosstheme/style/print.css"
type="text/css" media="print">
+<link rel="stylesheet"
href="http://www.jboss.com/themes/jbosstheme/style/common.css"
type="text/css" media="all">
+</head>
+<body>
+
+<div id="TopLogo">
+ <a href="http://www.jboss.com"><img
src="http://www.jboss.com/themes/jbosstheme/img/logo.gif" alt="JBoss - The
Professional Open Source Company" border="0" /></a>
+</div>
+
+<div id="TopMenu">
+ <table cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="menu_JBnetwork"><a
href="http://network.jboss.com/">subscription</a></...
+ <td class="menu_JBcom"><a
href="http://www.jboss.com/">jboss.com</a></td>
+
+ <td class="menu_JBorg"><a
href="http://labs.jboss.com">jboss.org</a></td>
+ <td class="menu_RH"><a
href="http://www.redhat.com">redhat.com</a></td>
+ </tr>
+ </table>
+</div>
+
+
+<% if (errorCount!=0) { %>
+<form id="formLoanBrokerRequest" action="index.jsp"
method="post">
+
+<table width="100%" border="0" cellpadding="10"
cellspacing="3">
+ <tr><td
colspan="2"><br><br><br><br>
+ <tr><td colspan="2"><h1>Loan Broker Request
Form</h1></td></tr>
+ <% if (errorCount < formHeader.length) { %>
+ <tr><td colspan="2"><font
color="red"><%=errors %></font></td></tr>
+ <% } %>
+ <% for (int i=0; i<formHeader.length;i++) { %>
+ <tr>
+ <td width="30%" nowrap><%=formHeader[i] %></td>
+ <td width="70%"><input id="<%=formHeader[i] %>"
name="<%=formHeader[i] %>" type="text"
+ class="textBox" tabindex="1" size="60"
value="<%=formValue[i] %>" /></td>
+ </tr>
+ <% } %>
+
+ <tr>
+ <td><INPUT TYPE="submit" VALUE="submit loan
request"> </td>
+ </tr>
+</table>
+
+</form>
+
+<% } else {
+ //Setting the values in the request
+ WebCustomer webCustomer = new WebCustomer();
+ webCustomer.setName(formValue[0]);
+ webCustomer.setAddress(formValue[1]);
+ webCustomer.setSsn(Integer.valueOf(formValue[2]).intValue());
+ webCustomer.setEmail(formValue[3]);
+ webCustomer.setSalary(Double.valueOf(formValue[4]).doubleValue());
+ webCustomer.setEmployerName(formValue[5]);
+ webCustomer.setLoanAmount(Double.valueOf(formValue[6]).doubleValue());
+ webCustomer.setLoanDuration(Integer.valueOf(formValue[7]).intValue());
+ LoanRequester.request(webCustomer);
+%>
+ <table width="100%" border="0" cellpadding="10"
cellspacing="3">
+ <tr><td><br><br><br><br>
+ <tr><td><h1>Loan Broker</h1></td></tr>
+ <tr><td><h2>Request was
submitted</h2></td></tr>
+ <tr><td><a href="index.jsp">Fill out another
request</a></td></tr>
+
+ <% } %>
+</body>
+</html>
Added: cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/Licenses.txt
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/Licenses.txt
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/Licenses.txt 2008-08-29 16:12:31
UTC (rev 288)
@@ -0,0 +1,479 @@
+The jars in this directory are covered by a range of licences, as described
+below.
+
+JBoss jars:
+
+/*
+ *
+ * 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,
+ */
+
+
+Apache Jakarta Commons Collections/Commons Logging/Axis/Log4j:
+
+Apache License
+ Version 2.0, January 2004
+
http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ JUnit
+
+ Common Public License Version 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
+LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
+CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate from and are
+distributed by that particular Contributor. A Contribution 'originates' from a
+Contributor if it was added to the Program by such Contributor itself or anyone
+acting on such Contributor's behalf. Contributions do not include additions to
+the Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are
+necessarily infringed by the use or sale of its Contribution alone or when
+combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this
Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement,
+including all Contributors.
+
+2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free copyright license to
+reproduce, prepare derivative works of, publicly display, publicly perform,
+distribute and sublicense the Contribution of such Contributor, if any, and such
+derivative works, in source code and object code form.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
+Patents to make, use, sell, offer to sell, import and otherwise transfer the
+Contribution of such Contributor, if any, in source code and object code form.
+This patent license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other combinations
+which include the Contribution. No hardware per se is licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the licenses
+to its Contributions set forth herein, no assurances are provided by any
+Contributor that the Program does not infringe the patent or other intellectual
+property rights of any other entity. Each Contributor disclaims any liability to
+Recipient for claims brought by any other entity based on infringement of
+intellectual property rights or otherwise. As a condition to exercising the
+rights and licenses granted hereunder, each Recipient hereby assumes sole
+responsibility to secure any other intellectual property rights needed, if any.
+For example, if a third party patent license is required to allow Recipient to
+distribute the Program, it is Recipient's responsibility to acquire that license
+before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright license set
+forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its
+own license agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement; and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title and
+non-infringement, and implied warranties or conditions of merchantability and
+fitness for a particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all liability for
+damages, including direct, indirect, special, incidental and consequential
+damages, such as lost profits;
+
+ iii) states that any provisions which differ from this Agreement are offered
+by that Contributor alone and not by any other party; and
+
+ iv) states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable manner on or
+through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the
+Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if
+any, in a manner that reasonably allows subsequent Recipients to identify the
+originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with
+respect to end users, business partners and the like. While this license is
+intended to facilitate the commercial use of the Program, the Contributor who
+includes the Program in a commercial product offering should do so in a manner
+which does not create potential liability for other Contributors. Therefore, if
+a Contributor includes the Program in a commercial product offering, such
+Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any losses,
damages
+and costs (collectively "Losses") arising from claims, lawsuits and other
legal
+actions brought by a third party against the Indemnified Contributor to the
+extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor to
+control, and cooperate with the Commercial Contributor in, the defense and any
+related settlement negotiations. The Indemnified Contributor may participate in
+any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product
+offering, Product X. That Contributor is then a Commercial Contributor. If that
+Commercial Contributor then makes performance claims, or offers warranties
+related to Product X, those performance claims and warranties are such
+Commercial Contributor's responsibility alone. Under this section, the
+Commercial Contributor would have to defend claims against the other
+Contributors related to those performance claims and warranties, and if a court
+requires any other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
+Recipient is solely responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its exercise of
+rights under this Agreement, including but not limited to the risks and costs of
+program errors, compliance with applicable laws, damage to or loss of data,
+programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
+CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable
+law, it shall not affect the validity or enforceability of the remainder of the
+terms of this Agreement, and without further action by the parties hereto, such
+provision shall be reformed to the minimum extent necessary to make such
+provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to
+a patent applicable to software (including a cross-claim or counterclaim in a
+lawsuit), then any patent licenses granted by that Contributor to such Recipient
+under this Agreement shall terminate as of the date such litigation is filed. In
+addition, if Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
+itself (excluding combinations of the Program with other software or hardware)
+infringes such Recipient's patent(s), then such Recipient's rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to
+comply with any of the material terms or conditions of this Agreement and does
+not cure such failure in a reasonable period of time after becoming aware of
+such noncompliance. If all Recipient's rights under this Agreement terminate,
+Recipient agrees to cease use and distribution of the Program as soon as
+reasonably practicable. However, Recipient's obligations under this Agreement
+and any licenses granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in
+order to avoid inconsistency the Agreement is copyrighted and may only be
+modified in the following manner. The Agreement Steward reserves the right to
+publish new versions (including revisions) of this Agreement from time to time.
+No one other than the Agreement Steward has the right to modify this Agreement.
+IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
+as the Agreement Steward to a suitable separate entity. Each new version of the
+Agreement will be given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the Agreement
+is published, Contributor may elect to distribute the Program (including its
+Contributions) under the new version. Except as expressly stated in Sections
+2(a) and 2(b) above, Recipient receives no rights or licenses to the
+intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to this
+Agreement will bring a legal action under this Agreement more than one year
+after the cause of action arose. Each party waives its rights to a jury trial in
+any resulting litigation.
+
+
+
+XStream, Antlr, Stingtemplate BSD License
+
+Copyright (c) 2003-2005, Joe Walnes
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of
+conditions and the following disclaimer. Redistributions in binary form must reproduce
+the above copyright notice, this list of conditions and the following disclaimer in
+the documentation and/or other materials provided with the distribution.
+
+Neither the name of XStream nor the names of its contributors may be used to endorse
+or promote products derived from this software without specific prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+
Added: cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jaxb-api.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jaxb-api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jboss-jaxws.jar
===================================================================
(Binary files differ)
Property changes on:
cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jboss-jaxws.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jbossws-client.jar
===================================================================
(Binary files differ)
Property changes on:
cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jbossws-client.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jbossws-core.jar
===================================================================
(Binary files differ)
Property changes on:
cdl/trunk/samples/jbossesb/trailblazer/client/lib/ext/jbossws-core.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/client/resources/jaxrpc-mapping.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/client/resources/jaxrpc-mapping.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/client/resources/jaxrpc-mapping.xml 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,69 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping
version='1.1'
xmlns='http://java.sun.com/xml/ns/j2ee'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.soa.esb.samples.trailblazer.web</package-type>
+ <namespaceURI>http://org.jboss.ws/samples/rpcstyle/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+
<java-type>org.jboss.soa.esb.samples.trailblazer.web.WebCustomer</java-type>
+ <root-type-qname
xmlns:typeNS='http://org.jboss.ws/samples/rpcstyle/types'>typeNS:WebCustomer</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>address</java-variable-name>
+ <xml-element-name>address</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>email</java-variable-name>
+ <xml-element-name>email</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>employerName</java-variable-name>
+ <xml-element-name>employerName</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>loanAmount</java-variable-name>
+ <xml-element-name>loanAmount</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>loanDuration</java-variable-name>
+ <xml-element-name>loanDuration</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>name</java-variable-name>
+ <xml-element-name>name</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>salary</java-variable-name>
+ <xml-element-name>salary</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>ssn</java-variable-name>
+ <xml-element-name>ssn</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+
<service-interface>org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerService</service-interface>
+ <wsdl-service-name
xmlns:serviceNS='http://org.jboss.ws/samples/rpcstyle'>serviceNS:LoanBrokerService</wsdl-service-name>
+ <port-mapping>
+ <port-name>LoanBrokerInterfacePort</port-name>
+ <java-port-name>LoanBrokerInterfacePort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+
<service-endpoint-interface>org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerInterface</service-endpoint-interface>
+ <wsdl-port-type
xmlns:portTypeNS='http://org.jboss.ws/samples/rpcstyle'>portTypeNS:LoanBrokerInterface</wsdl-port-type>
+ <wsdl-binding
xmlns:bindingNS='http://org.jboss.ws/samples/rpcstyle'>bindingNS:LoanBrokerInterfaceBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>RequestLoan</java-method-name>
+ <wsdl-operation>RequestLoan</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+
<param-type>org.jboss.soa.esb.samples.trailblazer.web.WebCustomer</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS='http://org.jboss.ws/samples/rpcstyle'>wsdlMsgNS:LoanBrokerInterface_RequestLoan</wsdl-message>
+ <wsdl-message-part-name>WebCustomer_1</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Added: cdl/trunk/samples/jbossesb/trailblazer/client/resources/web.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/client/resources/web.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/client/resources/web.xml 2008-08-29 16:12:31
UTC (rev 288)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
+ <servlet>
+ <servlet-name>LoanBroker</servlet-name>
+ <servlet-class>org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerBean</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>LoanBroker</servlet-name>
+ <url-pattern>/LoanBroker</url-pattern>
+ </servlet-mapping>
+</web-app>
Added: cdl/trunk/samples/jbossesb/trailblazer/client/resources/webservices.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/client/resources/webservices.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/client/resources/webservices.xml 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,15 @@
+<webservices version='1.1'
xmlns='http://java.sun.com/xml/ns/j2ee'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
+ <webservice-description>
+
<webservice-description-name>LoanBrokerService</webservice-description-name>
+ <wsdl-file>WEB-INF/wsdl/LoanBrokerService.wsdl</wsdl-file>
+ <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
+ <port-component>
+ <port-component-name>LoanBrokerInterfacePort</port-component-name>
+ <wsdl-port
xmlns:portNS='http://org.jboss.ws/samples/rpcstyle'>portNS:LoanBrokerInterfacePort</wsdl-port>
+
<service-endpoint-interface>org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerInterface</service-endpoint-interface>
+ <service-impl-bean>
+ <servlet-link>LoanBroker</servlet-link>
+ </service-impl-bean>
+ </port-component>
+ </webservice-description>
+</webservices>
Added:
cdl/trunk/samples/jbossesb/trailblazer/client/resources/wsdl/LoanBrokerService.wsdl
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/client/resources/wsdl/LoanBrokerService.wsdl
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/client/resources/wsdl/LoanBrokerService.wsdl 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,45 @@
+<definitions name='LoanBrokerService'
targetNamespace='http://localhost/trailblazer'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://localhost/trailblazer'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <xs:schema targetNamespace='http://localhost/trailblazer'
version='1.0'
xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:complexType name='webCustomer'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='address'
type='xs:string'/>
+ <xs:element minOccurs='0' name='email'
type='xs:string'/>
+ <xs:element minOccurs='0' name='employerName'
type='xs:string'/>
+ <xs:element name='loanAmount' type='xs:double'/>
+ <xs:element name='loanDuration' type='xs:int'/>
+ <xs:element minOccurs='0' name='name'
type='xs:string'/>
+ <xs:element name='salary' type='xs:double'/>
+ <xs:element name='ssn' type='xs:int'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name='LoanBrokerInterface_RequestLoan'>
+ <part name='webCustomer_1' type='tns:webCustomer'></part>
+ </message>
+ <message name='LoanBrokerInterface_RequestLoanResponse'></message>
+ <portType name='LoanBrokerInterface'>
+ <operation name='RequestLoan' parameterOrder='webCustomer_1'>
+ <input message='tns:LoanBrokerInterface_RequestLoan'></input>
+ <output
message='tns:LoanBrokerInterface_RequestLoanResponse'></output>
+ </operation>
+ </portType>
+ <binding name='LoanBrokerInterfaceBinding'
type='tns:LoanBrokerInterface'>
+ <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='RequestLoan'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://localhost/trailblazer'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://localhost/trailblazer'
use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='LoanBrokerService'>
+ <port binding='tns:LoanBrokerInterfaceBinding'
name='LoanBrokerInterfacePort'>
+ <soap:address location='http://127.0.0.1:8080/trailblazer/LoanBroker'/>
+ </port>
+ </service>
+</definitions>
Added: cdl/trunk/samples/jbossesb/trailblazer/client/resources/wstools-config.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/client/resources/wstools-config.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/client/resources/wstools-config.xml 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ wstools -cp ../../../output/classes -config wstools-config.xml
+-->
+
+<configuration
xmlns="http://www.jboss.org/jbossws-tools"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.org/jbossws-tools
http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+
+ <java-wsdl>
+ <service name="LoanBrokerService" style="rpc"
endpoint="org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerInterface"/>
+ <namespaces target-namespace="http://org.jboss.ws/samples/rpcstyle"
type-namespace="http://org.jboss.ws/samples/rpcstyle/types"/>
+ <mapping file="jaxrpc-mapping.xml"/>
+ <webservices servlet-link="LoanBrokerEndpoint"/>
+ </java-wsdl>
+
+</configuration>
Added:
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/Customer.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/Customer.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/Customer.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,59 @@
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+/*
+ * 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 mark.little(a)jboss.com
+ */
+
+import java.io.Serializable;
+
+public class Customer implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ public String name="" ,address="" ,employerName="";
+ public double salary=0.0 ,loanAmount=0.0;
+ public int loanDuration=0;
+ public int ssn=0;
+ public String email="";
+ public int creditScore=0;
+ public String quoteID, rateOffered, quoteCode;
+
+ public String getCSV() {
+ String buff =
(name+","+ssn+","+address+","+employerName+","+salary+","
+ +loanAmount+","+loanDuration+","+email+","+creditScore);
+
+ return buff;
+ }
+
+ public String getXML() {
+ StringBuffer ret=new StringBuffer();
+
+ ret.append("<creditCheck name=\""+name+"\" ");
+ ret.append("ssn=\""+ssn+"\" ");
+ ret.append("address=\""+address+"\" ");
+ ret.append("employerName=\""+employerName+"\" ");
+ ret.append("salary=\""+salary+"\" ");
+ ret.append("loanAmount=\""+loanAmount+"\" ");
+ ret.append("loanDuration=\""+loanDuration+"\" ");
+ ret.append("email=\""+email+"\" ");
+ ret.append("creditScore=\""+creditScore+"\" />");
+
+ return(ret.toString());
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/CustomerMasterFile.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/CustomerMasterFile.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/CustomerMasterFile.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,88 @@
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+/*
+ * 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 mark.little(a)jboss.com
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/*
+ * Utility class used to persist the customer quote requests to a serialized Hash list on
the file system
+ * Key is the customer's SSN #
+ */
+
+public class CustomerMasterFile implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private static Map<String, Customer> customers;
+ private static final String TMP_DIR =
System.getProperty("java.io.tmpdir","/tmp");
+ private static final File FILE = new File(TMP_DIR, "customers");
+
+ static {
+ getCustomers();
+ }
+
+ public static synchronized void writeCustomers() {
+ try {
+ ObjectOutputStream stream = new ObjectOutputStream(new FileOutputStream(FILE));
+ stream.writeObject(customers);
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ }
+
+ @SuppressWarnings("unchecked")
+ public static synchronized void getCustomers() {
+
+ try {
+ ObjectInputStream ois = new ObjectInputStream(new FileInputStream(FILE));
+ customers = (Map<String, Customer>)ois.readObject();
+ } catch (Exception e) {
+ customers = new HashMap<String, Customer>();
+ }
+
+ }
+
+ public static Customer getCustomer(String id) {
+ return customers.get(id);
+ }
+
+ public static void addCustomer(String id, Customer customer) {
+ customers.put(id, customer);
+ writeCustomers();
+ }
+
+
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,228 @@
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+/*
+ * 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 mark.little(a)jboss.com
+ */
+
+
+import java.util.Properties;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+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.samples.trailblazer.util.TrailblazerProperties;
+import org.jboss.soa.esb.samples.trailblazer.web.WebCustomer;
+import org.jboss.soa.esb.client.ServiceInvoker;
+
+/*
+ * LoanBroker is responsible for getting customer requests for loans onto the JBoss ESB
+ * Requests will come from a JSR-181 pojo web service
(@org.jboss.soa.esb.samples.trailblazer.web.LoanBrokerWS)
+ * The sequence of events from the LoanBroker are:
+ * 1 - Prepare a request for the CreditAgency (transform the customer into a XML
representation)
+ * 2 - Send to CreditAgency and get response (lookup the customer using the SSN (see
@CustomerMasterFile)
+ * 3 - Prepare a LoanRequest for each of the banks in their unique data structures and
send
+ * 4 - Collect the response(s) from the bank(s) and send an email to the customer with
the quote offers
+ */
+
+public class LoanBroker {
+
+ private static Logger logger = Logger.getLogger(LoanBroker.class);
+ //used to locate our entries in the trailblazer-properties
+ private final String CREDIT_AGENCY_SERVICE_NAME =
"creditagency.service.epr.name";
+ private final String CREDIT_AGENCY_SERVICE_CAT =
"creditagency.service.category";
+ private final String BANK1_SERVICE_NAME = "bank1.service.epr.name";
+ private final String BANK1_SERVICE_CAT = "bank1.service.category";
+ private final String BANK2_SERVICE_NAME = "bank2.service.epr.name";
+ private final String BANK2_SERVICE_CAT = "bank2.service.category";
+ private final String NOTIFIER_SERVICE_NAME = "notifier.service.epr.name";
+ private final String NOTIFIER_SERVICE_CAT = "notifier.service.category";
+ private Properties properties = new TrailblazerProperties();
+ private ServiceInvoker serviceInvoker;
+ private ServiceInvoker bank1Invoker;
+ private ServiceInvoker bank2Invoker;
+ private ServiceInvoker notifierInvoker;
+
+ public LoanBroker() {
+ String serviceCategoryName = properties.getProperty(CREDIT_AGENCY_SERVICE_CAT);
+ String serviceName = properties.getProperty(CREDIT_AGENCY_SERVICE_NAME);
+ String bank1ServiceCategoryName = properties.getProperty(BANK1_SERVICE_CAT);
+ String bank1ServiceName = properties.getProperty(BANK1_SERVICE_NAME);
+ String bank2ServiceCategoryName = properties.getProperty(BANK2_SERVICE_CAT);
+ String bank2ServiceName = properties.getProperty(BANK2_SERVICE_NAME);
+ String notifierServiceCategoryName =
properties.getProperty(NOTIFIER_SERVICE_CAT);
+ String notifierServiceName = properties.getProperty(NOTIFIER_SERVICE_NAME);
+
+ try {
+ serviceInvoker = new ServiceInvoker(serviceCategoryName, serviceName);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to create ServiceInvoker for
'" + serviceCategoryName + ":" + serviceName + "'.", e);
+ }
+
+ try {
+ bank1Invoker = new ServiceInvoker(bank1ServiceCategoryName,
bank1ServiceName);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to create ServiceInvoker for
'" + bank1ServiceCategoryName + ":" + bank1ServiceName +
"'.", e);
+ }
+
+ try {
+ bank2Invoker = new ServiceInvoker(bank2ServiceCategoryName,
bank2ServiceName);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to create ServiceInvoker for
'" + bank2ServiceCategoryName + ":" + bank2ServiceName +
"'.", e);
+ }
+
+ try {
+ notifierInvoker = new ServiceInvoker(notifierServiceCategoryName,
notifierServiceName);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to create ServiceInvoker for
'" + notifierServiceCategoryName + ":" + notifierServiceName +
"'.", e);
+ }
+ }
+
+ public void processLoanRequest(WebCustomer wCustomer) {
+
+ Customer customer = getCustomer(wCustomer);
+ //keep the customer in a file someplace for later use, if needed
+ CustomerMasterFile.addCustomer(String.valueOf(customer.ssn), customer);
+
+ //step 1 - send to credit agency for credit score if available
+
+ int score=sendToCreditAgency(customer);
+
+ //added a pause here to give the creditagency some time to reply
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ //step 2 - check if score is acceptable
+
+ if (score >= 4) {
+ //step 3a - send to Bank - async
+ System.out.println("sending to first Bank...");
+ sendToBank(bank1Invoker, customer, "b1");
+
+ System.out.println("sending to second Bank...");
+ sendToBank(bank2Invoker, customer, "b2");
+ } else {
+ //step 3b - notify customer that credit is not acceptable
+ String
invalidCredit="<insufficientCredit><customerUID>"+customer.ssn+"</customerUID>"
+
+ "<ref>0</ref>"+
+
"<customerEmail>"+customer.email+"</customerEmail>" +
+
"<errorCode>3</errorCode></insufficientCredit>";
+
+ Message notifyMessage =
MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+ notifyMessage.getBody().add(invalidCredit);
+
+ try {
+ notifierInvoker.deliverAsync(notifyMessage);
+ } catch (Exception e) {
+ logger.error(e);
+ }
+ }
+ }
+
+ private Customer getCustomer(WebCustomer wCustomer) {
+ Customer customer = new Customer();
+ customer.ssn = wCustomer.getSsn();
+ customer.name = wCustomer.getName();
+ customer.address = wCustomer.getAddress();
+ customer.email = wCustomer.getEmail();
+ customer.salary = wCustomer.getSalary();
+ customer.loanAmount = wCustomer.getLoanAmount();
+ customer.loanDuration = wCustomer.getLoanDuration();
+ customer.creditScore = 0;
+
+ return customer;
+ }
+
+
+ private void sendToBank(ServiceInvoker invoker, Customer customer, String ref) {
+ Message message =
MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+ try {
+ //create a Quote Request that the bank expects
+ QuoteRequest quote = new QuoteRequest();
+ quote.ssn = customer.ssn;
+ quote.ref = ref;
+ quote.amount = (int) customer.loanAmount;
+ quote.creditScore = customer.creditScore;
+ quote.creditHistoryLen = 0; //not sure who added this one
+ quote.term = customer.loanDuration;
+ quote.customerEmail = customer.email;
+
+ message.getBody().add(quote.getXML());
+ invoker.deliverAsync(message);
+
+ } catch (Exception e) {
+ logger.error(e);
+ }
+ }
+
+ private int sendToCreditAgency(Customer customer) {
+ Message message =
MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+ Message replyMessage;
+ int score = 0;
+
+ try {
+ logger.debug("sending to credit agency");
+
+ //set the customer details inside the message
+ message.getBody().add(customer.getXML());
+
+ logger.info("Sending request to creditAgency: " +
message.getBody().get());
+
+ replyMessage = serviceInvoker.deliverSync(message, 5000);
+ if (replyMessage != null) {
+ logger.info("received reply from creditAgency action: " +
replyMessage.getBody().get());
+
+ String xml =(String)replyMessage.getBody().get();
+
+ DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+ fact.setNamespaceAware(true);
+
+ java.io.InputStream xmlstr=
+ new java.io.ByteArrayInputStream(xml.getBytes());
+
+ DocumentBuilder builder=fact.newDocumentBuilder();
+ org.w3c.dom.Document doc=builder.parse(xmlstr);
+
+ org.w3c.dom.Element tree = doc.getDocumentElement();
+
+ score = Integer.parseInt(tree.getAttribute("score"));
+
+ logger.debug("Score from XML is: "+score);
+ } else {
+ logger.debug("reply not received from credit agency - setting a
value of 5");
+ score = 5;
+ }
+ } catch (Exception ex2) {
+ logger.error("exception occured: " + ex2);
+ }
+
+ return score;
+ }
+
+
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanRequester.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanRequester.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanRequester.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,34 @@
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.net.URL;
+import org.jboss.soa.esb.samples.trailblazer.web.*;
+
+/**
+ * LoanRequester is a small class that serves as a web service client.
+ */
+public class LoanRequester {
+ public LoanRequester() {
+ }
+
+ /**
+ * Grab the port and call request loan.
+ * @return customer customer bean
+ */
+ public static void request(WebCustomer customer) {
+ try {
+ InitialContext iniCtx = new InitialContext();
+ //Service service =
(Service)iniCtx.lookup("java:comp/env/service/LoanBrokerService");
+ //LoanBrokerInterface port =
(LoanBrokerInterface)service.getPort(LoanBrokerInterface.class);
+ Service service = Service.create(
+ new
URL("http://localhost:8080/trailblazer/LoanBroker?wsdl"),
+ new
QName("http://localhost/trailblazer","LoanBrokerService") );
+ LoanBrokerInterface port =
(LoanBrokerInterface)service.getPort(LoanBrokerInterface.class );
+ port.RequestLoan(customer);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
\ No newline at end of file
Added:
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/QuoteRequest.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,159 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.soa.esb.samples.trailblazer.loanbroker;
+
+import java.io.Serializable;
+
+
+public class QuoteRequest implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ public int ssn;
+ public String ref;
+ public int creditScore;
+ public int creditHistoryLen;
+ public int amount;
+ public int term;
+ public String customerUniqueId;
+ public String customerEmail;
+
+ /**
+ * Gets for the credit score.
+ * @return credit score
+ */
+ public int getCreditScore() {
+ return creditScore;
+ }
+ /**
+ * Sets the credit score.
+ * @param creditScore
+ */
+ public void setCreditScore(int creditScore) {
+ this.creditScore = creditScore;
+ }
+ /**
+ * Gets the credit history length (in months).
+ * @return credit history length
+ */
+ public int getCreditHistoryLen() {
+ return creditHistoryLen;
+ }
+ /**
+ * Sets the credit history length (in months).
+ * @param creditHistoryLen
+ */
+ public void setCreditHistoryLen(int historyLength) {
+ this.creditHistoryLen = historyLength;
+ }
+ /**
+ * Gets the requested loan amount (in dollar).
+ * @return the loan amount
+ */
+ public int getAmount() {
+ return amount;
+ }
+ /**
+ * Sets the loan amount.
+ * @param amount - the loan amount (in dollar).
+ */
+ public void setAmount(int loanAmount) {
+ this.amount = loanAmount;
+ }
+ /**
+ * Gets the duration of the loan, the term, (in months).
+ * @return term
+ */
+ public int getTerm() {
+ return term;
+ }
+ /**
+ * Sets the term (duration) of the loan (in months)
+ * @param term
+ */
+ public void setTerm(int loanTerm) {
+ this.term = loanTerm;
+ }
+ /**
+ * Sets the Social Security Number (SSN).
+ * @return ssn
+ */
+ public int getSsn() {
+ return ssn;
+ }
+ /**
+ * Sets the quote reference.
+ * @param ref
+ */
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
+ /**
+ * Gets the quote reference.
+ * @return ref
+ */
+ public String getRef() {
+ return ref;
+ }
+ /**
+ * Sets the Social Security Number (SSN).
+ * @param ssn
+ */
+ public void setSsn(int ssn) {
+ this.ssn = ssn;
+ }
+ /**
+ * Returns a human readable string representation of this object.
+ * @return toString
+ */
+ public String toString() {
+ return this.getClass().getSimpleName() + "=["
+ + "ssn=" + ssn
+ + "ref=" + ref
+ + ", creditScore=" + creditScore
+ + ", creditHistoryLen=" + creditHistoryLen
+ + ", amount=" + amount
+ + ", term=" + term
+ + ", customerUniqueId="+ customerUniqueId + "]";
+ }
+
+ public String getXML() {
+ StringBuffer ret=new StringBuffer();
+
+ ret.append("<quoteRequest ssn=\""+ssn+"\" ");
+ ret.append("ref=\""+ref+"\" ");
+ ret.append("creditScore=\""+creditScore+"\" ");
+ ret.append("creditHistoryLen=\""+creditHistoryLen+"\"
");
+ ret.append("amount=\""+amount+"\" ");
+ ret.append("term=\""+term+"\" ");
+ ret.append("customerUID=\""+ssn+"\" ");
+ ret.append("customerEmail=\""+customerEmail+"\" />");
+
+ return(ret.toString());
+ }
+
+ public String getCustomerUniqueId() {
+ return customerUniqueId;
+ }
+ public void setCustomerUniqueId(String customerUID) {
+ this.customerUniqueId = customerUID;
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerBean.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerBean.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerBean.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,25 @@
+package org.jboss.soa.esb.samples.trailblazer.web;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.samples.trailblazer.loanbroker.LoanBroker;
+
+@WebService(name = "LoanBrokerInterface", targetNamespace =
"http://localhost/trailblazer", serviceName = "LoanBrokerService")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class LoanBrokerBean {
+ private static Logger logger = Logger.getLogger(LoanBrokerBean.class);
+
+ @WebMethod
+ public void RequestLoan(@WebParam(name="webCustomer_1") WebCustomer
webCustomer_1)
+ {
+ logger.info("WebCustomer received: \n" + webCustomer_1);
+
+ LoanBroker broker = new LoanBroker();
+ broker.processLoanRequest(webCustomer_1);
+ }
+}
\ No newline at end of file
Added:
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerInterface.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerInterface.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerInterface.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,17 @@
+package org.jboss.soa.esb.samples.trailblazer.web;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "LoanBrokerInterface", targetNamespace =
"http://localhost/trailblazer")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface LoanBrokerInterface {
+ @WebMethod
+ public void RequestLoan(
+ @WebParam(name = "webCustomer_1", partName =
"webCustomer_1")
+ WebCustomer webCustomer_1);
+
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,249 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+/*
+ * a simple web Customer to use in the web services call and not expose the internal esb
Customer object
+ */
+package org.jboss.soa.esb.samples.trailblazer.web;
+
+import java.io.Serializable;
+
+/*
+ * WebCustomer represents the data captured in the client JSP page
+ */
+
+@SuppressWarnings("serial")
+public class WebCustomer implements Serializable
+{
+ private java.lang.String address;
+
+ private java.lang.String email;
+
+ private java.lang.String employerName;
+
+ private double loanAmount;
+
+ private int loanDuration;
+
+ private java.lang.String name;
+
+ private double salary;
+
+ private int ssn;
+
+ public WebCustomer() {
+ }
+
+ public WebCustomer(
+ java.lang.String address,
+ java.lang.String email,
+ java.lang.String employerName,
+ double loanAmount,
+ int loanDuration,
+ java.lang.String name,
+ double salary,
+ int ssn) {
+ this.address = address;
+ this.email = email;
+ this.employerName = employerName;
+ this.loanAmount = loanAmount;
+ this.loanDuration = loanDuration;
+ this.name = name;
+ this.salary = salary;
+ this.ssn = ssn;
+ }
+ public String toString() {
+ String ret = "-- WebCustomer details -- \n";
+ ret += "name: " + name + "\n";
+ ret += "address: " + address + "\n";
+ ret += "employerName: " + employerName + "\n";
+ ret += "salary: " + salary + "\n";
+ ret += "loanAmount: " + loanAmount + "\n";
+ ret += "loanDuration: " + loanDuration + "\n";
+ ret += "ssn: " + ssn + "\n";
+ ret += "email: " + email + "\n";
+ ret += "--------------------------";
+
+ return ret;
+ }
+
+ /**
+ * Gets the address value for this WebCustomer.
+ *
+ * @return address
+ */
+ public java.lang.String getAddress() {
+ return address;
+ }
+
+
+ /**
+ * Sets the address value for this WebCustomer.
+ *
+ * @param address
+ */
+ public void setAddress(java.lang.String address) {
+ this.address = address;
+ }
+
+
+ /**
+ * Gets the email value for this WebCustomer.
+ *
+ * @return email
+ */
+ public java.lang.String getEmail() {
+ return email;
+ }
+
+
+ /**
+ * Sets the email value for this WebCustomer.
+ *
+ * @param email
+ */
+ public void setEmail(java.lang.String email) {
+ this.email = email;
+ }
+
+
+ /**
+ * Gets the employerName value for this WebCustomer.
+ *
+ * @return employerName
+ */
+ public java.lang.String getEmployerName() {
+ return employerName;
+ }
+
+
+ /**
+ * Sets the employerName value for this WebCustomer.
+ *
+ * @param employerName
+ */
+ public void setEmployerName(java.lang.String employerName) {
+ this.employerName = employerName;
+ }
+
+
+ /**
+ * Gets the loanAmount value for this WebCustomer.
+ *
+ * @return loanAmount
+ */
+ public double getLoanAmount() {
+ return loanAmount;
+ }
+
+
+ /**
+ * Sets the loanAmount value for this WebCustomer.
+ *
+ * @param loanAmount
+ */
+ public void setLoanAmount(double loanAmount) {
+ this.loanAmount = loanAmount;
+ }
+
+
+ /**
+ * Gets the loanDuration value for this WebCustomer.
+ *
+ * @return loanDuration
+ */
+ public int getLoanDuration() {
+ return loanDuration;
+ }
+
+
+ /**
+ * Sets the loanDuration value for this WebCustomer.
+ *
+ * @param loanDuration
+ */
+ public void setLoanDuration(int loanDuration) {
+ this.loanDuration = loanDuration;
+ }
+
+
+ /**
+ * Gets the name value for this WebCustomer.
+ *
+ * @return name
+ */
+ public java.lang.String getName() {
+ return name;
+ }
+
+
+ /**
+ * Sets the name value for this WebCustomer.
+ *
+ * @param name
+ */
+ public void setName(java.lang.String name) {
+ this.name = name;
+ }
+
+
+ /**
+ * Gets the salary value for this WebCustomer.
+ *
+ * @return salary
+ */
+ public double getSalary() {
+ return salary;
+ }
+
+
+ /**
+ * Sets the salary value for this WebCustomer.
+ *
+ * @param salary
+ */
+ public void setSalary(double salary) {
+ this.salary = salary;
+ }
+
+
+ /**
+ * Gets the ssn value for this WebCustomer.
+ *
+ * @return ssn
+ */
+ public int getSsn() {
+ return ssn;
+ }
+
+
+ /**
+ * Sets the ssn value for this WebCustomer.
+ *
+ * @param ssn
+ */
+ public void setSsn(int ssn) {
+ this.ssn = ssn;
+ }
+
+}
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/build.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/build.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/esb/build.xml 2008-08-29 16:12:31 UTC (rev
288)
@@ -0,0 +1,106 @@
+<project name="TRAILBLAZER"
default="org.jboss.esb.samples.trailblazer.esb.compile"
basedir=".">
+
+ <property name="org.jboss.soa.samples.trailblazer.esb_home"
value="../../.."/>
+ <property name="org.jboss.esb.samples.trailblazer.esb.dest"
value="${basedir}/build"/>
+ <property name="org.jboss.esb.samples.trailblazer.esb.classes.dir"
value="${basedir}/build/classes/esb/"/>
+ <property name="org.jboss.esb.samples.trailblazer.esb.testclasses.dir"
value="${basedir}/build/classes/tests/"/>
+ <property name="org.jboss.esb.samples.trailblazer.esb.src.dir"
value="${basedir}/src"/>
+ <property name="org.jboss.esb.samples.trailblazer.esb.test.dir"
value="${basedir}/test"/>
+ <property name="org.jboss.esb.samples.trailblazer.esb.lib.dir"
value="${basedir}/lib"/>
+ <property name="org.jboss.esb.samples.trailblazer.esb.tests.report.dir"
value="${basedir}/build/tests"/>
+
+ <!-- UPDATE THIS WITH YOUR JBOSS_HOME -->
+ <property name="org.jboss.soa.samples.trailblazer.jboss_home"
value="/usr/local/jboss-4.0.4"/>
+
+ <property environment="env" />
+
+ <property name="org.jboss.soa.esb.lib.file"
value="jbossesb-rosetta.jar"/>
+ <property name="org.jboss.soa.esb.lib.dist.dir"
value="${org.jboss.soa.samples.trailblazer.esb_home}/lib"/>
+ <property name="org.jboss.soa.esb.lib.src.dir"
value="../../../build/jbossesb/lib"/>
+
+ <available file="${org.jboss.soa.esb.lib.file}"
+ filepath="${org.jboss.soa.esb.lib.dist.dir}"
+ property="org.jboss.soa.esb.lib.dir"
+ value="${org.jboss.soa.esb.lib.dist.dir}"/>
+
+ <available file="${org.jboss.soa.esb.lib.file}"
+ filepath="${org.jboss.soa.esb.lib.src.dir}"
+ property="org.jboss.soa.esb.lib.dir"
+ value="${org.jboss.soa.esb.lib.src.dir}"/>
+
+
+ <!-- classpath -->
+ <path id="org.jboss.esb.samples.trailblazer.esb.classpath">
+ <fileset dir="${org.jboss.esb.samples.trailblazer.esb.lib.dir}/ext"
includes="*.jar"/>
+ <fileset dir="${org.jboss.soa.esb.lib.dir}/ext"
includes="*.jar"/>
+ <fileset dir="${org.jboss.soa.samples.trailblazer.jboss_home}/client"
includes="jbossall-client.jar jbossws-client.jar mail.jar"/>
+ <fileset dir="${org.jboss.soa.esb.lib.dir}"
includes="*.jar"/>
+ </path>
+
+ <!-- classpath for running the listener-->
+ <path id="org.jboss.esb.samples.trailblazer.esb.classpath.run">
+ <fileset dir="${org.jboss.esb.samples.trailblazer.esb.dest}/dist"
includes="trailblazer-esb.jar"/>
+ <fileset dir="${org.jboss.soa.samples.trailblazer.esb_home}/lib/ext"
includes="*.jar"/>
+ <fileset dir="${org.jboss.soa.esb.lib.dir}/ext"
includes="*.jar"/>
+ <!-- for finding the jbossesb-properties.xml file -->
+ <fileset dir="${org.jboss.soa.samples.trailblazer.esb_home}/install/conf"
includes="*.jar"/>
+ </path>
+
+ <target name="clean">
+ <delete dir="${org.jboss.esb.samples.trailblazer.esb.dest}" />
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Prepares the directory structure -->
+ <!-- =================================================================== -->
+ <target name="org.jboss.esb.samples.trailblazer.esb.prepare">
+ <mkdir dir="${org.jboss.esb.samples.trailblazer.esb.dest}"/>
+ <mkdir dir="${org.jboss.esb.samples.trailblazer.esb.dest}/dist"/>
+ <mkdir
dir="${org.jboss.esb.samples.trailblazer.esb.dest}/classes/esb"/>
+ </target>
+
+ <!-- Compilation targets -->
+ <target name="org.jboss.esb.samples.trailblazer.esb.compile"
depends="org.jboss.esb.samples.trailblazer.esb.prepare"
+ description="Compile all classes">
+
+ <javac
+ destdir="${org.jboss.esb.samples.trailblazer.esb.classes.dir}"
+ classpathref="org.jboss.esb.samples.trailblazer.esb.classpath"
+ debug="true"
+ >
+ <src path="${org.jboss.esb.samples.trailblazer.esb.src.dir}"/>
+ </javac>
+
+ </target>
+
+ <!-- javadocs paths -->
+ <path id="org.jboss.esb.samples.trailblazer.esb.javadocs.path">
+ <pathelement path="esb/classes"/>
+ </path>
+
+ <!-- Jar targets -->
+ <target name="org.jboss.esb.samples.trailblazer.esb.jar"
depends="org.jboss.esb.samples.trailblazer.esb.compile" >
+ <echo message="Building Trailblazer ESB jar file"/>
+ <delete
file="${org.jboss.esb.samples.trailblazer.esb.dest}/dist/trailblazer-esb.jar"
/>
+ <jar
destfile="${org.jboss.esb.samples.trailblazer.esb.dest}/dist/trailblazer-esb.jar"
+ basedir="${org.jboss.esb.samples.trailblazer.esb.classes.dir}"
+ includes="**/*.class" excludes="**/web/*.class"
+ />
+ </target>
+
+ <!-- Short target names -->
+ <target name="compile"
depends="org.jboss.esb.samples.trailblazer.esb.compile"/>
+ <target name="jar"
depends="org.jboss.esb.samples.trailblazer.esb.jar"/>
+
+ <!-- run the listener -->
+ <target name="runESB"
depends="org.jboss.esb.samples.trailblazer.esb.jar">
+ <echo>Running ESB Trailblazer listeners</echo>
+ <java fork="yes"
classname="org.jboss.soa.esb.samples.trailblazer.util.Launcher"
failonerror="true"
+ args="10
/home/dbrum/dev/jbossesb/product/samples/trailblazer2/conf/jbossesb-trailblazer.xml">
+ <classpath refid="org.jboss.esb.samples.trailblazer.esb.classpath"/>
+ <classpath
refid="org.jboss.esb.samples.trailblazer.esb.classpath.run"/>
+ </java>
+ </target>
+
+
+</project>
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/conf/deployment.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/conf/deployment.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/esb/conf/deployment.xml 2008-08-29 16:12:31 UTC
(rev 288)
@@ -0,0 +1,11 @@
+<jbossesb-deployment>
+
<depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue</depends>
+
<depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue_reply</depends>
+
<depends>jboss.esb.trailblazer.destination:service=Queue,name=jms-tb-jmsBankRequestQueue</depends>
+
<depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankRequestQueue</depends>
+
<depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankResponseQueue</depends>
+
<depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankGatewayResponseQueue</depends>
+
<depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-fileBankRequestQueue</depends>
+
<depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-fileBankResponseQueue</depends>
+
<depends>jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-customerNotifier</depends>
+</jbossesb-deployment>
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbm-queue-service.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbm-queue-service.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbm-queue-service.xml 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+
name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue"
+ 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.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue_reply"
+ 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.trailblazer.destination:service=Queue,name=jms-tb-jmsBankRequestQueue"
+ 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.trailblazer.destination:service=Queue,name=esb-tb-jmsBankRequestQueue"
+ 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.trailblazer.destination:service=Queue,name=esb-tb-jmsBankResponseQueue"
+ 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.trailblazer.destination:service=Queue,name=esb-tb-jmsBankGatewayResponseQueue"
+ 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.trailblazer.destination:service=Queue,name=esb-tb-fileBankRequestQueue"
+ 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.trailblazer.destination:service=Queue,name=esb-tb-fileBankResponseQueue"
+ 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.trailblazer.destination:service=Queue,name=esb-tb-customerNotifier"
+ 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: cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbmq-queue-service.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbmq-queue-service.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbmq-queue-service.xml 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+
name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+
name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-creditAgencyQueue_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+
name="jboss.esb.trailblazer.destination:service=Queue,name=jms-tb-jmsBankRequestQueue">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+
name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankRequestQueue">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+
name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankResponseQueue">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+
name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-jmsBankGatewayResponseQueue">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+
name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-fileBankRequestQueue">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+
name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-fileBankResponseQueue">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+
+<mbean code="org.jboss.mq.server.jmx.Queue"
+
name="jboss.esb.trailblazer.destination:service=Queue,name=esb-tb-customerNotifier">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+</mbean>
+
+</server>
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jboss-esb.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jboss-esb.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jboss-esb.xml 2008-08-29 16:12:31 UTC
(rev 288)
@@ -0,0 +1,140 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc...
+ parameterReloadSecs="5000">
+
+ <providers>
+ <jms-provider name="JBossMQ"
connection-factory="ConnectionFactory"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-URL="localhost">
+ <jms-bus busid="creditAgencyRequest">
+ <jms-message-filter dest-type="QUEUE"
dest-name="queue/esb-tb-creditAgencyQueue"
selector="function='request'"/>
+ </jms-bus>
+ <jms-bus busid="jmsBankRequest">
+ <jms-message-filter dest-type="QUEUE"
dest-name="queue/esb-tb-jmsBankRequestQueue"/>
+ </jms-bus>
+ <jms-bus busid="fileBankRequest">
+ <jms-message-filter dest-type="QUEUE"
dest-name="queue/esb-tb-fileBankRequestQueue"/>
+ </jms-bus>
+ <jms-bus busid="jmsBankResponseGateway">
+ <jms-message-filter dest-type="QUEUE"
dest-name="queue/esb-tb-jmsBankGatewayResponseQueue"/>
+ </jms-bus>
+ <jms-bus busid="jmsBankResponseListener">
+ <jms-message-filter dest-type="QUEUE"
dest-name="queue/esb-tb-jmsBankResponseQueue"/>
+ </jms-bus>
+ <jms-bus busid="fileBankResponseListener">
+ <jms-message-filter dest-type="QUEUE"
dest-name="queue/esb-tb-fileBankResponseQueue"/>
+ </jms-bus>
+ <jms-bus busid="customerNotifier">
+ <jms-message-filter dest-type="QUEUE"
dest-name="queue/esb-tb-customerNotifier"/>
+ </jms-bus>
+ </jms-provider>
+
+ <fs-provider name="FSprovider1">
+ <fs-bus busid="fileBankChannel" >
+ <fs-message-filter
+ directory="/tmp/output"
+ input-suffix=".quote"
+ work-suffix=".esbWorking"
+ post-delete="true"
+ error-delete="true" />
+ </fs-bus>
+ </fs-provider>
+ </providers>
+ <services>
+
+ <service category="tbCreditAGency" name="creditagency"
description="Credit Agency Service">
+ <listeners>
+ <jms-listener name="trailblazer-jmscreditagency"
+ busidref="creditAgencyRequest"
+ maxThreads="1"/>
+ </listeners>
+ <actions>
+ <action
class="org.jboss.soa.esb.samples.trailblazer.actions.CreditCheckXMLToCSVActions"
+ process="handle" name="XMLToCSV">
+ </action>
+ <!--action name="transform-from-csv"
class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+ <property name="resource-config"
value="/smooks-xml2csv.xml" />
+ </action-->
+
+ <action
class="org.jboss.soa.esb.samples.trailblazer.actions.CreditAgencyActions"
+ process="processCreditRequest" name="fido">
+ </action>
+ <action name="transform-from-csv"
class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+ <property name="resource-config"
value="/smooks-csv2xml.xml" />
+ </action>
+ <!--action
class="org.jboss.soa.esb.samples.trailblazer.actions.CreditCheckCSVToXMLActions"
+ process="handle" name="CSVToXML">
+ </action-->
+ </actions>
+ </service>
+ <service category="tbBanks" name="jmsBank" description="JMS
Bank Service">
+ <listeners>
+ <jms-listener name="trailblazer-jmsbankreq"
+ busidref="jmsBankRequest"
+ maxThreads="1"/>
+ </listeners>
+ <actions mep="OneWay" >
+ <action class="org.jboss.soa.esb.actions.routing.JMSRouter"
+ name="jmsBankAction" >
+ <property name="jndiName"
value="queue/jms-tb-jmsBankRequestQueue" />
+ <property name="unwrap" value="true" />
+ </action>
+ </actions>
+ </service>
+ <service category="tbJmsbank" name="jmsbankreplies"
description="Trailblazer JMS Bank Reply Service">
+ <listeners>
+ <jms-listener name="trailblazer-jmsbankrespgw"
+ busidref="jmsBankResponseGateway"
+ maxThreads="1"
+ is-gateway="true"/>
+ <jms-listener name="trailblazer-jmsbankreplies"
+ busidref="jmsBankResponseListener"
+ maxThreads="1"/>
+ </listeners>
+ <actions>
+ <action
class="org.jboss.soa.esb.samples.trailblazer.actions.BankResponseActions"
+ process="processResponseFromJMSBank" name="pepe"/>
+ </actions>
+ </service>
+ <service category="tbBanks" name="fileBank"
description="File Bank Service">
+ <listeners>
+ <jms-listener name="trailblazer-filebankreq"
+ busidref="fileBankRequest"
+ maxThreads="1"/>
+ </listeners>
+ <actions mep="OneWay" >
+ <action
class="org.jboss.soa.esb.samples.trailblazer.actions.FileBankRequestActions"
+ process="processFileBankRequest" name="fileBankRequestAction"
>
+ </action>
+ </actions>
+ </service>
+ <service category="tbFilebank" name="filebankreplies"
description="Trailblazer File Bank Reply Service">
+ <listeners>
+ <fs-listener name="FileGateway"
+ busidref="fileBankChannel"
+ maxThreads="1"
+ is-gateway="true"
+ schedule-frequency="10" />
+ <jms-listener name="trailblazer-filebankreplies"
+ busidref="fileBankResponseListener"
+ maxThreads="1"/>
+ </listeners>
+ <actions>
+ <action
class="org.jboss.soa.esb.samples.trailblazer.actions.BankResponseActions"
+ process="processResponseFromFileBank" name="filebankin"/>
+ </actions>
+ </service>
+ <service category="notifiers" name="customer"
description="Customer Notification Service">
+ <listeners>
+ <jms-listener name="trailblazer-custnotifier"
+ busidref="customerNotifier"
+ maxThreads="1"/>
+ </listeners>
+ <actions mep="OneWay" >
+ <action
class="org.jboss.soa.esb.samples.trailblazer.actions.NotifyCustomerActions"
+ process="notifyCustomer" name="notify"/>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties-monitor.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties-monitor.xml
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties-monitor.xml 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,95 @@
+<?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.context.factory"
value="org.jnp.interfaces.NamingContextFactory"/>
+ <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="org.jboss.soa.esb.loadbalancer.policy"
value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
value="org.apache.juddi.registry.local.InquiryService#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
value="org.apache.juddi.registry.local.PublishService#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.LocalTransport"/>
+ </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"/>
+ <property name="org.jboss.soa.esb.mail.smtp.auth"
value="true"/>
+ <property name="org.jboss.soa.esb.ftp.localdir"
value="/tmp"/>
+ <property name="org.jboss.soa.esb.ftp.remotedir"
value="/tmp"/>
+ <property name="org.jboss.soa.esb.jms.connectionPool"
value="20"/>
+ <property name="org.jboss.soa.esb.jms.sessionSleep"
value="30"/>
+ </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">
+
+ <!-- connection manager type -->
+ <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager"
value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
-->
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager"
value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
+
+ <!-- this property is only used if using the j2ee connection manager -->
+ <property name="org.jboss.soa.esb.persistence.db.datasource.name"
value="java:/JBossESBDS"/>
+
+ <!-- standalone connection pooling settings -->
+ <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"/>
+ <property
name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+
+ </properties>
+
+ <properties name="filters">
+ <property name="org.jboss.soa.esb.filter.1"
value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
+ <property name="org.jboss.soa.esb.filter.2"
value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
+ <property name="org.jboss.soa.esb.filter.3"
value="org.pi4soa.jbossesb.monitor.MonitorFilter" />
+ </properties>
+</esb>
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/esb/conf/jbossesb-properties.xml 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,93 @@
+<?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.context.factory"
value="org.jnp.interfaces.NamingContextFactory"/>
+ <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="org.jboss.soa.esb.loadbalancer.policy"
value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
value="org.apache.juddi.registry.local.InquiryService#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
value="org.apache.juddi.registry.local.PublishService#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.LocalTransport"/>
+ </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"/>
+ <property name="org.jboss.soa.esb.mail.smtp.auth"
value="true"/>
+ <property name="org.jboss.soa.esb.ftp.localdir"
value="/tmp"/>
+ <property name="org.jboss.soa.esb.ftp.remotedir"
value="/tmp"/>
+ <property name="org.jboss.soa.esb.jms.connectionPool"
value="20"/>
+ <property name="org.jboss.soa.esb.jms.sessionSleep"
value="30"/>
+ </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">
+
+ <!-- connection manager type -->
+ <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager"
value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
-->
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager"
value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
+
+ <!-- this property is only used if using the j2ee connection manager -->
+ <property name="org.jboss.soa.esb.persistence.db.datasource.name"
value="java:/JBossESBDS"/>
+
+ <!-- standalone connection pooling settings -->
+ <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"/>
+ <property
name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+
+ </properties>
+ <properties name="filters">
+ <property name="org.jboss.soa.esb.filter.1"
value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
+ <property name="org.jboss.soa.esb.filter.2"
value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
+ </properties>
+</esb>
\ No newline at end of file
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/conf/log4j.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/conf/log4j.xml (rev
0)
+++ cdl/trunk/samples/jbossesb/trailblazer/esb/conf/log4j.xml 2008-08-29 16:12:31 UTC (rev
288)
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.10 2006/04/21 17:29:20 csuconic 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">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
+ <errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./trailblazer.log"/>
+ <param name="Append" value="false"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern"
value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern"
value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c]
%m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c]
(%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+ <!-- 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="${jboss.server.log.dir}/server.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 [%c]
%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ============================== -->
+ <!-- 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
[%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ====================== -->
+ <!-- More Appender examples -->
+ <!-- ====================== -->
+
+ <!-- Buffer events and log them asynchronously
+ <appender name="ASYNC"
class="org.apache.log4j.AsyncAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <appender-ref ref="FILE"/>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="SMTP"/>
+ </appender>
+ -->
+
+ <!-- EMail events to an administrator
+ <appender name="SMTP"
class="org.apache.log4j.net.SMTPAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Threshold" value="ERROR"/>
+ <param name="To" value="admin(a)myhost.domain.com"/>
+ <param name="From" value="nobody(a)myhost.domain.com"/>
+ <param name="Subject" value="JBoss Sever Errors"/>
+ <param name="SMTPHost" value="localhost"/>
+ <param name="BufferSize" value="10"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}]
%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Syslog events
+ <appender name="SYSLOG"
class="org.apache.log4j.net.SyslogAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Facility" value="LOCAL7"/>
+ <param name="FacilityPrinting" value="true"/>
+ <param name="SyslogHost" value="localhost"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}]
%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Log events to JMS (requires a topic to be created)
+ <appender name="JMS"
class="org.apache.log4j.net.JMSAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Threshold" value="ERROR"/>
+ <param name="TopicConnectionFactoryBindingName"
value="java:/ConnectionFactory"/>
+ <param name="TopicBindingName"
value="topic/MyErrorsTopic"/>
+ </appender>
+ -->
+
+ <!-- Log events through SNMP
+ <appender name="TRAP_LOG"
class="org.apache.log4j.ext.SNMPTrapAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="ImplementationClassName"
value="org.apache.log4j.ext.JoeSNMPTrapSender"/>
+ <param name="ManagementHost" value="127.0.0.1"/>
+ <param name="ManagementHostTrapListenPort" value="162"/>
+ <param name="EnterpriseOID" value="1.3.6.1.4.1.24.0"/>
+ <param name="LocalIPAddress" value="127.0.0.1"/>
+ <param name="LocalTrapSendPort" value="161"/>
+ <param name="GenericTrapType" value="6"/>
+ <param name="SpecificTrapType" value="12345678"/>
+ <param name="CommunityString" value="public"/>
+ <param name="ForwardStackTraceWithTrap" value="true"/>
+ <param name="Threshold" value="DEBUG"/>
+ <param name="ApplicationTrapOID"
value="1.3.6.1.4.1.24.12.10.22.64"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
value="%d,%p,[%t],[%c],%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Emit events as JMX notifications
+ <appender name="JMX"
class="org.jboss.monitor.services.JMXNotificationAppender">
+ <errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+
+ <param name="Threshold" value="WARN"/>
+ <param name="ObjectName"
value="jboss.system:service=Logging,type=JMXNotificationAppender"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c]
%m"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+ <category name="org.apache">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is
verbose -->
+ <category name="org.jboss.serial">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+ <category name="org.jgroups">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+ <category name="jacorb">
+ <priority value="WARN"/>
+ </category>
+
+
+ <!-- Limit the JSR77 categories -->
+ <category name="org.jboss.management">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit Axis based webservice category -->
+ <category name="org.jboss.webservice">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.axis">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.milyn">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.delivery.SmooksXML">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.delivery.serialize.Serializer">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.milyn.cdr.XMLConfigDigester">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.jboss.soa.esb.samples.trailblazer">
+ <priority value="INFO"/>
+ </category>
+
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+ <!-- Clustering logging -->
+ <!-- Uncomment the following to redirect the org.jgroups and
+ org.jboss.ha categories to a cluster.log file.
+
+ <appender name="CLUSTER"
class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File"
value="${jboss.server.log.dir}/cluster.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 [%c]
%m%n"/>
+ </layout>
+ </appender>
+ <category name="org.jgroups">
+ <priority value="DEBUG" />
+ <appender-ref ref="CLUSTER"/>
+ </category>
+ <category name="org.jboss.ha">
+ <priority value="DEBUG" />
+ <appender-ref ref="CLUSTER"/>
+ </category>
+ -->
+
+</log4j:configuration>
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/conf/smooks-csv2xml.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/conf/smooks-csv2xml.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/esb/conf/smooks-csv2xml.xml 2008-08-29 16:12:31
UTC (rev 288)
@@ -0,0 +1,19 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+ <resource-config selector="org.xml.sax.driver">
+ <resource>org.milyn.csv.CSVParser</resource>
+ <param name="fields" type="string-list">
+ ssn,score
+ </param>
+ </resource-config>
+
+ <resource-config selector="csv-set">
+ <resource type="xsl">
+ <![CDATA[
+ <creditCheckResult ssn="{csv-record/ssn}"
score="{csv-record/score}" />
+ ]]>
+ </resource>
+ <param name="is-xslt-templatelet">true</param>
+ </resource-config>
+
+</smooks-resource-list>
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/conf/smooks-xml2csv.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/conf/smooks-xml2csv.xml
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/esb/conf/smooks-xml2csv.xml 2008-08-29 16:12:31
UTC (rev 288)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+ <resource-config selector="creditCheck">
+ <resource>/xml2csv.xsl</resource>
+ <param name="is-xslt-templatelet">false</param>
+ </resource-config>
+</smooks-resource-list>
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/conf/xml2csv.xsl
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/esb/conf/xml2csv.xsl
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/esb/conf/xml2csv.xsl 2008-08-29 16:12:31 UTC
(rev 288)
@@ -0,0 +1,24 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+ <xsl:output method="text" encoding="UTF-8" />
+ <xsl:variable name="delimiter">,</xsl:variable>
+ <xsl:template match="creditCheck">
+ <xsl:value-of select="@name"/>
+ <xsl:value-of select="$delimiter"/>
+ <xsl:value-of select="@ssn"/>
+ <xsl:value-of select="$delimiter"/>
+ <xsl:value-of select="@address"/>
+ <xsl:value-of select="$delimiter"/>
+ <xsl:value-of select="@employerName"/>
+ <xsl:value-of select="$delimiter"/>
+ <xsl:value-of select="@salary"/>
+ <xsl:value-of select="$delimiter"/>
+ <xsl:value-of select="@loanAmount"/>
+ <xsl:value-of select="$delimiter"/>
+ <xsl:value-of select="@loanDuration"/>
+ <xsl:value-of select="$delimiter"/>
+ <xsl:value-of select="@email"/>
+ <xsl:value-of select="$delimiter"/>
+ <xsl:value-of select="@creditScore"/>
+ </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/c3p0-0.9.1-pre9.jar
===================================================================
(Binary files differ)
Property changes on:
cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/c3p0-0.9.1-pre9.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/commons-logging.jar
===================================================================
(Binary files differ)
Property changes on:
cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/commons-logging.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/hsqldb.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/hsqldb.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/milyn-smooks-csv-0.1.jar
===================================================================
(Binary files differ)
Property changes on:
cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/milyn-smooks-csv-0.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/opencsv-1.6.jar
===================================================================
(Binary files differ)
Property changes on: cdl/trunk/samples/jbossesb/trailblazer/esb/lib/ext/opencsv-1.6.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/BankResponseActions.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,80 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * 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 mark.little(a)jboss.com
+ */
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.helpers.ConfigTree;
+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.samples.trailblazer.util.ProcessEmail;
+
+public class BankResponseActions extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+
+ private final String SERVICE_NAME = "customer";
+ private final String SERVICE_CAT = "notifiers";
+ private ServiceInvoker notifierInvoker;
+
+ private static Logger _logger = Logger.getLogger(BankResponseActions.class);
+
+ public BankResponseActions(ConfigTree config) {
+ _config = config;
+
+ try {
+ notifierInvoker = new ServiceInvoker(SERVICE_CAT, SERVICE_NAME);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to create ServiceInvoker for
'" + SERVICE_CAT + ":" + SERVICE_NAME + "'.", e);
+ }
+ }
+
+ public Message processResponseFromJMSBank(Message message) throws Exception {
+ System.out.println("Got the message from the JMS bank: " +
message.getBody().get());
+
+ _logger.debug("JMS bank message received: \n" + message.getBody().get());
+
+ Message notifyMessage =
MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+ notifyMessage.getBody().add(message.getBody().get());
+
+ notifierInvoker.deliverAsync(notifyMessage);
+
+ return null;
+ }
+
+ public Message processResponseFromFileBank(Message message) throws Exception {
+ String mesg=new String((byte[])message.getBody().get());
+
+ System.out.println("Got the message from the File bank: " + mesg);
+
+ _logger.debug("File bank message received: \n" + mesg);
+
+ Message notifyMessage =
MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+ notifyMessage.getBody().add(mesg);
+
+ notifierInvoker.deliverAsync(notifyMessage);
+
+ return null;
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,79 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * 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,
+ * @daniel.brum(a)jboss.com
+ */
+
+import java.util.Random;
+
+import org.apache.log4j.Logger;
+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.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.util.Util;
+
+public class CreditAgencyActions extends AbstractActionLifecycle {
+ protected ConfigTree _config;
+
+ private static Logger _logger = Logger.getLogger(CreditAgencyActions.class);
+
+ public CreditAgencyActions(ConfigTree config) { _config = config; }
+
+ public Message noOperation(Message message) { return message; }
+
+ public Message processCreditRequest(Message message) throws Exception{
+
+ _logger.debug("message received: " + Util.serialize(message) );
+
+ String csvData = (String)message.getBody().get();
+ _logger.debug("csv data received: " + csvData);
+
+ String[] parts=csvData.split(",");
+
+ //generate a random score between 1 and 10
+ Random rand = new Random();
+ int n = 10;
+ int score = rand.nextInt(n+1);
+
+ //send back the reply
+ Message replyMessage =
MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+ _logger.info("CreditAgency sending back a credit score of " + score);
+
+ // Return the unique customer ref (ssn) and the score
+ String resp=parts[1]+","+score;
+ replyMessage.getBody().add(resp);
+
+ return replyMessage;
+ }
+
+ public Message debugMessage(Message message) throws Exception{
+
+ _logger.debug("message received in processCreditRequest with message: " +
Util.serialize(message));
+
+
+
+ return message;
+ }
+}
+
+
Added:
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckCSVToXMLActions.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckCSVToXMLActions.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckCSVToXMLActions.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,66 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * 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,
+ * @daniel.brum(a)jboss.com
+ */
+
+import java.util.Random;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+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.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.util.Util;
+
+public class CreditCheckCSVToXMLActions extends AbstractActionLifecycle {
+ protected ConfigTree _config;
+
+ private static Logger _logger = Logger.getLogger(CreditCheckCSVToXMLActions.class);
+
+ public CreditCheckCSVToXMLActions(ConfigTree config) { _config = config; }
+
+ public Message handle(Message message) throws Exception{
+
+ _logger.debug("CSV message received: " + Util.serialize(message) );
+
+ String csv=(String)message.getBody().get();
+
+ String[] parts=csv.split(",");
+
+ String xml="<creditCheckResult ssn=\""+parts[0]+
+ "\" score=\""+parts[1]+"\" />";
+
+ _logger.debug("XML data to return" + xml);
+
+ //send back the reply
+ Message replyMessage =
MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+ replyMessage.getBody().add(xml);
+
+ return replyMessage;
+ }
+}
+
+
Added:
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckXMLToCSVActions.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckXMLToCSVActions.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditCheckXMLToCSVActions.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,89 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * 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,
+ * @daniel.brum(a)jboss.com
+ */
+
+import java.util.Random;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+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.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.util.Util;
+
+public class CreditCheckXMLToCSVActions extends AbstractActionLifecycle {
+ protected ConfigTree _config;
+
+ private static Logger _logger = Logger.getLogger(CreditCheckXMLToCSVActions.class);
+
+ public CreditCheckXMLToCSVActions(ConfigTree config) { _config = config; }
+
+ public Message handle(Message message) throws Exception{
+
+ _logger.debug("XML message received: " + Util.serialize(message) );
+
+ String xml=(String)message.getBody().get();
+ String csvData=null;
+
+ try {
+ DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
+ fact.setNamespaceAware(true);
+
+ java.io.InputStream xmlstr=
+ new java.io.ByteArrayInputStream(xml.getBytes());
+
+ DocumentBuilder builder=fact.newDocumentBuilder();
+ org.w3c.dom.Document doc=builder.parse(xmlstr);
+
+ org.w3c.dom.Element tree = doc.getDocumentElement();
+
+ csvData = (tree.getAttribute("name")+","+
+ tree.getAttribute("ssn")+","+
+ tree.getAttribute("address")+","+
+ tree.getAttribute("employerName")+","+
+ tree.getAttribute("salary")+","+
+ tree.getAttribute("loanAmount")+","+
+ tree.getAttribute("loanDuration")+","+
+ tree.getAttribute("email")+","+
+ tree.getAttribute("creditScore"));
+
+ } catch(Exception ex) {
+ _logger.error(ex.getMessage(), ex);
+ }
+
+ _logger.debug("CSV data to return" + csvData);
+
+ //send back the reply
+ Message replyMessage =
MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+ replyMessage.getBody().add(csvData);
+
+
+ return replyMessage;
+ }
+}
+
+
Added:
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/FileBankRequestActions.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/FileBankRequestActions.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/FileBankRequestActions.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,66 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * 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 mark.little(a)jboss.com
+ */
+
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+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.samples.trailblazer.util.TrailblazerProperties;
+
+public class FileBankRequestActions extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+ private Properties properties = new TrailblazerProperties();
+
+ private static final String BANK_REQUEST_DIR="file.bank.monitored.dir";
+
+ private String m_bankRequestDir=null;
+
+ private static Logger _logger = Logger.getLogger(FileBankRequestActions.class);
+
+ public FileBankRequestActions(ConfigTree config) {
+ _config = config;
+ m_bankRequestDir = properties.getProperty(BANK_REQUEST_DIR);
+ }
+
+ public Message processFileBankRequest(Message message) throws Exception {
+ System.out.println("Got the message for the File bank: " +
message.getBody().get());
+
+ _logger.debug("File bank message received: \n" + message.getBody().get());
+
+ java.io.File dir=new java.io.File(m_bankRequestDir);
+
+ java.io.File f=java.io.File.createTempFile("FileBank", "tb", dir);
+
+ java.io.FileOutputStream fos=new java.io.FileOutputStream(f);
+
+ fos.write(((String)message.getBody().get()).getBytes());
+
+ fos.flush();
+ fos.close();
+
+ return null;
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/NotifyCustomerActions.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/NotifyCustomerActions.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/NotifyCustomerActions.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,63 @@
+package org.jboss.soa.esb.samples.trailblazer.actions;
+
+/*
+ * 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 mark.little(a)jboss.com
+ */
+
+import org.apache.log4j.Logger;
+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.samples.trailblazer.util.ProcessEmail;
+
+public class NotifyCustomerActions extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+
+ private static Logger _logger = Logger.getLogger(NotifyCustomerActions.class);
+
+ public NotifyCustomerActions(ConfigTree config) { _config = config; }
+
+ public Message notifyCustomer(Message message) throws Exception {
+
+ _logger.debug("message received: \n" + message.getBody().get());
+
+ //get the quote response and send it to the customer
+ ConfigTree tree = ConfigTree.fromXml((String)message.getBody().get());
+
+ String quoteID = tree.getFirstTextChild("quoteId");
+ String rate = tree.getFirstTextChild("interestRate");
+ String errorCode = tree.getFirstTextChild("errorCode");
+ String ssn = tree.getFirstTextChild("customerUID");
+ String email = tree.getFirstTextChild("customerEmail");
+
+ _logger.debug("info using for email: " + quoteID +" "+rate+"
"+errorCode+" "+ssn+" "+email);
+
+
+ _logger.debug("preparing to send the quote response via email to customer");
+ ProcessEmail procEmail = new ProcessEmail(email, quoteID, rate, errorCode, ssn);
+ procEmail.sendEmail();
+
+ System.out.println("Sent email to: " +email);
+
+
+ return null;
+ }
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/HsqldbUtil.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/HsqldbUtil.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/HsqldbUtil.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,89 @@
+/*
+ * 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.trailblazer.util;
+
+import java.sql.DriverManager;
+import java.sql.Statement;
+
+import org.apache.log4j.Logger;
+import org.hsqldb.Server;
+/**
+ * Utility to start and stop a hsql Database.
+ *
+ * @author <a href="mailto:kurt.stam@jboss.com">Kurt Stam</a>
+ *
+ */
+public class HsqldbUtil
+{
+ final private static String THREAD_NAME = "hypersonic-unittest";
+
+ private static Logger _logger = Logger.getLogger(HsqldbUtil.class);
+ /**
+ * Starts the hsql database in it's own thread.
+ * Don't forget to shut it down when you're done.
+ *
+ * @param databaseFile - i.e. build/hsqltestdb
+ * @param databaseName - i.e. jbossesb
+ * @throws Exception
+ */
+ public static void startHsqldb(final String databaseFile,
+ final String databaseName) throws Exception
+ {
+ // Start DB in new thread, or else it will block us
+ Thread serverThread = new Thread(THREAD_NAME) {
+ public void run() {
+ try {
+ // Create startup arguments
+ String[] args = new String[4];
+ args[0] = "-database.0";
+ args[1] = databaseFile;
+ args[2] = "-dbname.0";
+ args[3] = databaseName;
+
+ _logger.info("creating db from this script: " + databaseFile);
+
+ // Start server
+ Server.main(args);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+// log.error("Failed to start database", e);
+ }
+ };
+ serverThread.run();
+ }
+ /**
+ *
+ * @param url
+ * @param username
+ * @param password
+ * @throws Exception
+ */
+ public static void stopHsqldb(String url, String username, String password) throws
Exception {
+ java.sql.Connection connection = DriverManager.getConnection(
+ url, username, password);
+ Statement statement = connection.createStatement();
+ String shutdownCommand = "SHUTDOWN COMPACT";
+ statement.executeQuery(shutdownCommand);
+ }
+
+
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/ProcessEmail.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/ProcessEmail.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/ProcessEmail.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.jboss.soa.esb.samples.trailblazer.util;
+
+import java.util.Properties;
+
+import org.antlr.stringtemplate.StringTemplate;
+import org.antlr.stringtemplate.StringTemplateGroup;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.helpers.Email;
+
+
+public class ProcessEmail {
+
+ private Logger logger = Logger.getLogger(this.getClass());
+ private String emailTo, quoteID, rate, code, ssn;
+ private Properties properties = new TrailblazerProperties();
+
+ public ProcessEmail(String email, String quoteID, String rate, String code, String
ssn) {
+ this.emailTo=email;
+ this.quoteID=quoteID;
+ this.rate=rate;
+ this.code=code;
+ this.ssn=ssn;
+ logger.debug("creating email helper");
+
+ }
+
+ public void sendEmail() {
+ try {
+ if (null==emailTo) {
+ logger.error("no email found for customer, aborting send");
+ return;
+ }
+ logger.info("customer SSN " + ssn + " - sending email to: " +
emailTo);
+ Email emailMessage = new Email();
+ emailMessage.setSendTo(emailTo);
+ emailMessage.setSubject("TrailBlazer Quote from Bank");
+ String emailFrom = properties.getProperty("email.from");
+ emailMessage.setFrom(emailFrom);
+// File emailTemplate = new File(LoanBrokerConstants.EMAIL_TEMPLATE);
+// String quoteMsg=FileUtil.readTextFile(emailTemplate);
+ emailMessage.setMessage(fillTemplate());
+ emailMessage.sendMessage();
+ }catch (Exception e) {
+ logger.error("error sending email - " + e);
+ e.printStackTrace();
+ }
+ }
+
+ private String fillTemplate() throws Exception{
+ String templatePath = properties.getProperty("email.template.path",
"template");
+ String templateFile = properties.getProperty("email.template.file",
"quote");
+
+ logger.info("loading StringTemplate from path: "+templatePath);
+ logger.info("loading StringTemplate from file: "+templateFile);
+
+ StringTemplateGroup group = new StringTemplateGroup("loan");
+ StringTemplate email = group.getInstanceOf(templatePath + "/" +
templateFile);
+
+ //String email, String quoteID, String rate, String code, String ssn
+ email.setAttribute("quote", quoteID);
+ email.setAttribute("rate", rate);
+ email.setAttribute("ssn", ssn);
+ email.setAttribute("code", code);
+ email.setAttribute("email", emailTo);
+
+ return email.toString();
+
+ }
+
+ public static void main(String[] args) {
+ ProcessEmail email = new ProcessEmail("dbrum101(a)gmail.com", "111",
".65", "0", "123456");
+ email.sendEmail();
+
+ }
+
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TbBootStrapper.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TbBootStrapper.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TbBootStrapper.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,175 @@
+/*
+ * 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.trailblazer.util;
+
+import java.io.File;
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.Statement;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.xml.DOMConfigurator;
+import org.jboss.soa.esb.persistence.manager.ConnectionManager;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.listeners.StandAloneBootStrapper;
+import org.jboss.soa.esb.persistence.manager.ConnectionManagerFactory;
+import org.jboss.soa.esb.testutils.FileUtil;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+
+public class TbBootStrapper extends StandAloneBootStrapper {
+
+ protected static Logger _logger = Logger.getLogger(TbBootStrapper.class);
+
+ public static void main(String[] args) throws Exception
+ {
+ Exception eT = null;
+ if (args.length < 1)
+ {
+ eT = new Exception ("No configuration file specified - Ending
immediately");
+ _logger.fatal(eT);
+ throw eT;
+ } else {
+ _logger.info("Starting the trailblazer with arg=" + args[0]);
+ }
+ TbBootStrapper boot = null;
+
+ String configName = args[0];
+ long lSecondsToRun = 365 * 24 * 3600; // run for 1 year (is it enough ?)
+ if (args.length > 1)
+ try
+ {
+ lSecondsToRun = Long.parseLong(args[1]);
+ }
+ catch (Exception e)
+ {
+ _logger.fatal(e);
+ throw e;
+ }
+ try
+ {
+ boot = new TbBootStrapper(configName);
+ if (lSecondsToRun < 5)
+ lSecondsToRun = 5;
+ long lRunTo = System.currentTimeMillis()+1000*lSecondsToRun;
+
+ while (System.currentTimeMillis() < lRunTo)
+ try { Thread.sleep(1000); }
+ catch (InterruptedException e) { break; }
+ }
+ finally
+ {
+ if (null!=boot)
+ boot.requestEnd();
+ }
+ }
+
+ private TbBootStrapper() throws Exception {super(null);}
+
+ public TbBootStrapper (String configName) throws Exception
+ {
+ super(configName, null);
+ }
+
+ public TbBootStrapper (String configName, String validationFileName) throws Exception
+ {
+ super(configName, validationFileName);
+ }
+
+ /*
+ * Setup HSQLDB for the Registry and the MessageStore
+ */
+ protected void runBefore(){
+ //System.setProperty("com.arjuna.common.util.propertyservice.verbosePropertyManager",
"on");
+ String baseDir="";
+ String productDir = "../../";
+ if
(TestEnvironmentUtil.getUserDir("trailblazer").equals("trailblazer/"))
{
+ baseDir = "product/samples/trailblazer/";
+ productDir = "product/";
+ }
+ DOMConfigurator.configure(baseDir + "log4j.xml");
+ String driver = Configuration.getStoreDriver();
+ System.out.println("Driver=" + driver);
+ if ("org.hsqldb.jdbcDriver".equals(driver)) {
+
+ //start hsqldb
+ try {
+ HsqldbUtil.startHsqldb(productDir + "build/hsqldb", "jbossesb");
+ String database = "hsqldb";
+
+ //message store db
+ String sqlDir = productDir + "install/message-store/sql/" + database +
"/";
+ String sqlCreateCmd = TestEnvironmentUtil.readTextFile(new File(sqlDir +
"create_database.sql"));
+ String sqlDropCmd = TestEnvironmentUtil.readTextFile(new File(sqlDir +
"drop_database.sql"));
+
+ ConnectionManager mgr = ConnectionManagerFactory.getConnectionManager();
+ Connection con = mgr.getConnection();
+
+ Statement stmnt = con.createStatement();
+ System.out.println("Dropping the message store schema if exists...");
+ stmnt.execute(sqlDropCmd);
+ System.out.println("Creating the message store schema...");
+ stmnt.execute(sqlCreateCmd);
+
+ //registry DB
+ sqlDir = productDir + "install/jUDDI-registry/sql/" + database +
"/";
+ System.out.println("Dropping the registry schema if exists...");
+ sqlDropCmd = TestEnvironmentUtil.readTextFile(new File(sqlDir +
"drop_database.sql")).replaceAll("\\$\\{prefix}", "");
+ stmnt.execute(sqlDropCmd);
+ System.out.println("creating the registry schema...");
+ String resource = "juddi-sql/" + database +
"/create_database.sql";
+ InputStream is =
Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
+ sqlCreateCmd =
FileUtil.readStream(is).trim().replaceAll("\\$\\{prefix}", "");
+ stmnt.execute(sqlCreateCmd);
+ System.out.println("inserting registry publishers...");
+ String sqlInsertPubCmd = TestEnvironmentUtil.readTextFile(new File(sqlDir +
"import.sql")).trim().replaceAll("\\$\\{prefix}", "");
+ stmnt.execute(sqlInsertPubCmd);
+ stmnt.close();
+ con.close();
+ }catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /*
+ * Shuts down the HSQLDB instance
+ */
+ protected void runAfter()
+ {
+ try { Thread.sleep(5000); }
+ catch (InterruptedException e) {}
+
+ //shutdown message store if using hsqldb
+ if ("org.hsqldb.jdbcDriver".equals(Configuration.getStoreDriver())) {
+ try {
+ HsqldbUtil.stopHsqldb(Configuration.getStoreUrl(),
+ Configuration.getStoreUser(),Configuration.getStorePwd() );
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+
+
+}
Added:
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TrailblazerProperties.java
===================================================================
---
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TrailblazerProperties.java
(rev 0)
+++
cdl/trunk/samples/jbossesb/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/util/TrailblazerProperties.java 2008-08-29
16:12:31 UTC (rev 288)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.trailblazer.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Trilablazer Properties.
+ * @author <a
href="mailto:tom.fennelly@jboss.com">tom.fennelly@jboss.com</a>
+ */
+public class TrailblazerProperties extends Properties {
+
+ private static final long serialVersionUID = 1L;
+ public static final String CONFIG_FILE = "trailblazer.properties";
+ private static Logger logger = Logger.getLogger(TrailblazerProperties.class);
+
+ public TrailblazerProperties() {
+ InputStream config = ClassUtil.getResourceAsStream("/" + CONFIG_FILE,
TrailblazerProperties.class);
+
+ if(config == null) {
+ logger.error("Failed to locate '" + CONFIG_FILE + "'
in the root of the classpath.");
+ return;
+ }
+
+ try {
+ load(config);
+ } catch (IOException e) {
+ logger.error("Error reading '" + CONFIG_FILE +
"'.", e);
+ } finally {
+ try {
+ config.close();
+ } catch (IOException e) {
+ logger.warn("Failed to close stream to '" + CONFIG_FILE +
"'.");
+ }
+ }
+ }
+}
Added: cdl/trunk/samples/jbossesb/trailblazer/juddi.properties
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/juddi.properties (rev
0)
+++ cdl/trunk/samples/jbossesb/trailblazer/juddi.properties 2008-08-29 16:12:31 UTC (rev
288)
@@ -0,0 +1,70 @@
+# 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(a)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=org.hsqldb.jdbcDriver
+#juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/jbossesb
+juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost:9001/jbossesb
+juddi.jdbcUsername=sa
+juddi.jdbcPassword=
+# jUDDI DataSource to use
+juddi.dataSource=java:comp/env/jdbc/juddiDB
+
+# 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: cdl/trunk/samples/jbossesb/trailblazer/log4j.xml
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/log4j.xml (rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/log4j.xml 2008-08-29 16:12:31 UTC (rev 288)
@@ -0,0 +1,300 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.10 2006/04/21 17:29:20 csuconic 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">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
+ <errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./trailblazer.log"/>
+ <param name="Append" value="false"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern"
value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern"
value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c]
%m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c]
(%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+ <!-- 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="${jboss.server.log.dir}/server.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 [%c]
%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ============================== -->
+ <!-- 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="DEBUG"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p
[%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ====================== -->
+ <!-- More Appender examples -->
+ <!-- ====================== -->
+
+ <!-- Buffer events and log them asynchronously
+ <appender name="ASYNC"
class="org.apache.log4j.AsyncAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <appender-ref ref="FILE"/>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="SMTP"/>
+ </appender>
+ -->
+
+ <!-- EMail events to an administrator
+ <appender name="SMTP"
class="org.apache.log4j.net.SMTPAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Threshold" value="ERROR"/>
+ <param name="To" value="admin(a)myhost.domain.com"/>
+ <param name="From" value="nobody(a)myhost.domain.com"/>
+ <param name="Subject" value="JBoss Sever Errors"/>
+ <param name="SMTPHost" value="localhost"/>
+ <param name="BufferSize" value="10"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}]
%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Syslog events
+ <appender name="SYSLOG"
class="org.apache.log4j.net.SyslogAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Facility" value="LOCAL7"/>
+ <param name="FacilityPrinting" value="true"/>
+ <param name="SyslogHost" value="localhost"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}]
%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Log events to JMS (requires a topic to be created)
+ <appender name="JMS"
class="org.apache.log4j.net.JMSAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Threshold" value="ERROR"/>
+ <param name="TopicConnectionFactoryBindingName"
value="java:/ConnectionFactory"/>
+ <param name="TopicBindingName"
value="topic/MyErrorsTopic"/>
+ </appender>
+ -->
+
+ <!-- Log events through SNMP
+ <appender name="TRAP_LOG"
class="org.apache.log4j.ext.SNMPTrapAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="ImplementationClassName"
value="org.apache.log4j.ext.JoeSNMPTrapSender"/>
+ <param name="ManagementHost" value="127.0.0.1"/>
+ <param name="ManagementHostTrapListenPort" value="162"/>
+ <param name="EnterpriseOID" value="1.3.6.1.4.1.24.0"/>
+ <param name="LocalIPAddress" value="127.0.0.1"/>
+ <param name="LocalTrapSendPort" value="161"/>
+ <param name="GenericTrapType" value="6"/>
+ <param name="SpecificTrapType" value="12345678"/>
+ <param name="CommunityString" value="public"/>
+ <param name="ForwardStackTraceWithTrap" value="true"/>
+ <param name="Threshold" value="DEBUG"/>
+ <param name="ApplicationTrapOID"
value="1.3.6.1.4.1.24.12.10.22.64"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
value="%d,%p,[%t],[%c],%m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- Emit events as JMX notifications
+ <appender name="JMX"
class="org.jboss.monitor.services.JMXNotificationAppender">
+ <errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+
+ <param name="Threshold" value="WARN"/>
+ <param name="ObjectName"
value="jboss.system:service=Logging,type=JMXNotificationAppender"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c]
%m"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+ <category name="org.apache">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is
verbose -->
+ <category name="org.jboss.serial">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+ <category name="org.jgroups">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+ <category name="jacorb">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit JBoss categories
+ <category name="org.jboss">
+ <priority value="INFO"/>
+ </category>
+ -->
+
+ <!-- Limit the JSR77 categories -->
+ <category name="org.jboss.management">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit Axis based webservice category -->
+ <category name="org.jboss.webservice">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.axis">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit JBossWS webservice category
+ <category name="org.jboss.ws">
+ <priority value="DEBUG"/>
+ </category>
+ -->
+
+ <!-- Decrease the priority threshold for the org.jboss.varia category
+ <category name="org.jboss.varia">
+ <priority value="DEBUG"/>
+ </category>
+ -->
+
+ <!-- Show the evolution of the DataSource pool in the logs [inUse/Available/Max]
+ <category
name="org.jboss.resource.connectionmanager.JBossManagedConnectionPool">
+ <priority value="TRACE"
class="org.jboss.logging.XLevel"/>
+ </category>
+ -->
+
+ <!--
+ | An example of enabling the custom TRACE level priority that is used
+ | by the JBoss internals to diagnose low level details. This example
+ | turns on TRACE level msgs for the org.jboss.ejb.plugins package and its
+ | subpackages. This will produce A LOT of logging output.
+ <category name="org.jboss.system">
+ <priority value="TRACE"
class="org.jboss.logging.XLevel"/>
+ </category>
+ <category name="org.jboss.ejb.plugins">
+ <priority value="TRACE"
class="org.jboss.logging.XLevel"/>
+ </category>
+ -->
+
+ <!--
+ | Logs these events to SNMP:
+ - server starts/stops
+ - cluster evolution (node death/startup)
+ - When an EJB archive is deployed (and associated verified messages)
+ - When an EAR archive is deployed
+
+ <category name="org.jboss.system.server.Server">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category
name="org.jboss.ha.framework.interfaces.HAPartition.lifecycle">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category name="org.jboss.deployment.MainDeployer">
+ <priority value="ERROR" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category name="org.jboss.ejb.EJBDeployer">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ <category name="org.jboss.deployment.EARDeployer">
+ <priority value="INFO" />
+ <appender-ref ref="TRAP_LOG"/>
+ </category>
+
+ -->
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+ <!-- Clustering logging -->
+ <!-- Uncomment the following to redirect the org.jgroups and
+ org.jboss.ha categories to a cluster.log file.
+
+ <appender name="CLUSTER"
class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File"
value="${jboss.server.log.dir}/cluster.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 [%c]
%m%n"/>
+ </layout>
+ </appender>
+ <category name="org.jgroups">
+ <priority value="DEBUG" />
+ <appender-ref ref="CLUSTER"/>
+ </category>
+ <category name="org.jboss.ha">
+ <priority value="DEBUG" />
+ <appender-ref ref="CLUSTER"/>
+ </category>
+ -->
+
+</log4j:configuration>
Added: cdl/trunk/samples/jbossesb/trailblazer/readme.txt
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/readme.txt (rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/readme.txt 2008-08-29 16:12:31 UTC (rev 288)
@@ -0,0 +1,44 @@
+
+The trailblazer is a small application that uses several of the services provided by the
JBoss ESB.
+
+
+Required to run the Trailblazer:
+- ANT
+- A mail server to send email notifications
+- JBoss AS 4.2.1 or higher with EJB3 and JBossWS support. You can install the latest
JBoss AS JEMS installer and select the "EJB3" install config to get the right
one installed.
+- JBoss AS 4.2.1 or higher with the JBoss ESB SAR deployment (jbossesb.sar).
+
+Settings required to edit before running:
+
+File: jbossesb-properties.xml (jbossesb.sar/jbossesb-properties.xml)
+- Update the section titled "transports" and specify all of the SMTP mail
server settings for your environment.
+
+File : deployment.properties (install/deployment.properties)
+- Update the app server location settings.
+
+File : trailblazer.properties (TB_ROOT/trailblazer.properties)
+- Update the file.bank.monitored.directory and file.output.directory properties'
value properly.
+ These are input and output folder needs to be specified, they are set to /tmp/input
/tmp/output by default.
+
+File : jboss-esb.xml (TB_ROOT/esb/conf/jboss-esb.xml)
+- there is a "<fs-provider>..</fs-provider>" block, update the
"directory" attribute value as same as file.output.directory value in
trailblazer.properties file.
+
+Basic Trailblazer example running instructions:
+------------------------------------------------
+To run the Trailblazer, follow these steps:
+
+1 - run your JBoss AS - you will need to have the 4.2.1 or higher with the EJB3 support
installed. This is required because the TB uses the JSR-181 pojo style web service.
+
+2 - from the TB_ROOT, execute the command to start the ESB: "ant deploy"
+* this should deploy the ESB and WAR files to your JBoss AS server/default.
+
+3 - from the TB_ROOT/banks execute the command to start the JMS Bank service: "ant
runJMSBank".
+
+4 - start another window/shell, from the TB_ROOT/banks execute the command to start the
File bank service: "ant runFileBank".
+
+5 - from the jsp: localhost:8080/trailblazer.
+
+That's it. Now you can submit quotes, You will see either a loan request rejected
(single email)
+because the score is less than 4, or two emails (one from JMS bank and one from
FileBased
+bank) with valid quotes.
+
Added: cdl/trunk/samples/jbossesb/trailblazer/template/quote.st
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/template/quote.st (rev
0)
+++ cdl/trunk/samples/jbossesb/trailblazer/template/quote.st 2008-08-29 16:12:31 UTC (rev
288)
@@ -0,0 +1,20 @@
+JBossESB - TrailBlazer Quote Response Notification
+
+Customer SSN: $ssn$
+Customer Email: $email$
+
+-- BANK QUOTES RECEIVED --
+
+QUOTE ID: $quote$
+RATE: $rate$
+BANK CODE: $code$
+
+-- BANK CODES --
+0 - success
+1 - loan term exceeds the maximum available loan term
+2 - invalid SSN
+3 - invalid credit score
+4 - invalid credit history length
+5 - invalid loan term
+6 - invalid message
+7 - invalid customer ID
Added: cdl/trunk/samples/jbossesb/trailblazer/trailblazer.properties
===================================================================
--- cdl/trunk/samples/jbossesb/trailblazer/trailblazer.properties
(rev 0)
+++ cdl/trunk/samples/jbossesb/trailblazer/trailblazer.properties 2008-08-29 16:12:31 UTC
(rev 288)
@@ -0,0 +1,30 @@
+
+# Credit Agency configs
+creditagency.service.category=tbCreditAGency
+creditagency.service.epr.name=creditagency
+
+# Bank configs
+bank1.service.category=tbBanks
+bank1.service.epr.name=jmsBank
+bank2.service.category=tbBanks
+bank2.service.epr.name=fileBank
+
+# FileBank config
+
+file.bank.monitored.dir=/tmp/input
+file.output.directory=/tmp/output
+
+#JMS Bank config
+jms.provider.url=localhost
+jms.queue.in=queue/jms-tb-jmsBankRequestQueue
+jms.queue.out=queue/esb-tb-jmsBankGatewayResponseQueue
+
+
+# Notifier configs
+notifier.service.category=notifiers
+notifier.service.epr.name=customer
+
+# Customer email notification configs
+email.from=email(a)jboss.com
+email.template.path=template
+email.template.file=quote