ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gatf...@apache.org
Subject svn commit: r596652 - in /webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2: ./ client/ handlers/ msgprocessors/ storage/inmemory/ util/ workers/ wsrm/
Date Tue, 20 Nov 2007 13:17:03 GMT
Author: gatfora
Date: Tue Nov 20 05:17:01 2007
New Revision: 596652

URL: http://svn.apache.org/viewvc?rev=596652&view=rev
Log:
Removed several unused imports/fields.  Updated InvokerWorker to support rollbacks

Modified:
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/MessageValidator.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/client/SandeshaClientConstants.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/handlers/SequenceIDDispatcher.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/AcknowledgementManager.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/MsgInitializer.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/RangeString.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/Invoker.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/InvokerWorker.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Identifier.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MessagePending.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/RMElements.java

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/MessageValidator.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/MessageValidator.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/MessageValidator.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/MessageValidator.java
Tue Nov 20 05:17:01 2007
@@ -19,10 +19,6 @@
 
 package org.apache.sandesha2;
 
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.WSDL2Constants;
-import org.apache.sandesha2.client.SandeshaClientConstants;
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
 import org.apache.sandesha2.i18n.SandeshaMessageKeys;
 import org.apache.sandesha2.policy.SandeshaPolicyBean;

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
Tue Nov 20 05:17:01 2007
@@ -29,7 +29,6 @@
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.description.AxisDescription;
 import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisOperation;

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/client/SandeshaClientConstants.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/client/SandeshaClientConstants.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/client/SandeshaClientConstants.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/client/SandeshaClientConstants.java
Tue Nov 20 05:17:01 2007
@@ -23,18 +23,18 @@
  * Constants that are needed for the Sandesha2 Client API.
  */
 public class SandeshaClientConstants {
-	public static String AcksTo = "Sandesha2AcksTo";
-	public static String LAST_MESSAGE = "Sandesha2LastMessage";
-	public static String OFFERED_SEQUENCE_ID = "Sandesha2OfferedSequenceId";
-	public static String INTERNAL_SEQUENCE_ID = "Sandesha2InternalSequenceId";
-	public static String SANDESHA_DEBUG_MODE = "Sandesha2DebugMode";
-	public static String SEQUENCE_KEY = "Sandesha2SequenceKey";
-	public static String MESSAGE_NUMBER = "Sandesha2MessageNumber";
-	public static String RM_SPEC_VERSION = "Sandesha2RMSpecVersion";
-	public static String DUMMY_MESSAGE = "Sandesha2DummyMessage"; //If this property is set,
even though this message will invoke the RM handlers, this will not be sent as an actual application
message
-	public static String UNRELIABLE_MESSAGE = "Sandesha2UnreliableMessage";
-	public static String SANDESHA_LISTENER = "Sandesha2Listener";
-	public static String USE_REPLY_TO_AS_ACKS_TO = "UseReplyToAsAcksTo";
-	public static String OFFERED_ENDPOINT = "OfferedEndpoint";
-	public static String AVOID_AUTO_TERMINATION = "AviodAutoTermination";
+	public static final String AcksTo = "Sandesha2AcksTo";
+	public static final String LAST_MESSAGE = "Sandesha2LastMessage";
+	public static final String OFFERED_SEQUENCE_ID = "Sandesha2OfferedSequenceId";
+	public static final String INTERNAL_SEQUENCE_ID = "Sandesha2InternalSequenceId";
+	public static final String SANDESHA_DEBUG_MODE = "Sandesha2DebugMode";
+	public static final String SEQUENCE_KEY = "Sandesha2SequenceKey";
+	public static final String MESSAGE_NUMBER = "Sandesha2MessageNumber";
+	public static final String RM_SPEC_VERSION = "Sandesha2RMSpecVersion";
+	public static final String DUMMY_MESSAGE = "Sandesha2DummyMessage"; //If this property is
set, even though this message will invoke the RM handlers, this will not be sent as an actual
application message
+	public static final String UNRELIABLE_MESSAGE = "Sandesha2UnreliableMessage";
+	public static final String SANDESHA_LISTENER = "Sandesha2Listener";
+	public static final String USE_REPLY_TO_AS_ACKS_TO = "UseReplyToAsAcksTo";
+	public static final String OFFERED_ENDPOINT = "OfferedEndpoint";
+	public static final String AVOID_AUTO_TERMINATION = "AviodAutoTermination";
 }

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/handlers/SequenceIDDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/handlers/SequenceIDDispatcher.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/handlers/SequenceIDDispatcher.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/handlers/SequenceIDDispatcher.java
Tue Nov 20 05:17:01 2007
@@ -39,11 +39,9 @@
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.SandeshaUtil;
 
