[jboss-svn-commits] JBL Code SVN: r13352 - in labs/jbossesb/trunk/product: rosetta/src/org/jboss/soa/esb/listeners/message and 5 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jul 11 05:53:24 EDT 2007


Author: tfennelly
Date: 2007-07-11 05:53:23 -0400 (Wed, 11 Jul 2007)
New Revision: 13352

Modified:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java
   labs/jbossesb/trunk/product/samples/quickstarts/webservice_war1/src/org/jboss/soa/esb/samples/quickstart/webservicewar1/MyAction.java
   labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
   labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
   labs/jbossesb/trunk/product/samples/trailblazer/trailblazer.properties
Log:
More JBESB-575

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java	2007-07-11 07:45:26 UTC (rev 13351)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java	2007-07-11 09:53:23 UTC (rev 13352)
@@ -116,7 +116,7 @@
     }
 
     /**
-     * Synchronously deliver the supplied message to the target service associated with this adapter instance.
+     * Synchronously deliver the supplied message to the target service associated with this invoker instance.
      *
      * @param message       The message to be delivered.
      * @param timeoutMillis Number of milliseconds before synchronous reply pickup should timeout.
@@ -130,7 +130,7 @@
     }
 
     /**
-     * Asynchronously deliver the supplied message to the target service associated with this adapter instance.
+     * Asynchronously deliver the supplied message to the target service associated with this invoker instance.
      *
      * @param message The message to be delivered.
      * @throws MessageDeliverException Failed to deliver message, after trying all available EPRs.
@@ -141,7 +141,7 @@
     }
 
     /**
-     * Deliver the supplied message to the target service associated with this adapter instance.
+     * Deliver the supplied message to the target service associated with this invoker instance.
      *
      * @param message     The message to be delivered.
      * @param synchronous Is the message to be delivered synchronously or not (asynchronously).

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java	2007-07-11 07:45:26 UTC (rev 13351)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java	2007-07-11 09:53:23 UTC (rev 13352)
@@ -50,7 +50,7 @@
  * Utility class to hide implementation details for sending Command messages and optionally awaiting for a response. 
  * 
  * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a> 
- *
+ * @deprecated Use {@link org.jboss.soa.esb.listeners.ServiceInvoker}.
  */
 
 public class Invoker {

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java	2007-07-11 07:45:26 UTC (rev 13351)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java	2007-07-11 09:53:23 UTC (rev 13352)
@@ -21,171 +21,97 @@
  */
 package org.jboss.soa.esb.services.routing;
 
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.Registry;
 import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
+import org.jboss.soa.esb.listeners.ServiceInvoker;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 
 /**
  * Generic Message Router Interface.
- * 
+ *
  * @author kurt.stam at redhat.com
- * 
  */
-public abstract class MessageRouter
-{
-	private static Logger logger = Logger.getLogger(MessageRouter.class);
-	public final static String AGGEGRATOR_TAG = "aggregatorTag";
+public abstract class MessageRouter {
+    private static Logger logger = Logger.getLogger(MessageRouter.class);
+    public final static String AGGEGRATOR_TAG = "aggregatorTag";
     public final static String SPLITTER_TIME_STAMP = "splitterTimeStamp";
     public static final String INTERNAL_SERVICE_CATEGORY = "JBossESB-Internal";
     public static final String DEAD_LETTER_SERVICE_NAME = "DeadLetterService";
-	
-	/**
-	 * Routes the message to the next destination.
-	 * 
-	 * @param message
-	 * @return List of Strings containing the services to which the message was
-	 *         routed.
-	 */
-	public abstract List<String> route(Message message)
-    throws MessageRouterException;
 
     /**
+     * Routes the message to the next destination.
+     *
+     * @param message
+     * @return List of Strings containing the services to which the message was
+     *         routed.
+     */
+    public abstract List<String> route(Message message)
+            throws MessageRouterException;
+
+    /**
      * Sends the message on to the service with the name(s) we just obtained
      * from the routing.
-     * 
+     *
      * @param serviceCategory -
-     *            the service category
-     * @param serviceName -
-     *            the service name
-     * @param message -
-     *            the message that needs routing and delivery
+     *                        the service category
+     * @param serviceName     -
+     *                        the service name
+     * @param message         -
+     *                        the message that needs routing and delivery
      */
     @SuppressWarnings("unchecked")
-    public synchronized static void deliverMessage(
-            String serviceCategory, String serviceName, Message message) throws MessageRouterException
-    {
-        boolean isSent = false;
-        Exception lastException = null;
-        try
-        {
-            Registry registry = RegistryFactory.getRegistry();
-            logger.log(Level.DEBUG, "Looking for EPRs for category="
-                    + serviceCategory + " and serviceName=" + serviceName);
-            Collection<EPR> eprs = registry.findEPRs(serviceCategory, serviceName);
-            for (Iterator<EPR> eprIter = eprs.iterator(); eprIter.hasNext();)
-            {
-                EPR epr = eprs.iterator().next();
-                logger.log(Level.DEBUG, "Message=" + message
-                        + " -> Destination=" + serviceCategory + "-" + serviceName);
-                try
-                {
-                    //TODO I think the following if block should be part of
-                    //the FileEpr construction?
-                    if (epr instanceof FileEpr) {
-                        try {
-                            FileEpr fileEpr = (FileEpr) epr;
-                            FileEpr newEpr = new FileEpr(fileEpr.getURL());
-                            newEpr.setPostDelete(false);
-                            newEpr.setPostDirectory(fileEpr.getURL().getFile());
-                            newEpr.setPostSuffix(fileEpr.getInputSuffix());
-                            epr = newEpr;
-                        } catch (URISyntaxException usex) {
-                            logger.log(Level.ERROR, "Malformed epr while setting :"
-                                    + epr, usex);
-                        } catch (MalformedURLException muex) {
-                            logger.log(Level.ERROR, "Malformed epr:"
-                                    + epr, muex);
-                        }
-                    }
-                    // Give the message to the courier
-                    Courier courier = CourierFactory.getCourier(epr);
-                                            try
-                                            {
-                                                courier.deliver(message);
-                                            }
-                                            finally
-                                            {
-                                                CourierUtil.cleanCourier(courier) ;
-                                            }
-                    isSent = true;
-                    break;
-                } catch (MalformedEPRException ex) {
-                    logger.log(Level.ERROR, "Malformed epr:" + epr);
-                    lastException = ex;
-                } catch (CourierException ce) {
-                    logger.log(Level.ERROR, "Could not send using epr:"
-                            + epr, ce);
-                     lastException = ce;
-                    // if there are more eprs in the collection is will try
-                    // the next one.
-                }
-            }
-            if (isSent == false)
-            {
-                logger.log(Level.ERROR, "Could not find any valid EPRs. Message is not routed.", lastException);
-                throw new MessageRouterException("Message Could not be delivered. ", lastException);
-            }
-        } catch (RegistryException re) {
-            logger.log(Level.ERROR, "Could not obtain an EPR from the Registry. Message is not routed. "
-                            + re.getLocalizedMessage(), re);
-            throw new MessageRouterException("Message Could not be delivered due to issues with the Registry. "
-                    + re.getMessage(), re);
+    public synchronized static void deliverMessage(String serviceCategory, String serviceName, Message message) throws MessageRouterException {
+        try {
+            ServiceInvoker serviceInvoker = new ServiceInvoker(serviceCategory, serviceName);
+            serviceInvoker.deliverAsync(message);
+        } catch (RegistryException e) {
+            throw new MessageRouterException(e);
+        } catch (MessageDeliverException e) {
+            throw new MessageRouterException(e);
         }
     }
-	/**
-	 * Sends the message on to the service with the name(s) we just obtained
-	 * from the routing.
-	 * 
-	 * @param destinations -
-	 *            Collection with the name of the destination services.
-	 * @param message -
-	 *            the message that needs routing and delivery
-	 */
+
+    /**
+     * Sends the message on to the service with the name(s) we just obtained
+     * from the routing.
+     *
+     * @param destinations -
+     *                     Collection with the name of the destination services.
+     * @param message      -
+     *                     the message that needs routing and delivery
+     */
     @SuppressWarnings("unchecked")
     public synchronized static void deliverMessages(
-			Collection<String[]> destinations, Message message) throws MessageRouterException
-	{
+            Collection<String[]> destinations, Message message) throws MessageRouterException {
         String uuId = UUID.randomUUID().toString();
-        int counter=0;
-      
-       
-		for (Iterator<String[]> i = destinations.iterator(); i.hasNext();)
-		{
+        int counter = 0;
+
+
+        for (Iterator<String[]> i = destinations.iterator(); i.hasNext();) {
             //Only put tags on when routing to more then 1 destination
-            if (destinations.size()>1) {
+            if (destinations.size() > 1) {
                 ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(AGGEGRATOR_TAG);
-                if (aggregatorTags==null) {
+                if (aggregatorTags == null) {
                     aggregatorTags = new ArrayList<String>();
                 }
                 String tag = uuId + ":" + ++counter + ":" + destinations.size() + ":" + new java.util.Date().getTime();
                 aggregatorTags.add(tag);
                 message.getProperties().setProperty(AGGEGRATOR_TAG, aggregatorTags);
                 if (logger.isDebugEnabled()) {
-                    logger.debug(AGGEGRATOR_TAG+ "=" + tag);
+                    logger.debug(AGGEGRATOR_TAG + "=" + tag);
                 }
             }
             String[] destination = (String[]) i.next();
             deliverMessage(destination[0], destination[1], message);
-            
-		}
+
+        }
 	}
 
 }

Modified: labs/jbossesb/trunk/product/samples/quickstarts/webservice_war1/src/org/jboss/soa/esb/samples/quickstart/webservicewar1/MyAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/webservice_war1/src/org/jboss/soa/esb/samples/quickstart/webservicewar1/MyAction.java	2007-07-11 07:45:26 UTC (rev 13351)
+++ labs/jbossesb/trunk/product/samples/quickstarts/webservice_war1/src/org/jboss/soa/esb/samples/quickstart/webservicewar1/MyAction.java	2007-07-11 09:53:23 UTC (rev 13352)
@@ -23,13 +23,7 @@
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.message.Body;
 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.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
 
 public class MyAction extends AbstractActionLifecycle {
 

Modified: labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java	2007-07-11 07:45:26 UTC (rev 13351)
+++ labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java	2007-07-11 09:53:23 UTC (rev 13352)
@@ -25,19 +25,12 @@
 import java.util.Properties;
 
 import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.couriers.TwoWayCourier;
 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.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
+import org.jboss.soa.esb.listeners.ServiceInvoker;
 
 /*
  * LoanBroker is responsible for getting customer requests for loans onto the JBoss ESB
@@ -50,155 +43,114 @@
  */
 
 public class LoanBroker {
-	
-	private static Logger logger = Logger.getLogger(LoanBroker.class);
-	//used to locate our entries in the trailblazer-properties
-	private final String SERVICE_NAME = "request.service.epr.name";
-	private final String SERVICE_CAT  = "request.service.category";
-	private final String JMS_BANK_QUEUE="jmsbank.queue";
+
+    private static Logger logger = Logger.getLogger(LoanBroker.class);
+    //used to locate our entries in the trailblazer-properties
+    private final String SERVICE_NAME = "request.service.epr.name";
+    private final String SERVICE_CAT = "request.service.category";
+    private final String JMS_BANK_QUEUE = "jmsbank.queue";
     private Properties properties = new TrailblazerProperties();
-	
-	public LoanBroker() {
-//		System.setProperty("org.jboss.soa.esb.propertyFile", "jbossesb-properties.xml");
-//		System.setProperty("juddi.propertiesFile", "juddi.properties");
-		
-	}
-	
-	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
+    private ServiceInvoker serviceInvoker; 
 
-		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 - send to JMS Bank - async
-		System.out.println("sending to JMS Bank...");
-		sendToJMSBank(customer);		
-		
-	}
-	
-	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;
-	}
-	
-	
-	//uses plain JMS to send a text message
-	private void sendToJMSBank(Customer customer) {
-		try {
-			//create a Quote Request that the bank expects
-			QuoteRequest quote = new QuoteRequest();
-			quote.ssn=customer.ssn;
-			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;
-			
-			SendJMSMessage sender = new SendJMSMessage();
-			String queue = properties.getProperty(JMS_BANK_QUEUE);
-			sender.setupConnection(queue);
-			logger.debug("setting up jms connection to queue: " + queue);
-			logger.debug("sending text message to bank: " + quote.toString());
-			sender.sendAMessage(quote.getCSV());
-			sender.stop();
-		}catch (Exception e) {
-			logger.error(e);
-		}
-	}
-	
-	private int sendToCreditAgency(Customer customer) {
-		Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-		Message replyMessage=null;
-		int score =0;				
-		
-		//set the customer inside the message - csv format for now to test
-		message.getBody().setByteArray(customer.getCSV().getBytes());	
-		
-		try {
-			logger.debug("sending to credit agency");
-			//registry setup stuff
-			Registry registry = RegistryFactory.getRegistry();
-			String serviceCategoryName = properties.getProperty(SERVICE_CAT);
-			String serviceName = properties.getProperty(SERVICE_NAME);			
-			logger.debug("looking for the following service in the registry -- Category: " + serviceCategoryName);
-			logger.debug("looking for the following service in the registry -- Name: " + serviceName);
-			
-			//EPRs to use for delivery and reply messages
-			JMSEpr toEPR=null, replyEPR=null;
-			
-			//find the service in the registry
-			toEPR = (JMSEpr)registry.findEPR(serviceCategoryName, serviceName);
+    public LoanBroker() {
+        String serviceCategoryName = properties.getProperty(SERVICE_CAT, "tbCreditAGency");
+        String serviceName = properties.getProperty(SERVICE_NAME, "creditagency");
 
-			//use a 2-way courier so we can grab the response
-			TwoWayCourier courier = CourierFactory.getCourier(toEPR, null);			
-			
-                        try
-                        {
-        			//needs to have this in order to get the reply
-        			if (message.getHeader().getCall()==null) {
-        				Call call = new Call();
-        				message.getHeader().setCall(call);
-        			}			
-        			
-        			if (null == courier) {
-        				logger.info("could not get a valid courier to deliver the message");
-        				throw new ActionProcessingException("could not find a courier to deliver the message for the serrvice " +
-        						"(category-name: " + serviceCategoryName +"-" + serviceCategoryName); }			
-        			
-        			replyEPR = (JMSEpr)CourierUtil.getDefaultReplyToEpr(toEPR);
-        			message.getHeader().getCall().setReplyTo(replyEPR);
-        			
-        			//send the message and get the response
-        			if (courier.deliver(message)) {				
-        				courier.setReplyToEpr(replyEPR);
-        				replyMessage = courier.pickup(5000);	//wait for 5 seconds then give up
-        				if (replyMessage !=null) {
-        					logger.info("received reply from creditAgency action");
-        					logger.info("message received: " + replyMessage.getBody().getByteArray());
-        					String xx = new String(replyMessage.getBody().getByteArray());
-        					System.out.println("Loanbroker credit score received of: " + xx);
-        					score = Integer.parseInt(xx.trim());					
-        				}else {
-        					logger.debug("reply not received from credit agency - setting a value of 5");
-        					score = 5; 
-        				}
-        			} else
-        				throw new ActionProcessingException("error delivering the message to the credit agency");
-                        }
-                        finally
-                        {
-                            CourierUtil.cleanCourier(courier) ;
-                        }
-			
-		}catch (Exception ex2) {
-			logger.error("exception occured: " + ex2);
-			ex2.printStackTrace();
-		}
-		
-		return score;
-	}
-	
-	
+        try {
+            serviceInvoker = new ServiceInvoker(serviceCategoryName, serviceName);
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create ServiceInvoker for '" + serviceCategoryName + ":" + serviceName + "'.", 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
+
+        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 - send to JMS Bank - async
+        System.out.println("sending to JMS Bank...");
+        sendToJMSBank(customer);
+
+    }
+
+    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;
+    }
+
+
+    //uses plain JMS to send a text message
+    private void sendToJMSBank(Customer customer) {
+        try {
+            //create a Quote Request that the bank expects
+            QuoteRequest quote = new QuoteRequest();
+            quote.ssn = customer.ssn;
+            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;
+
+            SendJMSMessage sender = new SendJMSMessage();
+            String queue = properties.getProperty(JMS_BANK_QUEUE);
+            sender.setupConnection(queue);
+            logger.debug("setting up jms connection to queue: " + queue);
+            logger.debug("sending text message to bank: " + quote.toString());
+            sender.sendAMessage(quote.getCSV());
+            sender.stop();
+        } 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 inside the message - csv format for now to test
+            message.getBody().setByteArray(customer.getCSV().getBytes());
+            replyMessage = serviceInvoker.deliverSync(message, 5000);
+            if (replyMessage != null) {
+                logger.info("received reply from creditAgency action: " + replyMessage.getBody().getByteArray());
+                String xx = new String(replyMessage.getBody().getByteArray());
+                score = Integer.parseInt(xx.trim());
+            } 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;
+    }
+
+
 }

Modified: labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java	2007-07-11 07:45:26 UTC (rev 13351)
+++ labs/jbossesb/trunk/product/samples/trailblazer/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java	2007-07-11 09:53:23 UTC (rev 13352)
@@ -25,10 +25,6 @@
 
 import org.apache.log4j.Logger;
 import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.format.MessageFactory;

Modified: labs/jbossesb/trunk/product/samples/trailblazer/trailblazer.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer/trailblazer.properties	2007-07-11 07:45:26 UTC (rev 13351)
+++ labs/jbossesb/trunk/product/samples/trailblazer/trailblazer.properties	2007-07-11 09:53:23 UTC (rev 13352)
@@ -1,7 +1,7 @@
 
 # Credit Agency configs
+request.service.category=tbCreditAGency
 request.service.epr.name=creditagency
-request.service.category=tbCreditAGency
 
 # JMS Bank configs
 jmsbank.queue=queue/esb-tb-bankRequestQueue




More information about the jboss-svn-commits mailing list