You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ch...@apache.org on 2005/10/09 06:21:24 UTC
svn commit: r307357 - in
/webservices/sandesha/trunk/src/org/apache/sandesha2: Constants.java
RMMsgCreator.java SequenceMenager.java handlers/SandeshaOutHandler.java
msgprocessors/ApplicationMsgProcessor.java
Author: chamikara
Date: Sat Oct 8 21:20:29 2005
New Revision: 307357
URL: http://svn.apache.org/viewcvs?rev=307357&view=rev
Log:
Rearranged the SandeshaOutHandler for the client side.
Modified:
webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java
webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgCreator.java
webservices/sandesha/trunk/src/org/apache/sandesha2/SequenceMenager.java
webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java
webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java?rev=307357&r1=307356&r2=307357&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java Sat Oct 8 21:20:29 2005
@@ -209,6 +209,9 @@
String NEXT_MESSAGE = "NextMsgBeanMap";
}
+ public interface ClientProperties {
+ String AcksTo = "AcksToStr";
+ }
//TODO remove following three
int STORAGE_TYPE_IN_MEMORY = 1;
@@ -232,4 +235,6 @@
int TERMINATE_DELAY = 1000;
String LAST_MESSAGE = "WSRMLastMessage";
+
+ String TEMP_SEQUENCE_ID = "uuid:tempID";
}
Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgCreator.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgCreator.java?rev=307357&r1=307356&r2=307357&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgCreator.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgCreator.java Sat Oct 8 21:20:29 2005
@@ -62,8 +62,9 @@
public class RMMsgCreator {
- public static RMMsgContext createCreateSeqMsg(RMMsgContext applicationRMMsg)
+ public static RMMsgContext createCreateSeqMsg(RMMsgContext applicationRMMsg, String tempSequenceId)
throws SandeshaException {
+
MessageContext applicationMsgContext = applicationRMMsg
.getMessageContext();
if (applicationMsgContext == null)
@@ -72,6 +73,7 @@
if (context == null)
throw new SandeshaException("Configuration Context is null");
+ SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory.getInstance(context).getSequencePropretyBeanMgr();
MessageContext createSeqmsgContext;
try {
//creating by copying common contents. (this will not set contexts
@@ -121,10 +123,13 @@
CreateSequence createSequencePart = new CreateSequence();
- //TODO correct below. Set a correct acksTo value
- EndpointReference acksToEPR = applicationRMMsg.getReplyTo();
-
- createSequencePart.setAcksTo(new AcksTo(new Address(acksToEPR)));
+ //TODO decide - where to send create seq. Acksto or replyTo
+ SequencePropertyBean replyToBean = seqPropMgr.retrieve(tempSequenceId, Constants.SequenceProperties.REPLY_TO_EPR);
+ EndpointReference replyToEPR = (EndpointReference) replyToBean.getValue();
+ if (replyToEPR==null)
+ throw new SandeshaException ("ReplyTo EPR is not set");
+
+ createSequencePart.setAcksTo(new AcksTo(new Address(replyToEPR)));
createSeqRMMsg.setMessagePart(Constants.MessageParts.CREATE_SEQ,
createSequencePart);
@@ -143,13 +148,7 @@
createSeqRMMsg.setTo(to);
- EndpointReference replyTo = applicationRMMsg.getReplyTo();
- if (replyTo == null || replyTo.getAddress() == null
- || replyTo.getAddress() == null || to.getAddress() == "")
- throw new SandeshaException(
- "ReplyTo value of the Application Message is not set correctly");
-
- createSeqRMMsg.setReplyTo(replyTo);
+ createSeqRMMsg.setReplyTo(replyToEPR);
createSeqRMMsg.setMessageId(createSeqMsgId);
MessageContext createSeqMsg = createSeqRMMsg.getMessageContext();
Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/SequenceMenager.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/SequenceMenager.java?rev=307357&r1=307356&r2=307357&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/SequenceMenager.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/SequenceMenager.java Sat Oct 8 21:20:29 2005
@@ -14,6 +14,7 @@
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.context.AbstractContext;
import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
import org.apache.sandesha2.storage.AbstractBeanMgrFactory;
import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
@@ -88,5 +89,38 @@
public void removeSequence(String sequence) {
+ }
+
+ public static void setUpNewClientSequence (MessageContext firstAplicationMsgCtx, String tempSequenceId) throws SandeshaException {
+
+ AbstractContext context = firstAplicationMsgCtx.getSystemContext();
+ SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory.getInstance(context).getSequencePropretyBeanMgr();
+
+
+ EndpointReference toEPR = firstAplicationMsgCtx.getTo();
+ EndpointReference replyToEPR = firstAplicationMsgCtx.getReplyTo();
+ String acksTo = (String) firstAplicationMsgCtx.getProperty(Constants.ClientProperties.AcksTo);
+
+ if (toEPR==null)
+ throw new SandeshaException ("WS-Addressing To is null");
+
+ SequencePropertyBean toBean = new SequencePropertyBean (tempSequenceId, Constants.SequenceProperties.TO_EPR,toEPR);
+
+ //Default value for acksTo is anonymous
+ if (acksTo==null)
+ acksTo = Constants.WSA.NS_URI_ANONYMOUS;
+
+ EndpointReference acksToEPR = new EndpointReference (acksTo);
+ SequencePropertyBean acksToBean = new SequencePropertyBean (tempSequenceId, Constants.SequenceProperties.ACKS_TO_EPR,acksToEPR);
+
+// //TODO - make default for replyTo anonymous
+// if (replyToEPR==null)
+// replyToEPR = new EndpointReference (Constants.WSA.NS_URI_ANONYMOUS);
+
+ seqPropMgr.insert(toBean);
+ seqPropMgr.insert(acksToBean);
+
+
+
}
}
Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java?rev=307357&r1=307356&r2=307357&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java Sat Oct 8 21:20:29 2005
@@ -18,11 +18,6 @@
package org.apache.sandesha2.handlers;
import javax.xml.namespace.QName;
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.context.AbstractContext;
@@ -38,6 +33,7 @@
import org.apache.sandesha2.SandeshaException;
import org.apache.sandesha2.RMMsgContext;
import org.apache.sandesha2.RMMsgCreator;
+import org.apache.sandesha2.SequenceMenager;
import org.apache.sandesha2.storage.AbstractBeanMgrFactory;
import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
import org.apache.sandesha2.storage.beanmanagers.RetransmitterBeanMgr;
@@ -62,10 +58,6 @@
if (null != DONE && "true".equals(DONE))
return;
- //Strating the sender.
- ConfigurationContext context = msgCtx.getSystemContext();
- SandeshaUtil.startSenderIfStopped(context);
-
//getting rm message
RMMsgContext rmMsgCtx = null;
try {
@@ -79,25 +71,27 @@
if (!(rmMsgCtx.getMessageType() == Constants.MessageTypes.UNKNOWN)) {
return;
}
- boolean serverSide = msgCtx.isServerSide();
- String tempSequenceId = null;
+ //Strating the sender.
+ ConfigurationContext context = msgCtx.getSystemContext();
+ SandeshaUtil.startSenderIfStopped(context);
+
+ CreateSeqBeanMgr createSeqMgr = AbstractBeanMgrFactory.getInstance(
+ context).getCreateSeqBeanMgr();
SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory
.getInstance(context).getSequencePropretyBeanMgr();
+ boolean serverSide = msgCtx.isServerSide();
- //setting temp sequence id (depending on the server side and the client
- // side)
- //temp sequence id is the one used to refer to the sequence (since
- // actual sequence
- // id is not available when first msg arrives)
- //server side - sequenceId if the incoming sequence , client side -
- // xxxxxxxxx
- if (!serverSide) {
- //Code for the client side
+ //initial work
+ //find temp sequence id
+ String tempSequenceId = null;
- } else {
+ //Temp sequence id is the one used to refer to the sequence (since
+ //actual sequence id is not available when first msg arrives)
+ //server side - sequenceId if the incoming sequence
+ //client side - xxxxxxxxx
+ if (serverSide) {
try {
- //code for the server side
//getting the request message and rmMessage.
MessageContext reqMsgCtx = msgCtx
.getOperationContext()
@@ -121,108 +115,178 @@
} catch (SandeshaException e1) {
throw new AxisFault(e1.getMessage());
}
+
+ } else {
+ //set the temp sequence id for the client side.
+ }
+
+ //check if the fist message
+
+ boolean firstApplicationMessage = false;
+ if (serverSide) {
+ SequencePropertyBean outSequenceBean = seqPropMgr.retrieve(
+ tempSequenceId,
+ Constants.SequenceProperties.OUT_SEQUENCE_ID);
+ if (outSequenceBean == null)
+ firstApplicationMessage = true;
+
+ } else {
+
+ }
+
+ //if fist message - setup the sequence for the client side
+ if (!serverSide && firstApplicationMessage) {
+ try {
+ SequenceMenager.setUpNewClientSequence(msgCtx, tempSequenceId);
+ } catch (SandeshaException e1) {
+ throw new AxisFault(e1.getMessage());
+ }
}
+ //if first message - add create sequence
+ if (firstApplicationMessage) {
+
+ SequencePropertyBean responseCreateSeqAdded = seqPropMgr.retrieve(
+ tempSequenceId,
+ Constants.SequenceProperties.OUT_CREATE_SEQUENCE_SENT);
+
+ if (responseCreateSeqAdded == null) {
+ responseCreateSeqAdded = new SequencePropertyBean(
+ tempSequenceId,
+ Constants.SequenceProperties.OUT_CREATE_SEQUENCE_SENT,
+ "true");
+ seqPropMgr.insert(responseCreateSeqAdded);
+
+ try {
+ addCreateSequenceMessage(rmMsgCtx, tempSequenceId);
+ } catch (SandeshaException e1) {
+ throw new AxisFault(e1.getMessage());
+ }
+ }
+ }
+
+ //do response processing
try {
- if (rmMsgCtx.getMessageType() == Constants.MessageTypes.UNKNOWN) {
- System.out.println("GOT Possible Response Message");
- SOAPEnvelope env = rmMsgCtx.getSOAPEnvelope();
- if (env == null) {
- SOAPEnvelope envelope = SOAPAbstractFactory.getSOAPFactory(
- Constants.SOAPVersion.DEFAULT).getDefaultEnvelope();
- rmMsgCtx.setSOAPEnvelop(envelope);
+ SOAPEnvelope env = rmMsgCtx.getSOAPEnvelope();
+ if (env == null) {
+ SOAPEnvelope envelope = SOAPAbstractFactory.getSOAPFactory(
+ Constants.SOAPVersion.DEFAULT).getDefaultEnvelope();
+ rmMsgCtx.setSOAPEnvelop(envelope);
+ }
+
+ SOAPBody soapBody = rmMsgCtx.getSOAPEnvelope().getBody();
+ if (soapBody == null)
+ throw new SandeshaException(
+ "Invalid SOAP message. Body is not present");
+
+ //TODO - Is this a correct way to find out validity of app.
+ // messages.
+ boolean validAppMessage = false;
+ if (soapBody.getChildElements().hasNext())
+ validAppMessage = true;
+
+ if (validAppMessage) {
+
+ //valid response
+
+ //FIXME - do not copy application messages. Coz u loose
+ // properties etc.
+ RMMsgContext newRMMsgCtx = SandeshaUtil.deepCopy(rmMsgCtx);
+ MessageContext newMsgCtx = newRMMsgCtx.getMessageContext();
+
+ //setting contexts
+ newMsgCtx.setServiceGroupContext(msgCtx
+ .getServiceGroupContext());
+ newMsgCtx.setServiceGroupContextId(msgCtx
+ .getServiceGroupContextId());
+ newMsgCtx.setServiceContext(msgCtx.getServiceContext());
+ newMsgCtx.setServiceContextID(msgCtx.getServiceContextID());
+ OperationContext newOpContext = new OperationContext(newMsgCtx
+ .getOperationDescription());
+
+ //if server side add request message
+ if (msgCtx.isServerSide()) {
+ MessageContext reqMsgCtx = msgCtx.getOperationContext()
+ .getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ newOpContext.addMessageContext(reqMsgCtx);
}
- SOAPBody soapBody = rmMsgCtx.getSOAPEnvelope().getBody();
- if (soapBody == null)
- throw new SandeshaException(
- "Invalid SOAP message. Body is not present");
-
- //TODO - Is this a correct way to find out validity of app.
- // messages.
- boolean validAppMessage = false;
- if (soapBody.getChildElements().hasNext())
- validAppMessage = true;
-
- if (validAppMessage) {
-
- //valid response
-
- //FIXME - do not copy application messages. Coz u loose
- // properties etc.
- RMMsgContext newRMMsgCtx = SandeshaUtil.deepCopy(rmMsgCtx);
- MessageContext newMsgCtx = newRMMsgCtx.getMessageContext();
-
- //setting contexts
- newMsgCtx.setServiceGroupContext(msgCtx
- .getServiceGroupContext());
- newMsgCtx.setServiceGroupContextId(msgCtx
- .getServiceGroupContextId());
- newMsgCtx.setServiceContext(msgCtx.getServiceContext());
- newMsgCtx.setServiceContextID(msgCtx.getServiceContextID());
- OperationContext newOpContext = new OperationContext(
- newMsgCtx.getOperationDescription());
-
- //if server side add request message
- if (msgCtx.isServerSide()) {
- MessageContext reqMsgCtx = msgCtx.getOperationContext()
- .getMessageContext(
- WSDLConstants.MESSAGE_LABEL_IN_VALUE);
- newOpContext.addMessageContext(reqMsgCtx);
- }
-
- newOpContext.addMessageContext(newMsgCtx);
- newMsgCtx.setOperationContext(newOpContext);
-
- //processing the response
- processResponseMessage(newRMMsgCtx, tempSequenceId);
-
- if (serverSide) {
-
- MessageContext reqMsgCtx = msgCtx.getOperationContext()
- .getMessageContext(
- WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-
- RMMsgContext requestRMMsgCtx = MsgInitializer
- .initializeMessage(reqMsgCtx);
-
- //let the request end with 202 if a ack has not been
- // written in the incoming thread.
- if (reqMsgCtx.getProperty(Constants.ACK_WRITTEN) == null
- || !"true".equals(reqMsgCtx
- .getProperty(Constants.ACK_WRITTEN)))
- reqMsgCtx
- .getOperationContext()
- .setProperty(
- org.apache.axis2.Constants.RESPONSE_WRITTEN,
- "false");
- msgCtx.setPausedTrue(getName());
-
- SOAPEnvelope env123 = msgCtx.getEnvelope();
- try {
- XMLStreamWriter writer = XMLOutputFactory
- .newInstance().createXMLStreamWriter(
- System.out);
- env123.serialize(writer);
- } catch (XMLStreamException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- } catch (FactoryConfigurationError e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
-
- } else {
- //client side wait
- }
+ newOpContext.addMessageContext(newMsgCtx);
+ newMsgCtx.setOperationContext(newOpContext);
+
+ //processing the response
+ processResponseMessage(newRMMsgCtx, tempSequenceId);
+
+ if (serverSide) {
+
+ MessageContext reqMsgCtx = msgCtx.getOperationContext()
+ .getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ RMMsgContext requestRMMsgCtx = MsgInitializer
+ .initializeMessage(reqMsgCtx);
+
+ //let the request end with 202 if a ack has not been
+ // written in the incoming thread.
+ if (reqMsgCtx.getProperty(Constants.ACK_WRITTEN) == null
+ || !"true".equals(reqMsgCtx
+ .getProperty(Constants.ACK_WRITTEN)))
+ reqMsgCtx.getOperationContext().setProperty(
+ org.apache.axis2.Constants.RESPONSE_WRITTEN,
+ "false");
+ msgCtx.setPausedTrue(getName());
+
+ SOAPEnvelope env123 = msgCtx.getEnvelope();
+
+ } else {
+ //client side wait
+
}
}
+
} catch (SandeshaException e) {
throw new AxisFault(e.getMessage());
}
}
+ public void addCreateSequenceMessage(RMMsgContext applicationRMMsg,
+ String tempSequenceId) throws SandeshaException {
+
+ MessageContext applicationMsg = applicationRMMsg.getMessageContext();
+ if (applicationMsg == null)
+ throw new SandeshaException("Message context is null");
+ RMMsgContext createSeqRMMessage = RMMsgCreator.createCreateSeqMsg(
+ applicationRMMsg, tempSequenceId);
+ MessageContext createSeqMsg = createSeqRMMessage.getMessageContext();
+ createSeqMsg.setRelatesTo(null); //create seq msg does not relateTo
+ // anything
+ AbstractContext context = applicationRMMsg.getContext();
+ if (context == null)
+ throw new SandeshaException("Context is null");
+
+ CreateSeqBeanMgr createSeqMgr = AbstractBeanMgrFactory.getInstance(
+ context).getCreateSeqBeanMgr();
+ CreateSeqBean createSeqBean = new CreateSeqBean(tempSequenceId,
+ createSeqMsg.getMessageID(), null);
+ createSeqMgr.insert(createSeqBean);
+
+ System.out.println("Create sequence msg id:"
+ + createSeqRMMessage.getMessageId());
+
+ RetransmitterBeanMgr retransmitterMgr = AbstractBeanMgrFactory
+ .getInstance(context).getRetransmitterBeanMgr();
+ String key = SandeshaUtil.storeMessageContext(createSeqRMMessage
+ .getMessageContext());
+ RetransmitterBean createSeqEntry = new RetransmitterBean();
+ createSeqEntry.setKey(key);
+ createSeqEntry.setLastSentTime(0);
+ createSeqEntry.setMessageId(createSeqRMMessage.getMessageId());
+ createSeqEntry.setSend(true);
+ retransmitterMgr.insert(createSeqEntry);
+
+ }
+
private void processResponseMessage(RMMsgContext rmMsg,
String tempSequenceId) throws SandeshaException {
@@ -251,24 +315,27 @@
if (toBean == null)
throw new SandeshaException("To is null");
- if (replyToBean == null)
- throw new SandeshaException("Replyto is null");
+ // if (replyToBean == null)
+ // throw new SandeshaException("Replyto is null");
- EndpointReference incomingTo = (EndpointReference) toBean.getValue();
- EndpointReference incomingReplyTo = (EndpointReference) replyToBean
- .getValue();
+ EndpointReference toEPR = (EndpointReference) toBean.getValue();
+ EndpointReference replyToEPR = null;
- if (incomingTo == null || incomingTo.getAddress() == null
- || incomingTo.getAddress() == "")
- throw new SandeshaException("To Property has an invalid value");
- if (incomingReplyTo == null || incomingReplyTo.getAddress() == null
- || incomingReplyTo.getAddress() == "")
- throw new SandeshaException("ReplyTo is not set correctly");
+ if (replyToBean != null) {
+ replyToEPR = (EndpointReference) replyToBean.getValue();
+ }
- //FIXME - set toBean - replyto value, replytobean - tovalue
+ if (toEPR == null || toEPR.getAddress() == null
+ || toEPR.getAddress() == "")
+ throw new SandeshaException("To Property has an invalid value");
- rmMsg.setTo(incomingTo);
- rmMsg.setReplyTo(incomingReplyTo);
+ // if (replyToEPR == null || replyToEPR.getAddress() == null
+ // || replyToEPR.getAddress() == "")
+ // throw new SandeshaException("ReplyTo is not set correctly");
+
+ rmMsg.setTo(toEPR);
+ if (replyToEPR != null)
+ rmMsg.setReplyTo(replyToEPR);
//Retransmitter bean entry for the application message
RetransmitterBean appMsgEntry = new RetransmitterBean();
@@ -309,7 +376,7 @@
throw new SandeshaException("Request Sequence is null");
if (requestSequence.getLastMessage() != null) {
- //FIX ME - This fails if request last message has more than one
+ //FIXME - This fails if request last message has more than one
// responses.
sequence.setLastMessage(new LastMessage());
@@ -329,29 +396,12 @@
}
}
+ //setting the Sequnece id.
+ //Set send = true/false depending on the availability of the out
+ // sequence id.
if (outSequenceBean == null || outSequenceBean.getValue() == null) {
-
- if (tempSequenceId == null)
- throw new SandeshaException("TempSequenceId is not set");
-
- //Adding create sequence
- SequencePropertyBean responseCreateSeqAdded = sequencePropertyMgr
- .retrieve(
- tempSequenceId,
- Constants.SequenceProperties.OUT_CREATE_SEQUENCE_SENT);
-
- if (responseCreateSeqAdded == null
- || responseCreateSeqAdded.getValue() == null
- || "".equals(responseCreateSeqAdded.getValue())) {
- responseCreateSeqAdded = new SequencePropertyBean(
- tempSequenceId,
- Constants.SequenceProperties.OUT_CREATE_SEQUENCE_SENT,
- "true");
- sequencePropertyMgr.insert(responseCreateSeqAdded);
- addCreateSequenceMessage(rmMsg, tempSequenceId);
- }
Identifier identifier = new Identifier();
- identifier.setIndentifer("uuid:tempID");
+ identifier.setIndentifer(Constants.TEMP_SEQUENCE_ID);
sequence.setIdentifier(identifier);
appMsgEntry.setSend(false);
} else {
@@ -369,7 +419,6 @@
}
appMsgEntry.setTempSequenceId(tempSequenceId);
-
retransmitterMgr.insert(appMsgEntry);
}
@@ -401,41 +450,6 @@
seqPropMgr.insert(nextMsgNoBean);
return nextMsgNo;
- }
-
- public void addCreateSequenceMessage(RMMsgContext applicationRMMsg,
- String tempSequenceId) throws SandeshaException {
- MessageContext applicationMsg = applicationRMMsg.getMessageContext();
- if (applicationMsg == null)
- throw new SandeshaException("Message context is null");
- RMMsgContext createSeqRMMessage = RMMsgCreator
- .createCreateSeqMsg(applicationRMMsg);
- MessageContext createSeqMsg = createSeqRMMessage.getMessageContext();
- createSeqMsg.setRelatesTo(null); //create seq msg does not relateTo
- // anything
- AbstractContext context = applicationRMMsg.getContext();
- if (context == null)
- throw new SandeshaException("Context is null");
-
- CreateSeqBeanMgr createSeqMgr = AbstractBeanMgrFactory.getInstance(
- context).getCreateSeqBeanMgr();
- CreateSeqBean createSeqBean = new CreateSeqBean(tempSequenceId,
- createSeqMsg.getMessageID(), null);
- createSeqMgr.insert(createSeqBean);
-
- System.out.println("Create sequence msg id:"
- + createSeqRMMessage.getMessageId());
-
- RetransmitterBeanMgr retransmitterMgr = AbstractBeanMgrFactory
- .getInstance(context).getRetransmitterBeanMgr();
- String key = SandeshaUtil.storeMessageContext(createSeqRMMessage
- .getMessageContext());
- RetransmitterBean createSeqEntry = new RetransmitterBean();
- createSeqEntry.setKey(key);
- createSeqEntry.setLastSentTime(0);
- createSeqEntry.setMessageId(createSeqRMMessage.getMessageId());
- createSeqEntry.setSend(true);
- retransmitterMgr.insert(createSeqEntry);
}
public QName getName() {
Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java?rev=307357&r1=307356&r2=307357&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java Sat Oct 8 21:20:29 2005
@@ -98,13 +98,13 @@
&& (Constants.QOS.InvocationType.DEFAULT_INVOCATION_TYPE == Constants.QOS.InvocationType.EXACTLY_ONCE)) {
//this is a duplicate message and the invocation type is
// EXACTLY_ONCE.
-
+
//throw new SandeshaException(
// "Duplicate message - Invocation type is EXACTLY_ONCE");
//TODO is this enough
- msgCtx.setPausedTrue(new QName (Constants.IN_HANDLER_NAME));
-
+ msgCtx.setPausedTrue(new QName(Constants.IN_HANDLER_NAME));
+
}
if (messagesStr != "" && messagesStr != null)
@@ -177,7 +177,7 @@
}
} else {
- //TODO Add async Ack
+ //TODO Add async Ack
}
// Pause the messages bean if not the right message to invoke.
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org