-import java.util.Map;
-
 public class SequenceIDDispatcher extends AbstractDispatcher {
 
-	private final String NAME = "SequenceIDDIspatcher";
+	private static final String NAME = "SequenceIDDIspatcher";
 	private static final Log log = LogFactory.getLog(SequenceIDDispatcher.class);
 	
 	public AxisOperation findOperation(AxisService service, MessageContext messageContext) {

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
Tue Nov 20 05:17:01 2007
@@ -571,13 +571,12 @@
 					if (rmsBean != null && rmsBean.getLastSendError() != null) {
 						if (rmsBean.getLastSendError() instanceof AxisFault)
 							throw (AxisFault)rmsBean.getLastSendError();
-					}
-					if (rmsBean.getLastSendError() != null)
+						
 						throw new AxisFault(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSequenceRefused),

 								rmsBean.getLastSendError());
+					}
 					
-					throw new AxisFault(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSequenceRefused));
-						
+					throw new AxisFault(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSequenceRefused));
					
 				}
 			}
 			// Setup enough of the workers to get this create sequence off the box.

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
Tue Nov 20 05:17:01 2007
@@ -44,7 +44,6 @@
 import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.Transaction;
 import org.apache.sandesha2.storage.beanmanagers.RMDBeanMgr;
-import org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr;
 import org.apache.sandesha2.storage.beans.RMDBean;
 import org.apache.sandesha2.storage.beans.RMSBean;
 import org.apache.sandesha2.storage.beans.SenderBean;
@@ -57,9 +56,6 @@
 import org.apache.sandesha2.util.SpecSpecificConstants;
 import org.apache.sandesha2.util.TerminateManager;
 import org.apache.sandesha2.util.WSRMMessageSender;
-import org.apache.sandesha2.workers.SandeshaThread;
-import org.apache.sandesha2.workers.SenderWorker;
-import org.apache.sandesha2.workers.WorkerLock;
 import org.apache.sandesha2.wsrm.SequenceAcknowledgement;
 import org.apache.sandesha2.wsrm.TerminateSequence;
 

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java
Tue Nov 20 05:17:01 2007
@@ -27,7 +27,6 @@
 import org.apache.axis2.context.AbstractContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
 import org.apache.sandesha2.i18n.SandeshaMessageKeys;
 import org.apache.sandesha2.storage.SandeshaStorageException;

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java
Tue Nov 20 05:17:01 2007
@@ -343,7 +343,7 @@
 		return useSerialization;
 	}
 
