[jboss-svn-commits] JBL Code SVN: r5239 - in labs/jbossesb/branches/refactor/ESBCore: listeners/src/org/jboss/soa/esb/listeners processors/src/org/jboss/soa/esb/processors
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Jul 21 19:43:56 EDT 2006
Author: arvinder
Date: 2006-07-21 19:43:49 -0400 (Fri, 21 Jul 2006)
New Revision: 5239
Removed:
labs/jbossesb/branches/refactor/ESBCore/processors/src/org/jboss/soa/esb/processors/EsbMsgProcessor.java
Modified:
labs/jbossesb/branches/refactor/ESBCore/listeners/src/org/jboss/soa/esb/listeners/JmsQueueListener.java
Log:
Remerge from trunk
Modified: labs/jbossesb/branches/refactor/ESBCore/listeners/src/org/jboss/soa/esb/listeners/JmsQueueListener.java
===================================================================
--- labs/jbossesb/branches/refactor/ESBCore/listeners/src/org/jboss/soa/esb/listeners/JmsQueueListener.java 2006-07-21 23:39:44 UTC (rev 5238)
+++ labs/jbossesb/branches/refactor/ESBCore/listeners/src/org/jboss/soa/esb/listeners/JmsQueueListener.java 2006-07-21 23:43:49 UTC (rev 5239)
@@ -336,7 +336,12 @@
m_oChParms.rmvChildsByName(EsbAbstractProcessor.PARMS_THIS_INSTANCE);
setMaxThreads(p_oP,1);
- obtainAtt(p_oP,LISTEN_QUEUE,null);
+ obtainAtt(p_oP,LISTEN_QUEUE,null);
+
+ String sClass = obtainAtt(p_oP,PARM_ACTION_CLASS,null);
+ if (EsbUtil.isNullString(sClass))
+ throw new Exception(formatLogMsg("Missing value for "+PARM_ACTION_CLASS));
+ m_oExecClass = Class.forName(sClass);
} //________________________________
protected final void obtainQueue(DomElement p_oP) throws JMSException, NamingException
@@ -375,8 +380,9 @@
{
while(System.currentTimeMillis() < m_lNextReload)
{
- if (m_iQthr >= m_iMaxThr)
+ if (m_iQthr > m_iMaxThr)
{ m_oLogger.info(m_sb.append("Waiting for available threads").toString());
+ m_sb.setLength(m_iSbIni);
Thread.sleep(5000);
continue;
}
@@ -386,7 +392,7 @@
Message oMsg = (null==oReader) ? null
: oReader.receiveNoWait();
if (null==oMsg)
- { Thread.sleep(500);
+ { Thread.sleep(1000);
continue;
}
@@ -414,6 +420,7 @@
throws Exception
{
m_oParent = p_oGrp;
+ m_oMsg = p_oMsg;
this.addObserver(m_oParent);
setChanged();
// add 1 to child thread count
@@ -429,7 +436,9 @@
.getConstructor (new Class[] {DomElement.class});
DomElement oParms = m_oParent.m_oChParms.cloneObj();
Object oInst = oCnst.newInstance (new Object[] {oParms});
- ((EsbMsgProcessor)oInst).processMessage(m_oMsg);
+ EsbMsgProcessor oMP = (EsbMsgProcessor)oInst;
+ oMP.processMessage(m_oMsg);
+
}
catch (Exception e)
{ m_oLogger.error("run() FAILED",e);
Deleted: labs/jbossesb/branches/refactor/ESBCore/processors/src/org/jboss/soa/esb/processors/EsbMsgProcessor.java
===================================================================
--- labs/jbossesb/branches/refactor/ESBCore/processors/src/org/jboss/soa/esb/processors/EsbMsgProcessor.java 2006-07-21 23:39:44 UTC (rev 5238)
+++ labs/jbossesb/branches/refactor/ESBCore/processors/src/org/jboss/soa/esb/processors/EsbMsgProcessor.java 2006-07-21 23:43:49 UTC (rev 5239)
@@ -1,78 +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.processors;
-
-import java.lang.reflect.Constructor;
-
-import javax.jms.Message;
-import javax.jms.TextMessage;
-
-import org.jboss.soa.esb.helpers.*;
-
-public class EsbMsgProcessor extends EsbAbstractProcessor
-{
- public EsbMsgProcessor(DomElement p_oP) throws Exception
- { super(p_oP,false);
- } //__________________________________
-
- protected void checkParms() throws Exception {}
- public void execute() throws Exception {}
-
- public void processMessage(Message p_oMsg) throws Exception
- {
- String sPrc = this.getClass().getName();
- sPrc = sPrc.substring(1+sPrc.lastIndexOf("."));
-
- StringBuffer sb = new StringBuffer("Message ");
- if (p_oMsg instanceof TextMessage)
- sb.append("<").append(((TextMessage)p_oMsg).getText()).append("> ");
- String sNotifMsg = sb.toString();
-
- sb.setLength(0);
- try
- {
- try
- { Class oCls = Class.forName(m_oParms.getAttr("actionClass"));
- Constructor oCns = oCls.getConstructor(new Class[] {Message.class,EsbAbstractProcessor.class});
- oCns.newInstance(new Object[] {p_oMsg,this});
-
- super.postProcess();
-
- sb.append(sPrc).append(" processed ").append(sNotifMsg).append(" successfully");
- super.notifyOK(sb.toString());
- }
- catch (Exception e)
- { m_oLogger.fatal("Message processor FAILED",e);
- throw e;
- }
- finally { super.release(); }
- }
-
- catch (Exception eGen)
- {
- System.out.println("test catch for rollback here..");
- super.notifyError(eGen," " + sPrc+" PROBLEMS processing "+sNotifMsg);
- throw eGen;
- }
- }//_________________________
-
-} //____________________________________________________________________________
More information about the jboss-svn-commits
mailing list