[jboss-svn-commits] JBL Code SVN: r7759 - labs/jbossesb/trunk/product/samples/trailblazer2/esb/src/org/jboss/soa/esb/samples/trailblazer/actions
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 22 03:48:53 EST 2006
Author: daniel.brum at jboss.com
Date: 2006-11-22 03:48:49 -0500 (Wed, 22 Nov 2006)
New Revision: 7759
Added:
labs/jbossesb/trunk/product/samples/trailblazer2/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
Modified:
labs/jbossesb/trunk/product/samples/trailblazer2/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/TrailblazerAction.java
Log:
Added: labs/jbossesb/trunk/product/samples/trailblazer2/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java 2006-11-22 08:24:07 UTC (rev 7758)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/CreditAgencyActions.java 2006-11-22 08:48:49 UTC (rev 7759)
@@ -0,0 +1,72 @@
+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 at jboss.com
+ */
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+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.util.Util;
+
+public class CreditAgencyActions {
+ protected Message _message;
+ 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{
+
+ _message = message;
+ ActionUtils.getTaskObject(message);
+
+
+ _logger.debug("message received in processCreditRequest with message: " + message.getBody().getContents());
+
+ //TODO: do smooks transformation on the CSV received
+ //TODO: set the credit score
+ //TODO: return a score
+
+
+ return message;
+ }
+
+ public Message debugMessage(Message message) throws Exception{
+
+ _message = message;
+ System.out.println("CreditAgencyActions.debugMessage(): in the action chain message: " + Util.serialize(message));
+// ActionUtils.getTaskObject(message);
+// System.out.println("CreditAgencyActions.debugMessage(): in the action chain message: " + Util.serialize(message));
+
+ JMSEpr replyTo = new JMSEpr(message.getHeader().getCall().getReplyTo());
+ CourierFactory.getCourier(replyTo).deliver(message);
+
+
+ return message;
+ }
+
+}
Modified: labs/jbossesb/trunk/product/samples/trailblazer2/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/TrailblazerAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/TrailblazerAction.java 2006-11-22 08:24:07 UTC (rev 7758)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/esb/src/org/jboss/soa/esb/samples/trailblazer/actions/TrailblazerAction.java 2006-11-22 08:48:49 UTC (rev 7759)
@@ -1,6 +1,7 @@
package org.jboss.soa.esb.samples.trailblazer.actions;
import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.ActionUtils;
import org.jboss.soa.esb.actions.templates.MockMessageAction;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
@@ -24,10 +25,23 @@
_message = message;
_logger.info(Util.getStamp()+" process was called with <<" + getMessagePayload() + ">>");
+ //
+
return message;
}
+ public Message processCreditCheck(Message message) throws Exception {
+ _message = message;
+ _logger.info("processing the credit check step");
+ String csv;
+
+
+
+
+ return message;
+ }
+
public Message persistMessage(Message message) throws Exception {
MessageStore store = MessageStoreFactory.getInstance().getMessageStore(MessageStoreType.DATABASE);
@@ -40,17 +54,14 @@
_logger.info("*** NOTIFICATON *** Persist OK on Message: " + new String(msg.getBody().getContents()));
}
- public void persistFail(Message msg, Throwable thrown) throws Exception {
- _logger.error("*** NOTIFICATON *** Persist FAIL on Message with exception: " + thrown.toString());
- }
-
- public Message failAlways(Message msg) throws Exception {
- throw new Exception ("The hand Of God WAS A GOAL! \n");
- }
-
Object getMessagePayload()
{
return new String(_message.getBody().getContents());
}
+
+ private String getCSVFromMessage() {
+
+ return "";
+ }
}
More information about the jboss-svn-commits
mailing list