-	private class SerializedStorageEntry {
+	private static class SerializedStorageEntry {
 		MessageContext       message;
 		byte[]               data;
 		ConfigurationContext context;
@@ -354,7 +354,7 @@
 		Object               inTransportOut;
 		Object               inTransportOutInfo;
 	}
-	private class StorageEntry {
+	private static class StorageEntry {
 		MessageContext msgContext;
 		SOAPEnvelope   envelope;
 	}

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/AcknowledgementManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/AcknowledgementManager.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/AcknowledgementManager.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/AcknowledgementManager.java
Tue Nov 20 05:17:01 2007
@@ -39,7 +39,6 @@
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
 import org.apache.sandesha2.i18n.SandeshaMessageKeys;
 import org.apache.sandesha2.storage.StorageManager;
-import org.apache.sandesha2.storage.Transaction;
 import org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
 import org.apache.sandesha2.storage.beans.RMDBean;
 import org.apache.sandesha2.storage.beans.SenderBean;

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/MsgInitializer.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/MsgInitializer.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/MsgInitializer.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/MsgInitializer.java
Tue Nov 20 05:17:01 2007
@@ -178,7 +178,7 @@
 		TerminateSequence terminateSequence = elements.getTerminateSequence();
 		TerminateSequenceResponse terminateSequenceResponse = elements.getTerminateSequenceResponse();
 		Iterator sequenceAcknowledgementsIter = elements.getSequenceAcknowledgements();
-		Sequence sequence = (Sequence) elements.getSequence();
+		Sequence sequence = elements.getSequence();
 		Iterator ackRequestedIter = elements.getAckRequests();
 		CloseSequence closeSequence = elements.getCloseSequence();
 		CloseSequenceResponse closeSequenceResponse = elements.getCloseSequenceResponse();

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java
Tue Nov 20 05:17:01 2007
@@ -222,8 +222,6 @@
 
 	public static SandeshaPolicyBean loadPropertiesFromModuleDescPolicy(AxisModule desc,
 			SandeshaPolicyBean parentPropertyBean) throws SandeshaException {
-		
-        SandeshaPolicyBean propertyBean = new SandeshaPolicyBean();
 
 		Policy policy = desc.getPolicyInclude().getEffectivePolicy();
 
@@ -255,7 +253,7 @@
             return null;
         }
         
-        propertyBean = (SandeshaPolicyBean) assertion;
+        SandeshaPolicyBean propertyBean = (SandeshaPolicyBean) assertion;
         propertyBean.setParent(parentPropertyBean);
 
 		return propertyBean;
@@ -264,8 +262,6 @@
 	public static SandeshaPolicyBean loadPropertiesFromAxisDescription(AxisDescription desc,
 			SandeshaPolicyBean parentPropertyBean) throws SandeshaException {
 		
-        SandeshaPolicyBean propertyBean = new SandeshaPolicyBean();
-
         Policy policy = desc.getPolicyInclude().getEffectivePolicy();
 
         if (policy == null) {
@@ -296,17 +292,16 @@
             return null;
         }
         
-        propertyBean = (SandeshaPolicyBean) assertion;
+        SandeshaPolicyBean propertyBean = (SandeshaPolicyBean) assertion;
         
         if (propertyBean!=parentPropertyBean) {
         	if(parentPropertyBean != null) propertyBean.setParent(parentPropertyBean);
         	return propertyBean;
-        } else {
-        	//propertyBean and parent being the same object means that there is no policy in
this level, this is simply the reflection of 
-        	//the parent.
-        	return null;
-        }
+        } 
         
+        //propertyBean and parent being the same object means that there is no policy in
this level, this is simply the reflection of 
+        //the parent.
+        return null;               
 	}
 
 	public static void reloadFromPropertyFile(InputStream stream) throws SandeshaException {

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/RangeString.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/RangeString.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/RangeString.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/RangeString.java
Tue Nov 20 05:17:01 2007
@@ -347,7 +347,6 @@
 				
 				above.lowerValue = r.lowerValue; //extend down
 				rangeMap.put(new Long(above.lowerValue), above);
-				finalRange = above;
 			}
 			//finally we do the remove of the above range under its old key
 			rangeMap.remove(removeKey);

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/Invoker.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/Invoker.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/Invoker.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/Invoker.java
Tue Nov 20 05:17:01 2007
@@ -342,10 +342,10 @@
 				try {
 					// Set the lock up before we start the thread, but roll it back
 					// if we hit any problems
-					getWorkerLock().addWork(workId, worker);
-					threadPool.execute(work);
+					if(worker.getLock().addWork(workId, worker))
+						threadPool.execute(work);
 				} catch(Exception e) {
-					getWorkerLock().removeWork(workId);
+					worker.getLock().removeWork(workId);
 				}				
 				processedMessage = true;
 			}

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/InvokerWorker.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/InvokerWorker.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/InvokerWorker.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/InvokerWorker.java
Tue Nov 20 05:17:01 2007
@@ -107,7 +107,7 @@
 			Runnable nextRunnable = null;
 
 			// Invoke the first message
