[jboss-svn-commits] JBL Code SVN: r6326 - in labs/jbossesb/trunk/product: core/listeners core/listeners/src/org/jboss/soa/esb/actions core/listeners/tests/src/org/jboss/soa/esb/actions docs/samples/trailblazer/bankloanbrokerdemo/banks/src/org/jboss/soa/esb/samples/loanbroker/banks docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks docs/samples/trailblazer/bankloanbrokerdemo/conf docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/actions docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/adapters docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/banks lib/ext
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 20 12:59:47 EDT 2006
Author: tfennelly
Date: 2006-09-20 12:59:20 -0400 (Wed, 20 Sep 2006)
New Revision: 6326
Added:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ObjectToXStream.java
labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ObjectToXStreamUnitTest.java
labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestBean.java
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/BankQuote.java
labs/jbossesb/trunk/product/lib/ext/xstream-1.1.3.jar
Removed:
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/actions/ObjectToXStream.java
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java
Modified:
labs/jbossesb/trunk/product/core/listeners/build.xml
labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ObjectToFileWriterUnitTest.java
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/conf/LoanBrokerConfig.xml.template
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/actions/ProcessCreditResponse.java
labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/adapters/CustomerAdapter.java
Log:
Fix for Kurts Eclipse - duplicate classes in bank and loanbroker code
Modified: labs/jbossesb/trunk/product/core/listeners/build.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/build.xml 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/core/listeners/build.xml 2006-09-20 16:59:20 UTC (rev 6326)
@@ -15,7 +15,7 @@
</condition>
<path id="org.jboss.esb.listeners.base.classpath">
- <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="activation.jar jbossall-client.jar log4j.jar mail.jar"/>
+ <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="activation.jar jbossall-client.jar log4j.jar mail.jar xstream-1.1.3.jar"/>
</path>
<path id="org.jboss.esb.listeners.default.classpath">
Added: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ObjectToXStream.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ObjectToXStream.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ObjectToXStream.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -0,0 +1,94 @@
+/*
+ * 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.actions;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionProcessor;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+
+import com.thoughtworks.xstream.XStream;
+
+/**
+ * Object to XML processor.
+ * <p/>
+ * Uses the <a href="http://xstream.codehaus.org/">XStream</a> processor to generate an XML message String from the supplied object.
+ * <p/>
+ * Sample Action Configuration:
+ * <pre>
+ * <Action name="Customer-To-XML" processor="ObjectToXStream">
+ * <property name="class-alias" value="Customer" /> <!-- Class alias used in call to <a href="http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/XStream.html">XStream.alias(String, Class)</a> prior to serialisation. -->
+ * <property name="exclude-package" value="false" /> <!-- Default "true". Not applicable if a "class-alias" is specified. -->
+ * </Action>
+ * <p/>
+ * The XML root element is either set from the "class-alias" property or the classes full name. In the later case, the class package is
+ * excluded unless "exclude-package" is set to "false"/"no".
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class ObjectToXStream implements ActionProcessor {
+
+ private String classAlias;
+ private boolean excludePackage;
+
+ public ObjectToXStream(String actionName, List<KeyValuePair> properties) {
+ classAlias = KeyValuePair.getValue("class-alias", properties);
+ excludePackage = KeyValuePair.getBooleanValue("exclude-package", properties, true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
+ */
+ public Object process(Object object) throws ActionProcessingException {
+ XStream xstream = new XStream();
+
+ if(classAlias == null) {
+ if(excludePackage) {
+ xstream.alias(object.getClass().getSimpleName(), object.getClass());
+ } else {
+ xstream.alias(object.getClass().getName(), object.getClass());
+ }
+ } else {
+ xstream.alias(classAlias, object.getClass());
+ }
+
+ return xstream.toXML(object);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.soa.esb.actions.ActionProcessor#getOkNotification(java.lang.Object)
+ */
+ public Serializable getOkNotification(Object message) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.soa.esb.actions.ActionProcessor#getErrorNotification(java.lang.Object)
+ */
+ public Serializable getErrorNotification(Object message) {
+ return null;
+ }
+}
Modified: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ObjectToFileWriterUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ObjectToFileWriterUnitTest.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ObjectToFileWriterUnitTest.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -29,7 +29,6 @@
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.listeners.DirectoryPoller.WorkingFile;
import junit.framework.TestCase;
Added: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ObjectToXStreamUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ObjectToXStreamUnitTest.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ObjectToXStreamUnitTest.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -0,0 +1,110 @@
+/*
+ * 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.actions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.soa.esb.helpers.KeyValuePair;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+import junit.framework.TestCase;
+
+/**
+ * ObjectToXStream unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class ObjectToXStreamUnitTest extends TestCase {
+
+ public void test_default() throws ActionProcessingException {
+ List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+
+ ObjectToXStream objectToXStream = new ObjectToXStream("TestBean-Serialiser", properties);
+
+ String xml = (String)objectToXStream.process(new TestBean("Tom", "1234"));
+ XStream xstream = new XStream(new DomDriver());
+ TestBean bean = new TestBean();
+
+ assertTrue("Expected [<TestBean>]. Got [" + xml + "]", xml.startsWith("<TestBean>"));
+ xstream.alias("TestBean", TestBean.class);
+ xstream.fromXML(xml, bean);
+
+ assertEquals("Tom", bean.getName());
+ assertEquals("1234", bean.getPhone());
+ }
+
+ public void test_with_package() throws ActionProcessingException {
+ List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+
+ properties.add(new KeyValuePair("exclude-package", "false"));
+ ObjectToXStream objectToXStream = new ObjectToXStream("TestBean-Serialiser", properties);
+
+ String xml = (String)objectToXStream.process(new TestBean("Tom", "1234"));
+ XStream xstream = new XStream(new DomDriver());
+ TestBean bean = new TestBean();
+
+ assertTrue("Expected start with [<" + TestBean.class.getName() + ">]. Got [" + xml + "]", xml.startsWith("<" + TestBean.class.getName() + ">"));
+ xstream.fromXML(xml, bean);
+
+ assertEquals("Tom", bean.getName());
+ assertEquals("1234", bean.getPhone());
+ }
+
+ public void test_with_alias() throws ActionProcessingException {
+ List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+
+ properties.add(new KeyValuePair("class-alias", "TomsClass"));
+ ObjectToXStream objectToXStream = new ObjectToXStream("TestBean-Serialiser", properties);
+
+ String xml = (String)objectToXStream.process(new TestBean("Tom", "1234"));
+ XStream xstream = new XStream(new DomDriver());
+ xstream.alias("TomsClass", TestBean.class);
+ TestBean bean = new TestBean();
+
+ assertTrue("Expected start with [<TomsClass>]. Got [" + xml + "]", xml.startsWith("<TomsClass>"));
+ xstream.fromXML(xml, bean);
+
+ assertEquals("Tom", bean.getName());
+ assertEquals("1234", bean.getPhone());
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Added: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestBean.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestBean.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestBean.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -0,0 +1,53 @@
+/*
+ * 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.actions;
+
+/**
+ * Just a simple test JavaBean class.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class TestBean {
+ private String name;
+ private String phone;
+
+ public TestBean() {
+ }
+ public TestBean(String name, String phone) {
+ this.name = name;
+ this.phone = phone;
+ }
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getPhone() {
+ return phone;
+ }
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+}
Modified: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -47,7 +47,7 @@
/**
* 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 BankQuote Reply will be serialized to XML
+ * 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
@@ -103,7 +103,7 @@
/**
* 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 BankQuote Reply will be serialized to XML
+ * 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.
*
@@ -116,8 +116,9 @@
TextMessage textMessage = (TextMessage) message;
String xml = textMessage.getText();
XStream xstream = new XStream(new DomDriver());
- BankQuoteRequest bankQuoteRequest = (BankQuoteRequest) xstream
- .fromXML(xml);
+ BankQuoteRequest bankQuoteRequest = new BankQuoteRequest();
+
+ xstream.fromXML(xml, bankQuoteRequest);
Bank bank = new Bank(BANK_NAME, RATE_PREMIUM, MAXLOANTERM);
BankQuoteReply bankQuoteReply = bank
.processMessage(bankQuoteRequest);
Modified: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequestTest.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -34,10 +34,10 @@
private Logger logger = Logger.getLogger(this.getClass());
/**
- * Testing the XML layout of a BankQuoteRequest
+ * Testing the XML layout of a BankQuote
*/
@Test public void obtainExampleXML(){
- BankQuoteRequest bankQuoteRequest = new BankQuoteRequest();
+ BankQuoteRequest bankQuoteRequest = new BankQuoteRequest();
bankQuoteRequest.setSsn(123456890);
bankQuoteRequest.setCreditScore(3);
bankQuoteRequest.setHistoryLength(4);
Modified: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/BankTest.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -41,7 +41,7 @@
*/
@Test public void processLoanRequest(){
- //Building a BankQuoteRequest
+ //Building a BankQuote
BankQuoteRequest bankQuoteRequest = new BankQuoteRequest();
bankQuoteRequest.setSsn(123456890);
bankQuoteRequest.setCreditScore(3);
Modified: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/banks/test/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -54,8 +54,8 @@
@Test public void sendLoanRequestXML()
{
- // Building a BankQuoteRequest
- BankQuoteRequest bankQuoteRequest = new BankQuoteRequest();
+ // Building a BankQuote
+ BankQuoteRequest bankQuoteRequest = new BankQuoteRequest();
bankQuoteRequest.setSsn(123456890);
bankQuoteRequest.setCreditScore(3);
bankQuoteRequest.setHistoryLength(4);
Modified: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/conf/LoanBrokerConfig.xml.template
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/conf/LoanBrokerConfig.xml.template 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/conf/LoanBrokerConfig.xml.template 2006-09-20 16:59:20 UTC (rev 6326)
@@ -52,7 +52,7 @@
<ToJMSBankRouter
listenerClass="org.jboss.soa.esb.listeners.JmsQueueListener"
- actions="ObjectToXStream, Route-BankQuote-XML-To-JMSBank"
+ actions="BankQuote-To-XML, Route-BankQuote-XML-To-JMSBank"
maxThreads="1"
queueConnFactoryClass="ConnectionFactory"
@@ -142,7 +142,9 @@
<property name="ext" value="dat" />
</Action>
- <Action name="ObjectToXStream" processor="ObjectToXStream" />
+ <Action name="BankQuote-To-XML" processor="ObjectToXStream">
+ <property name="class-alias" value="org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteRequest" />
+ </Action>
<Action name="FileToByteArray" processor="FileToByteArray" />
@@ -163,7 +165,7 @@
<Alias name="ObjectToFileWriter" class="org.jboss.soa.esb.actions.ObjectToFileWriter" />
<Alias name="FileToByteArray" class="org.jboss.soa.esb.actions.FileToByteArray" />
<Alias name="ByteArrayToString" class="org.jboss.soa.esb.actions.ByteArrayToString" />
- <Alias name="ObjectToXStream" class="org.jboss.soa.esb.samples.loanbroker.actions.ObjectToXStream" />
+ <Alias name="ObjectToXStream" class="org.jboss.soa.esb.actions.ObjectToXStream" />
<Alias name="ToBankQuoteResponse" class="org.jboss.soa.esb.samples.loanbroker.actions.ToBankQuoteResponse" />
<Alias name="ProcessBanksResponse" class="org.jboss.soa.esb.samples.loanbroker.actions.ProcessBanksResponse" />
</ProcessorAliases>
Added: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/BankQuote.java
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/BankQuote.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/BankQuote.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -0,0 +1,127 @@
+/*
+* 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;
+
+import java.io.Serializable;
+
+
+public class BankQuote implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ public int ssn;
+ public int creditScore;
+ public int historyLength;
+ public int loanAmount;
+ public int loanTerm;
+ public String customerUID;
+
+ /**
+ * 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;
+ }
+ /**
+ * Returns a human readable string representation of this object.
+ * @return toString
+ */
+ public String toString() {
+ return this.getClass().getSimpleName() + "=["
+ + "ssn=" + ssn
+ + ", creditScore=" + creditScore
+ + ", historyLength=" + historyLength
+ + ", loanAmount=" + loanAmount
+ + ", loanTerm=" + loanTerm
+ + ", customerUID="+ customerUID + "]";
+ }
+
+ public String getCustomerUID() {
+ return customerUID;
+ }
+ public void setCustomerUID(String customerUID) {
+ this.customerUID = customerUID;
+ }
+}
Deleted: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/actions/ObjectToXStream.java
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/actions/ObjectToXStream.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/actions/ObjectToXStream.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -1,65 +0,0 @@
-/*
- * 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.actions;
-
-import java.io.Serializable;
-
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionProcessor;
-
-import com.thoughtworks.xstream.XStream;
-
-/**
- * Object to XML processor.
- * <p/>
- * Uses the XStream processor to generate an XML message String from the supplied object.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ObjectToXStream implements ActionProcessor {
-
- /* (non-Javadoc)
- * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
- */
- public Object process(Object object) throws ActionProcessingException {
- XStream xstream = new XStream();
- xstream.alias(object.getClass().getName(), object.getClass());
-
- return xstream.toXML(object);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.soa.esb.actions.ActionProcessor#getOkNotification(java.lang.Object)
- */
- public Serializable getOkNotification(Object message) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.jboss.soa.esb.actions.ActionProcessor#getErrorNotification(java.lang.Object)
- */
- public Serializable getErrorNotification(Object message) {
- return null;
- }
-}
Modified: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/actions/ProcessCreditResponse.java
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/actions/ProcessCreditResponse.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/actions/ProcessCreditResponse.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -40,8 +40,8 @@
import org.jboss.soa.esb.common.SystemProperties;
import org.jboss.soa.esb.helpers.AppServerContext;
import org.jboss.soa.esb.jboss.loanbroker.util.FileUtil;
+import org.jboss.soa.esb.samples.loanbroker.BankQuote;
import org.jboss.soa.esb.samples.loanbroker.adapters.CustomerAdapter;
-import org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteRequest;
import org.jboss.soa.esb.samples.loanbroker.creditagency.CreditCheckResponseNotification;
import org.jboss.soa.esb.samples.loanbroker.domain.CreditRating;
import org.jboss.soa.esb.samples.loanbroker.domain.Customer;
@@ -86,7 +86,7 @@
logger.info(this.getClass().getSimpleName() + " -- Business Object AFTER Credit Rating is added: \n" + customer.toDTO().toXml());
// m_oLogger.info(this.getClass().getSimpleName() + " -- Customer2 TEST DEBUG customer2: \n" + customer2.toDTO().toXml());
- BankQuoteRequest quote = CustomerAdapter.bankQuoteFromCustomer(customer);
+ BankQuote quote = CustomerAdapter.bankQuoteFromCustomer(customer);
return quote;
} catch(Exception e) {
throw new ActionProcessingException("Failed to process credit check response.", e);
Modified: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/adapters/CustomerAdapter.java
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/adapters/CustomerAdapter.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/adapters/CustomerAdapter.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -30,7 +30,7 @@
import org.jboss.soa.esb.common.bizclasses.OneValue;
import org.jboss.soa.esb.common.bizclasses.Person;
import org.jboss.soa.esb.helpers.DomElement;
-import org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteRequest;
+import org.jboss.soa.esb.samples.loanbroker.BankQuote;
import org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteResponse;
import org.jboss.soa.esb.samples.loanbroker.domain.CreditRating;
import org.jboss.soa.esb.samples.loanbroker.domain.Customer;
@@ -103,8 +103,8 @@
return new WebCustomer(sName,sAddr,sEmployer,dSalary,iLoanDur,dAmount,ssn,email);
}//_________________________________________
- public static BankQuoteRequest bankQuoteFromCustomer(Customer p_o) {
- BankQuoteRequest bankRequest = new BankQuoteRequest();
+ public static BankQuote bankQuoteFromCustomer(Customer p_o) {
+ BankQuote bankRequest = new BankQuote();
CreditRating rating = p_o.getRating();
bankRequest.creditScore = rating.getScore();
String sVal = new DecimalFormat("########0").format(Double.parseDouble(p_o.getField(Customer.ATTRIB.loanAmt)));
Deleted: labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java
===================================================================
--- labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java 2006-09-20 16:17:48 UTC (rev 6325)
+++ labs/jbossesb/trunk/product/docs/samples/trailblazer/bankloanbrokerdemo/java/src/org/jboss/soa/esb/samples/loanbroker/banks/BankQuoteRequest.java 2006-09-20 16:59:20 UTC (rev 6326)
@@ -1,127 +0,0 @@
-/*
-* 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 int creditScore;
- public int historyLength;
- public int loanAmount;
- public int loanTerm;
- public String customerUID;
-
- /**
- * 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;
- }
- /**
- * Returns a human readable string representation of this object.
- * @return toString
- */
- public String toString() {
- return this.getClass().getSimpleName() + "=["
- + "ssn=" + ssn
- + ", creditScore=" + creditScore
- + ", historyLength=" + historyLength
- + ", loanAmount=" + loanAmount
- + ", loanTerm=" + loanTerm
- + ", customerUID="+ customerUID + "]";
- }
-
- public String getCustomerUID() {
- return customerUID;
- }
- public void setCustomerUID(String customerUID) {
- this.customerUID = customerUID;
- }
-}
Added: labs/jbossesb/trunk/product/lib/ext/xstream-1.1.3.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/trunk/product/lib/ext/xstream-1.1.3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the jboss-svn-commits
mailing list