[jboss-svn-commits] JBL Code SVN: r7665 - labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Nov 16 16:04:37 EST 2006
Author: daniel.brum at jboss.com
Date: 2006-11-16 16:04:36 -0500 (Thu, 16 Nov 2006)
New Revision: 7665
Modified:
labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerWS.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-16 21:04:12 UTC (rev 7664)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/client/src/org/jboss/soa/esb/samples/trailblazer/web/LoanBrokerWS.java 2006-11-16 21:04:36 UTC (rev 7665)
@@ -22,7 +22,6 @@
*/
package org.jboss.soa.esb.samples.trailblazer.web;
-import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;
@@ -34,18 +33,15 @@
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.Environment;
+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.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.parameters.ParamRepository;
-import org.jboss.soa.esb.parameters.ParamRepositoryException;
-import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
import org.jboss.soa.esb.services.registry.Registry;
import org.jboss.soa.esb.services.registry.RegistryFactory;
-import org.xml.sax.SAXException;
/**
* The Loan broker web service, which will handle a loan request. First a credit
@@ -66,8 +62,9 @@
* 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");
logger.info("WebCustomer received: \n" + customer);
- System.setProperty("com.arjuna.common.util.propertyservice.verbosePropertyManager", "ON");
+ //System.setProperty("com.arjuna.common.util.propertyservice.verbosePropertyManager", "ON");
// if (config == null) {
// readConfigurationFile();
@@ -78,11 +75,12 @@
message.getBody().setContents(Base64.encodeObject(customer).getBytes());
//step 2 - locate the service in the registry
- Registry registry = RegistryFactory.getRegistry();
-// String serviceCategoryName = config.getAttribute(SERVICE_CAT);
-// String serviceName = config.getAttribute(SERVICE_NAME);
- String serviceCategoryName = "trailblazer";
- String serviceName = "LoanRequestService";
+ Registry registry = RegistryFactory.getRegistry();
+ //read in the values from the jbossesb-properties.xml if possible
+ String serviceCategoryName = ModulePropertyManager.getPropertyManager(MODULE_NAME).getProperty(SERVICE_CAT, "trailblazer");
+ String serviceName = ModulePropertyManager.getPropertyManager(MODULE_NAME).getProperty(SERVICE_NAME, "LoanRequestService");;
+// String serviceCategoryName = "trailblazer";
+// String serviceName = "LoanRequestService";
logger.debug("looking for the following service in the registry -- Category: " + serviceCategoryName);
logger.debug("looking for the following service in the registry -- Name: " + serviceName);
@@ -115,29 +113,10 @@
}
- private void readConfigurationFile()
- throws ParamRepositoryException, IOException, SAXException
- {
- //Reading the config file
- ParamRepository parmRepository = ParamRepositoryFactory.getInstance();
- logger.info("loading config file " + CONFIG_FILE);
- String sXml = parmRepository.get(CONFIG_FILE);
- logger.info("sXml = " + sXml);
- config = ConfigTree.fromXml(sXml);
- }
-
-// public static void main(String args[]) throws Exception {
-//
-// LoanBrokerWS ws = new LoanBrokerWS();
-// WebCustomer customer = new WebCustomer("John Doe", "123 My St.",
-// "JBoss", 50.00, 12, 100.00, 123456, "john at cashisking.com");
-// ws.RequestLoan(customer);
-// }
//class attributes
private static Logger logger = Logger.getLogger(LoanBrokerWS.class);
- ConfigTree config = null;
- private final String CONFIG_FILE = "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";
More information about the jboss-svn-commits
mailing list