[jboss-svn-commits] JBL Code SVN: r7758 - in labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web: . generated
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 22 03:25:02 EST 2006
Author: daniel.brum at jboss.com
Date: 2006-11-22 03:24:07 -0500 (Wed, 22 Nov 2006)
New Revision: 7758
Modified:
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerWS.java
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWS.java
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSBindingStub.java
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSProxy.java
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSService.java
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSServiceLocator.java
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/WebCustomer.java
Log:
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerWS.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerWS.java 2006-11-22 08:20:33 UTC (rev 7757)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerWS.java 2006-11-22 08:24:07 UTC (rev 7758)
@@ -22,25 +22,13 @@
*/
package org.jboss.soa.esb.samples.trailblazer.web;
-import java.util.Collection;
-import java.util.Iterator;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.thirdparty.Base64;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierFactory;
-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.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
+import org.jboss.soa.esb.samples.trailblazer.loanbroker.LoanBroker;
/**
* The Loan broker web service, which will handle a loan request.
@@ -51,66 +39,42 @@
{
private static Logger logger = Logger.getLogger(LoanBrokerWS.class);
- //used to locate our entries in the trailblazer-properties.xml
- private final String MODULE_NAME = "trailblazer";
- private final String SERVICE_NAME = "org.jboss.soa.esb.trailblazer.request.service.epr.name";
- private final String SERVICE_CAT = "org.jboss.soa.esb.trailblazer.request.service.category";
-
+
@WebMethod
// method name is .NET friendly
public void RequestLoan(WebCustomer customer) {
- try {
- /**
- * Use the JBoss ESB services to send the message onto it's destination.
- * This is only possible with ESB Message Aware services -
- * see the TODO: add name of package which interacts with banks
- * to see how a non-Message aware situation is handled
- */
- System.setProperty("org.jboss.soa.esb.propertyFile", "trailblazer-properties.xml");
-// System.setProperty("com.arjuna.common.util.propertyservice.verbosePropertyManager", "ON");
- logger.info("WebCustomer received: \n" + customer);
- //Step 1 - convert customer from web service into a ESB Message
- Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
- message.getBody().setContents(Base64.encodeObject(customer).getBytes());
+ logger.info("WebCustomer received: \n" + customer);
- //step 2 - locate the service in the registry
- Registry registry = RegistryFactory.getRegistry();
- String serviceCategoryName = ModulePropertyManager.getPropertyManager(MODULE_NAME).getProperty(SERVICE_CAT, "trailblazer");
- String serviceName = ModulePropertyManager.getPropertyManager(MODULE_NAME).getProperty(SERVICE_NAME, "LoanRequestService");;
-
+ LoanBroker broker = new LoanBroker();
+ broker.processLoanRequest(customer);
- logger.info("looking for the following service in the registry -- Category: " + serviceCategoryName);
- logger.info("looking for the following service in the registry -- Name: " + serviceName);
- //Step 3 - use the service to send the message
- Collection<EPR> eprs = registry.findEPRs(serviceCategoryName, serviceName);
- for (Iterator<EPR> eprIterator=eprs.iterator();eprIterator.hasNext();){
- //Just use the first EPR in the list.
- EPR epr = eprIterator.next();
- Courier courier = CourierFactory.getCourier(epr);
- //If not successful try the next EPR
- if (JMSEpr.class.equals(epr.getClass())) {
-
- if (courier.deliver(message)) {
- break;
- } else {
- logger.warn("Could not deliver the message, maybe there is another JMS-EPR we can use.");
- }
- } else {
- logger.warn("Found a non-JMS EPR, but since we want a reply we need a JMS-EPR");
- }
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- logger.error(e);
- }
-
}
+ private String getCSVFromCustomer(WebCustomer customer){
+ StringBuffer buff = new StringBuffer();
+ buff.append(customer.ssn);
+ buff.append(",");
+ buff.append(customer.name);
+ buff.append(",");
+ buff.append(customer.loanAmount);
+ buff.append(",");
+ buff.append(customer.loanDuration);
+ buff.append(",");
+ buff.append(customer.salary);
+ buff.append(",");
+ buff.append(customer.address);
+ buff.append(",");
+ buff.append(customer.email);
+ buff.append(",");
+ buff.append(customer.employerName);
+ return "";
+ }
+
+
}
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java 2006-11-22 08:20:33 UTC (rev 7757)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/WebCustomer.java 2006-11-22 08:24:07 UTC (rev 7758)
@@ -28,6 +28,10 @@
import java.io.Serializable;
+/*
+ * WebCustomer represents the data captured in the client JSP page
+ */
+
@SuppressWarnings("serial")
public class WebCustomer implements Serializable
{
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWS.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWS.java 2006-11-22 08:20:33 UTC (rev 7757)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWS.java 2006-11-22 08:24:07 UTC (rev 7758)
@@ -5,6 +5,27 @@
* by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
*/
+/*
+ * 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 at jboss.com
+ */
+
package org.jboss.soa.esb.samples.trailblazer.web.generated;
public interface LoanBrokerWS extends java.rmi.Remote {
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSBindingStub.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSBindingStub.java 2006-11-22 08:20:33 UTC (rev 7757)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSBindingStub.java 2006-11-22 08:24:07 UTC (rev 7758)
@@ -5,6 +5,28 @@
* by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
*/
+/*
+ * 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 at jboss.com
+ */
+
+
package org.jboss.soa.esb.samples.trailblazer.web.generated;
public class LoanBrokerWSBindingStub extends org.apache.axis.client.Stub implements org.jboss.soa.esb.samples.trailblazer.web.generated.LoanBrokerWS {
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSProxy.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSProxy.java 2006-11-22 08:20:33 UTC (rev 7757)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSProxy.java 2006-11-22 08:24:07 UTC (rev 7758)
@@ -1,3 +1,24 @@
+/*
+ * 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 at jboss.com
+ */
+
package org.jboss.soa.esb.samples.trailblazer.web.generated;
public class LoanBrokerWSProxy implements org.jboss.soa.esb.samples.trailblazer.web.generated.LoanBrokerWS {
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSService.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSService.java 2006-11-22 08:20:33 UTC (rev 7757)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSService.java 2006-11-22 08:24:07 UTC (rev 7758)
@@ -5,6 +5,28 @@
* by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
*/
+
+/*
+ * 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 at jboss.com
+ */
+
package org.jboss.soa.esb.samples.trailblazer.web.generated;
public interface LoanBrokerWSService extends javax.xml.rpc.Service {
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSServiceLocator.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSServiceLocator.java 2006-11-22 08:20:33 UTC (rev 7757)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/LoanBrokerWSServiceLocator.java 2006-11-22 08:24:07 UTC (rev 7758)
@@ -5,6 +5,28 @@
* by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
*/
+
+/*
+ * 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 at jboss.com
+ */
+
package org.jboss.soa.esb.samples.trailblazer.web.generated;
@SuppressWarnings("serial")
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/WebCustomer.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/WebCustomer.java 2006-11-22 08:20:33 UTC (rev 7757)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/generated/WebCustomer.java 2006-11-22 08:24:07 UTC (rev 7758)
@@ -5,6 +5,28 @@
* by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
*/
+
+/*
+ * 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 at jboss.com
+ */
+
package org.jboss.soa.esb.samples.trailblazer.web.generated;
@SuppressWarnings("serial")
More information about the jboss-svn-commits
mailing list