-	    	lastMessageInvoked = invokeMessage(null);
+			lastMessageInvoked = invokeMessage(null);
 
 			// Look for the next message, so long as we are still processing normally
 			while(!ignoreNextMsg && lastMessageInvoked) {
@@ -208,11 +208,11 @@
 		MessageContext msgToInvoke = null;
 		boolean messageInvoked = true;
 		
-	    // If we are not the holder of the correct lock, then we have to stop
-	    if(lock != null && (!lock.ownsLock(workId, this))) {
-	    	if (log.isDebugEnabled()) log.debug("Exit: InvokerWorker::run, another worker holds
the lock");
-	    	return false;
-	    }
+		// If we are not the holder of the correct lock, then we have to stop
+		if(lock != null && (!lock.ownsLock(workId, this))) {
+			if (log.isDebugEnabled()) log.debug("Exit: InvokerWorker::run, another worker holds the
lock");
+			return false;
+		}
 		
 		try {
 			
@@ -244,14 +244,48 @@
 			RMMsgContext rmMsg = MsgInitializer.initializeMessage(msgToInvoke);
 
 			// Lock the RMD Bean just to avoid deadlocks
-			SandeshaUtil.getRMDBeanFromSequenceId(storageManager, invokerBean.getSequenceID());
+			RMDBean rMDBean = SandeshaUtil.getRMDBeanFromSequenceId(storageManager, invokerBean.getSequenceID());
+
+			boolean highestMessage = false;
+
+			if(!ignoreNextMsg){
+				// updating the next msg to invoke
+				long nextMsgNo = rMDBean.getNextMsgNoToProcess();
+				
+				if (!(invokerBean.getMsgNo()==nextMsgNo)) {
+					//someone else has invoked this before us - this run should now stop
+					if(log.isDebugEnabled()) log.debug("Operated message number is different from the Next
Message Number to invoke");
+					return false;
+				}
+				
+				nextMsgNo++;
+				rMDBean.setNextMsgNoToProcess(nextMsgNo);
+				storageManager.getRMDBeanMgr().update(rMDBean);
+			}
+			
+			// Check if this is the last message
+			if (rmMsg.getMessageType() == Sandesha2Constants.MessageTypes.APPLICATION) {
+				Sequence sequence = (Sequence) rmMsg
+						.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
+				
+				if (sequence.getLastMessage() != null) {
+					//this will work for RM 1.0 only
+					highestMessage = true;
+				} else {
+					if (rMDBean!=null && rMDBean.isTerminated()) {
+						long highestInMsgNo = rMDBean.getHighestInMessageNumber();
+						if (invokerBean.getMsgNo()==highestInMsgNo)
+							highestMessage = true;
+					}
+				}
+			}
+
 			// Depending on the transaction  support, the service will be invoked only once. 
 			// Therefore we delete the invoker bean and message now, ahead of time
 			invokerBeanMgr.delete(messageContextKey);
 			// removing the corresponding message context as well.
 			storageManager.removeMessageContext(messageContextKey);
 
-			
 			try {
 
 				boolean postFailureInvocation = false;
@@ -265,7 +299,7 @@
 						&& Sandesha2Constants.VALUE_TRUE.equals(postFaulureProperty))
 					postFailureInvocation = true;
 
-		        InvocationResponse response = null;
+				InvocationResponse response = null;
 				if (postFailureInvocation) {
 					makeMessageReadyForReinjection(msgToInvoke);
 					if (log.isDebugEnabled())
@@ -279,77 +313,42 @@
 					msgToInvoke.setPaused(false);
 					response = AxisEngine.resumeReceive(msgToInvoke);
 				}
-		        if(!InvocationResponse.SUSPEND.equals(response)) {
-		            // Performance work - need to close the XMLStreamReader to prevent GC thrashing.
-		            SOAPEnvelope env = msgToInvoke.getEnvelope();
-		            if(env!=null){
-		              StAXBuilder sb = (StAXBuilder)msgToInvoke.getEnvelope().getBuilder();
-		              if(sb!=null){
-		                sb.close();
-		              }
-		            }
-		        }
-		        
-		        if (transaction != null && transaction.isActive())
-		        	transaction.commit();
-
-			} catch (Exception e) {
-				if (log.isDebugEnabled())
-					log.debug("Exception :", e);
-
-				if (transaction != null && transaction.isActive())
-					transaction.rollback();
-				messageInvoked = false;
-				
-				handleFault(rmMsg, e);
-			}
 
-			transaction = storageManager.getTransaction();
-			 
-			if (rmMsg.getMessageType() == Sandesha2Constants.MessageTypes.APPLICATION) {
-				Sequence sequence = (Sequence) rmMsg
-						.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
-				
-				boolean highestMessage = false;
-				if (sequence.getLastMessage() != null) {
-					//this will work for RM 1.0 only
-					highestMessage = true;
-				} else {
-					RMDBean rmdBean = SandeshaUtil.getRMDBeanFromSequenceId(storageManager, invokerBean.getSequenceID());
-					
-					if (rmdBean!=null && rmdBean.isTerminated()) {
-						long highestInMsgNo = rmdBean.getHighestInMessageNumber();
-						if (invokerBean.getMsgNo()==highestInMsgNo)
-							highestMessage = true;
+				if(!InvocationResponse.SUSPEND.equals(response)) {
+					// Performance work - need to close the XMLStreamReader to prevent GC thrashing.
+					SOAPEnvelope env = msgToInvoke.getEnvelope();
+					if(env!=null){
+						StAXBuilder sb = (StAXBuilder)msgToInvoke.getEnvelope().getBuilder();
+						if(sb!=null){
+							sb.close();
+						}
 					}
 				}
-				
+
+				if (transaction != null && transaction.isActive()) {
+					transaction.commit();
+					transaction = storageManager.getTransaction();
+				}
+
 				if (highestMessage) {
 					//do cleaning stuff that hs to be done after the invocation of the last message.
 					TerminateManager.cleanReceivingSideAfterInvocation(invokerBean.getSequenceID(), storageManager);
 					// exit from current iteration. (since an entry
 					// was removed)
-					if(transaction != null && transaction.isActive()) transaction.commit();
-					if(log.isDebugEnabled()) log.debug("Exit: InvokerWorker::invokeMessage Last message
return " + messageInvoked);
-					return messageInvoked;	
-				}
-			}
-			
-			if(!ignoreNextMsg){
-				// updating the next msg to invoke
-				RMDBean rMDBean = storageManager.getRMDBeanMgr().retrieve(invokerBean.getSequenceID());
-				long nextMsgNo = rMDBean.getNextMsgNoToProcess();
-				
-				if (!(invokerBean.getMsgNo()==nextMsgNo)) {
-					String message = "Operated message number is different from the Next Message Number
to invoke";
-					throw new SandeshaException (message);
+					if(log.isDebugEnabled()) log.debug("Exit: InvokerWorker::invokeMessage Last message
return " + messageInvoked);					
+					return messageInvoked;
 				}
+
+			} catch (Exception e) {
+				if (log.isDebugEnabled())
+					log.debug("Exception :", e);
+
+				if (transaction != null && transaction.isActive())
+					transaction.rollback();
+				messageInvoked = false;
 				
-				nextMsgNo++;
-				rMDBean.setNextMsgNoToProcess(nextMsgNo);
-				storageManager.getRMDBeanMgr().update(rMDBean);
+				handleFault(rmMsg, e);
 			}
-			
 			if(transaction != null && transaction.isActive()) transaction.commit();
 			transaction = null;
 			

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Identifier.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Identifier.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Identifier.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Identifier.java
Tue Nov 20 05:17:01 2007
@@ -36,15 +36,11 @@
 
 	private String identifier = null;
 	
-	private String namespaceValue = null;
-	
 	public Identifier(String namespaceValue) throws SandeshaException {
 		if (!isNamespaceSupported(namespaceValue))
 			throw new SandeshaException (SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.unknownSpec,
 					namespaceValue));
-		
-		this.namespaceValue = namespaceValue;
 	}
 
 	public void setIndentifer(String identifier) {

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MessagePending.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MessagePending.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MessagePending.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MessagePending.java
Tue Nov 20 05:17:01 2007
@@ -108,7 +108,7 @@
 		
 		SOAPHeaderBlock headerBlock = header.addHeaderBlock(Sandesha2Constants.WSRM_COMMON.MESSAGE_PENDING,namespace);
 		
-		OMAttribute attribute = factory.createOMAttribute(Sandesha2Constants.WSRM_COMMON.PENDING,null,new
Boolean (pending).toString());
+		OMAttribute attribute = factory.createOMAttribute(Sandesha2Constants.WSRM_COMMON.PENDING,null,
Boolean.valueOf (pending).toString());
 		headerBlock.addAttribute(attribute);
 		
 		return headerElement;

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/RMElements.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/RMElements.java?rev=596652&r1=596651&r2=596652&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/RMElements.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/RMElements.java
Tue Nov 20 05:17:01 2007
@@ -95,7 +95,6 @@
 		if(firstBodyElement != null) {
 			QName firstBodyQName = firstBodyElement.getQName();
 			String namespace = firstBodyQName.getNamespaceURI();
-			String localName = firstBodyQName.getLocalPart();
 
 			boolean isSPEC2007_02 = SPEC_2007_02.NS_URI.equals(namespace);
 			boolean isSPEC2005_02 = false;



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org


Mime
View raw message