[jboss-svn-commits] JBL Code SVN: r6966 - in labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb: actions/templates listeners/message
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Oct 20 12:45:35 EDT 2006
Author: estebanschifman
Date: 2006-10-20 12:45:31 -0400 (Fri, 20 Oct 2006)
New Revision: 6966
Added:
labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockMessageAction.java
Removed:
labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/MockAction.java
Modified:
labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/easier2ReadExample.xml
labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/example.xml
Log:
rename/repackage listeners.message.MockAction to actions.templates.MockMessageAction
Added: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockMessageAction.java
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockMessageAction.java 2006-10-20 16:38:54 UTC (rev 6965)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockMessageAction.java 2006-10-20 16:45:31 UTC (rev 6966)
@@ -0,0 +1,137 @@
+/*
+ * 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.templates;
+
+import java.text.*;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.helpers.*;
+import org.jboss.soa.esb.notification.*;
+
+
+/**
+ * Use this class to tune your XML configurations <p/>Once your config works
+ * with this dummy class, you can switch to your own action class <p/>You will
+ * have to implement these three methods in your own action class
+ *
+ * @author Esteban
+ *
+ */
+public class MockMessageAction
+{
+ protected Message _message;
+ protected ConfigTree _config;
+
+ public MockMessageAction(ConfigTree config) { _config = config; }
+ public Message noOperation(Message message) { return message; }
+
+ public Message process(Message message)
+ {
+ _message = message;
+ Object oCurr = ActionUtils.getTaskObject(message);
+ if (null==oCurr)
+ oCurr = "null";
+ _logger.info(getStamp()+" process was called with <<" + oCurr.toString() + ">>");
+ return message;
+ } // ________________________________
+
+
+ public Message process222(Message message)
+ {
+ _message = message;
+ Object oCurr = ActionUtils.getTaskObject(message);
+ if (null==oCurr)
+ oCurr = "null";
+ _logger.info(getStamp()+" process222 was called with <<" + oCurr.toString() + ">>");
+ return message;
+ } // ________________________________
+
+ private static final SimpleDateFormat s_oTS
+ = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss.SSS");
+
+ private String getStamp()
+ { return s_oTS.format(new java.util.Date(System.currentTimeMillis())); }
+
+ private static Logger _logger = Logger.getLogger(MockMessageAction.class);
+
+ public void myOkMethod1()
+ {
+ String sMsg = new StringBuilder(getStamp())
+ .append(" MockAction.myOkMethod1 was called ")
+ .append(_message)
+ .toString();
+ _logger.info(sMsg);
+ @SuppressWarnings("unused")
+ NotificationList nl = ActionUtils.getNotifyList(_config,"ok");
+ // Here you can send notifications to everybody
+ }
+
+ public void myMethod2()
+ {
+ String sMsg = new StringBuilder(getStamp())
+ .append(" Method2 Method2 Method2 Method2 Method2 CALLED ")
+ .append(_message)
+ .toString();
+ _logger.info(sMsg);
+ @SuppressWarnings("unused")
+ NotificationList nl = ActionUtils.getNotifyList(_config,"ok");
+ // Here you can send notifications to everybody
+ }
+
+ public void endOfChainNotification()
+ {
+ String sMsg = new StringBuilder(getStamp())
+ .append(" End of action chain reached - Bye bye")
+ .toString();
+ _logger.info(sMsg);
+ @SuppressWarnings("unused")
+ NotificationList nl = ActionUtils.getNotifyList(_config,"ok");
+ // Here you can send notifications to everybody
+ }
+
+ public Message justThrow(Message message) throws Exception
+ {
+ throw new MockException("Mock exception thrown at "+getStamp());
+ } // ________________________________
+
+ @SuppressWarnings("serial")
+ private class MockException extends Exception
+ {
+ MockException(String str) { super(str); }
+ }
+
+ public void exceptionCallback1(Exception e)
+ {
+ String sMsg = new StringBuilder(getStamp())
+ .append(" MockExceptionTrower.exceptionCallback1 CALLED ")
+ .append(_message)
+ .toString();
+ _logger.fatal(sMsg,e);
+ @SuppressWarnings("unused")
+ NotificationList nl = ActionUtils.getNotifyList(_config,"err");
+ // Here you can send notifications to everybody
+ }
+
+} // ____________________________________________________________________________
Deleted: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/MockAction.java
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/MockAction.java 2006-10-20 16:38:54 UTC (rev 6965)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/MockAction.java 2006-10-20 16:45:31 UTC (rev 6966)
@@ -1,137 +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.listeners.message;
-
-import java.text.*;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.helpers.*;
-import org.jboss.soa.esb.notification.*;
-
-
-/**
- * Use this class to tune your XML configurations <p/>Once your config works
- * with this dummy class, you can switch to your own action class <p/>You will
- * have to implement these three methods in your own action class
- *
- * @author Esteban
- *
- */
-public class MockAction
-{
- protected Message _message;
- protected ConfigTree _config;
-
- public MockAction(ConfigTree config) { _config = config; }
- public Message noOperation(Message message) { return message; }
-
- public Message process(Message message)
- {
- _message = message;
- Object oCurr = ActionUtils.getTaskObject(message);
- if (null==oCurr)
- oCurr = "null";
- _logger.info(getStamp()+" process was called with <<" + oCurr.toString() + ">>");
- return message;
- } // ________________________________
-
-
- public Message process222(Message message)
- {
- _message = message;
- Object oCurr = ActionUtils.getTaskObject(message);
- if (null==oCurr)
- oCurr = "null";
- _logger.info(getStamp()+" process222 was called with <<" + oCurr.toString() + ">>");
- return message;
- } // ________________________________
-
- private static final SimpleDateFormat s_oTS
- = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss.SSS");
-
- private String getStamp()
- { return s_oTS.format(new java.util.Date(System.currentTimeMillis())); }
-
- private static Logger _logger = Logger.getLogger(MockAction.class);
-
- public void myOkMethod1()
- {
- String sMsg = new StringBuilder(getStamp())
- .append(" MockAction.myOkMethod1 was called ")
- .append(_message)
- .toString();
- _logger.info(sMsg);
- @SuppressWarnings("unused")
- NotificationList nl = ActionUtils.getNotifyList(_config,"ok");
- // Here you can send notifications to everybody
- }
-
- public void myMethod2()
- {
- String sMsg = new StringBuilder(getStamp())
- .append(" Method2 Method2 Method2 Method2 Method2 CALLED ")
- .append(_message)
- .toString();
- _logger.info(sMsg);
- @SuppressWarnings("unused")
- NotificationList nl = ActionUtils.getNotifyList(_config,"ok");
- // Here you can send notifications to everybody
- }
-
- public void endOfChainNotification()
- {
- String sMsg = new StringBuilder(getStamp())
- .append(" End of action chain reached - Bye bye")
- .toString();
- _logger.info(sMsg);
- @SuppressWarnings("unused")
- NotificationList nl = ActionUtils.getNotifyList(_config,"ok");
- // Here you can send notifications to everybody
- }
-
- public Message justThrow(Message message) throws Exception
- {
- throw new MockException("Mock exception thrown at "+getStamp());
- } // ________________________________
-
- @SuppressWarnings("serial")
- private class MockException extends Exception
- {
- MockException(String str) { super(str); }
- }
-
- public void exceptionCallback1(Exception e)
- {
- String sMsg = new StringBuilder(getStamp())
- .append(" MockExceptionTrower.exceptionCallback1 CALLED ")
- .append(_message)
- .toString();
- _logger.fatal(sMsg,e);
- @SuppressWarnings("unused")
- NotificationList nl = ActionUtils.getNotifyList(_config,"err");
- // Here you can send notifications to everybody
- }
-
-} // ____________________________________________________________________________
Modified: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/easier2ReadExample.xml
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/easier2ReadExample.xml 2006-10-20 16:38:54 UTC (rev 6965)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/easier2ReadExample.xml 2006-10-20 16:45:31 UTC (rev 6966)
@@ -11,9 +11,9 @@
jndi-URL="localhost"
message-selector="service='handOfGod'"
>
- <action class="org.jboss.soa.esb.message.listeners.MockAction" />
- <action class="org.jboss.soa.esb.message.listeners.MockAction" process="process222" />
- <action class="org.jboss.soa.esb.message.listeners.MockAction"
+ <action class="org.jboss.soa.esb.actions.templates.MockMessageAction" />
+ <action class="org.jboss.soa.esb.actions.templates.MockMessageAction" process="process222" />
+ <action class="org.jboss.soa.esb.actions.templates.MockMessageAction"
process="noOperation" okMethod="endOfChainNotification"/>
<NotificationList type="OK">
Modified: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/example.xml
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/example.xml 2006-10-20 16:38:54 UTC (rev 6965)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/example.xml 2006-10-20 16:45:31 UTC (rev 6966)
@@ -12,17 +12,17 @@
message-selector="service='maradona'"
>
<!-- next line will call (default) process(Message) method with no notification for step -->
- <action class="org.jboss.soa.esb.message.listeners.MockAction" />
+ <action class="org.jboss.soa.esb.actions.templates.MockMessageAction" />
<!-- next line will call process222(Message) method with no notification for step -->
- <action class="org.jboss.soa.esb.message.listeners.MockAction" process="process222" />
+ <action class="org.jboss.soa.esb.actions.templates.MockMessageAction" process="process222" />
<!-- next line will call (default) process(Message) - on success=>invoke myOkMethod1 -->
- <action class="org.jboss.soa.esb.message.listeners.MockAction" okMethod="myOkMethod1" />
- <action class="org.jboss.soa.esb.message.listeners.MockAction" process="process222"
+ <action class="org.jboss.soa.esb.actions.templates.MockMessageAction" okMethod="myOkMethod1" />
+ <action class="org.jboss.soa.esb.actions.templates.MockMessageAction" process="process222"
okMethod="myMethod2" />
<!-- next line would be useful to notify end of action chain process=noOperation (see class)-->
- <action class="org.jboss.soa.esb.message.listeners.MockAction" process="noOperation" />
+ <action class="org.jboss.soa.esb.actions.templates.MockMessageAction" process="noOperation" />
<!-- example of a method that will always throw an Exception -->
- <action class="org.jboss.soa.esb.message.listeners.MockAction" process="justThrow" exceptionMethod="exceptionCallback1"/>
+ <action class="org.jboss.soa.esb.actions.templates.MockMessageAction" process="justThrow" exceptionMethod="exceptionCallback1"/>
<NotificationList type="OK">
<target class="NotifyFiles">
More information about the jboss-svn-commits
mailing list