You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by ch...@apache.org on 2006/07/19 04:58:35 UTC
svn commit: r423350 [4/8] - in /webservices/sandesha/trunk/java: ./
src/org/apache/sandesha2/ src/org/apache/sandesha2/client/
src/org/apache/sandesha2/handlers/ src/org/apache/sandesha2/i18n/
src/org/apache/sandesha2/msgprocessors/ src/org/apache/sand...
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java Tue Jul 18 19:58:31 2006
@@ -30,6 +30,8 @@
import org.apache.sandesha2.RMMsgContext;
import org.apache.sandesha2.Sandesha2Constants;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.storage.StorageManager;
import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
@@ -56,133 +58,123 @@
*/
public class CreateSeqResponseMsgProcessor implements MsgProcessor {
-
+
private static final Log log = LogFactory.getLog(CreateSeqResponseMsgProcessor.class);
-
- public void processInMessage(RMMsgContext createSeqResponseRMMsgCtx)
- throws SandeshaException {
-
- if (log.isDebugEnabled())
- log.debug("Enter: CreateSeqResponseMsgProcessor::processInMessage");
-
- SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil
- .getSOAPVersion(createSeqResponseRMMsgCtx.getSOAPEnvelope()));
-
- ConfigurationContext configCtx = createSeqResponseRMMsgCtx
- .getMessageContext().getConfigurationContext();
-
- StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configCtx,configCtx.getAxisConfiguration());
-
- //Processing for ack if available
-
+
+ public void processInMessage(RMMsgContext createSeqResponseRMMsgCtx) throws SandeshaException {
+
+ if (log.isDebugEnabled())
+ log.debug("Enter: CreateSeqResponseMsgProcessor::processInMessage");
+
+ SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(createSeqResponseRMMsgCtx
+ .getSOAPEnvelope()));
+
+ ConfigurationContext configCtx = createSeqResponseRMMsgCtx.getMessageContext().getConfigurationContext();
+
+ StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configCtx, configCtx
+ .getAxisConfiguration());
+
+ // Processing for ack if available
+
SequenceAcknowledgement sequenceAck = (SequenceAcknowledgement) createSeqResponseRMMsgCtx
.getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
if (sequenceAck != null) {
AcknowledgementProcessor ackProcessor = new AcknowledgementProcessor();
- //setting message type temporarily as ack message. so that the ack processor would not be confused
+ // setting message type temporarily as ack message. so that the ack
+ // processor would not be confused
int messageType = createSeqResponseRMMsgCtx.getMessageType();
createSeqResponseRMMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK);
-
+
ackProcessor.processInMessage(createSeqResponseRMMsgCtx);
-
- //resetting the correct message type.
+
+ // resetting the correct message type.
createSeqResponseRMMsgCtx.setMessageType(messageType);
}
- //Processing the create sequence response.
-
+ // Processing the create sequence response.
+
CreateSequenceResponse createSeqResponsePart = (CreateSequenceResponse) createSeqResponseRMMsgCtx
.getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ_RESPONSE);
if (createSeqResponsePart == null) {
- String message = "Create Sequence Response part is null";
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noCreateSeqResponse);
log.debug(message);
throw new SandeshaException(message);
}
- String newOutSequenceId = createSeqResponsePart.getIdentifier()
- .getIdentifier();
+ String newOutSequenceId = createSeqResponsePart.getIdentifier().getIdentifier();
if (newOutSequenceId == null) {
- String message = "New sequence Id is null";
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.newSeqIdIsNull);
log.debug(message);
throw new SandeshaException(message);
}
- RelatesTo relatesTo = createSeqResponseRMMsgCtx.getMessageContext()
- .getRelatesTo();
- if (relatesTo==null) {
- String message = "Invalid create sequence message. RelatesTo part is not available";
- log.error("Invalid create sequence response message. RelatesTo part is not available");
- throw new SandeshaException ("Invalid create sequence message. RelatesTo part is not available");
+ RelatesTo relatesTo = createSeqResponseRMMsgCtx.getMessageContext().getRelatesTo();
+ if (relatesTo == null) {
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.relatesToNotAvailable);
+ log.error(message);
+ throw new SandeshaException(message);
}
String createSeqMsgId = relatesTo.getValue();
-
- SenderBeanMgr retransmitterMgr = storageManager
- .getRetransmitterBeanMgr();
+ SenderBeanMgr retransmitterMgr = storageManager.getRetransmitterBeanMgr();
CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
CreateSeqBean createSeqBean = createSeqMgr.retrieve(createSeqMsgId);
if (createSeqBean == null) {
- String message = "Create Sequence entry is not found";
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSeqEntryNotFound);
log.debug(message);
throw new SandeshaException(message);
}
String internalSequenceId = createSeqBean.getInternalSequenceID();
if (internalSequenceId == null || "".equals(internalSequenceId)) {
- String message = "TempSequenceId has is not set";
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.tempSeqIdNotSet);
log.debug(message);
throw new SandeshaException(message);
}
-
+
createSeqBean.setSequenceID(newOutSequenceId);
createSeqMgr.update(createSeqBean);
SenderBean createSequenceSenderBean = retransmitterMgr.retrieve(createSeqMsgId);
- if (createSequenceSenderBean==null)
- throw new SandeshaException ("Create sequence entry is not found");
-
- //removing the Create Sequence Message from the storage
+ if (createSequenceSenderBean == null)
+ throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSeqEntryNotFound));
+
+ // removing the Create Sequence Message from the storage
String createSeqStorageKey = createSequenceSenderBean.getMessageContextRefKey();
storageManager.removeMessageContext(createSeqStorageKey);
-
- //deleting the create sequence entry.
+
+ // deleting the create sequence entry.
retransmitterMgr.delete(createSeqMsgId);
- //storing new out sequence id
- SequencePropertyBeanMgr sequencePropMgr = storageManager
- .getSequencePropertyBeanMgr();
- SequencePropertyBean outSequenceBean = new SequencePropertyBean(
- internalSequenceId, Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID,
- newOutSequenceId);
- SequencePropertyBean internalSequenceBean = new SequencePropertyBean(
- newOutSequenceId,
+ // storing new out sequence id
+ SequencePropertyBeanMgr sequencePropMgr = storageManager.getSequencePropertyBeanMgr();
+ SequencePropertyBean outSequenceBean = new SequencePropertyBean(internalSequenceId,
+ Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID, newOutSequenceId);
+ SequencePropertyBean internalSequenceBean = new SequencePropertyBean(newOutSequenceId,
Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID, internalSequenceId);
-
-
+
sequencePropMgr.insert(outSequenceBean);
sequencePropMgr.insert(internalSequenceBean);
- //processing for accept (offer has been sent)
+ // processing for accept (offer has been sent)
Accept accept = createSeqResponsePart.getAccept();
if (accept != null) {
- //Find offered sequence from internal sequence id.
- SequencePropertyBean offeredSequenceBean = sequencePropMgr
- .retrieve(internalSequenceId,
- Sandesha2Constants.SequenceProperties.OFFERED_SEQUENCE);
+ // Find offered sequence from internal sequence id.
+ SequencePropertyBean offeredSequenceBean = sequencePropMgr.retrieve(internalSequenceId,
+ Sandesha2Constants.SequenceProperties.OFFERED_SEQUENCE);
- //TODO this should be detected in the Fault manager.
+ // TODO this should be detected in the Fault manager.
if (offeredSequenceBean == null) {
- String message = "No offered sequence entry. But an accept was received";
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.accptButNoSequenceOffered);
log.debug(message);
throw new SandeshaException(message);
}
String offeredSequenceId = (String) offeredSequenceBean.getValue();
- EndpointReference acksToEPR = accept.getAcksTo().getAddress()
- .getEpr();
+ EndpointReference acksToEPR = accept.getAcksTo().getAddress().getEpr();
SequencePropertyBean acksToBean = new SequencePropertyBean();
acksToBean.setName(Sandesha2Constants.SequenceProperties.ACKS_TO_EPR);
acksToBean.setSequenceID(offeredSequenceId);
@@ -196,30 +188,29 @@
NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
nextMsgMgr.insert(nextMsgBean);
-
+
String rmSpecVersion = createSeqResponseRMMsgCtx.getRMSpecVersion();
-
- SequencePropertyBean specVersionBean = new SequencePropertyBean (
- offeredSequenceId,Sandesha2Constants.SequenceProperties.RM_SPEC_VERSION,rmSpecVersion);
+
+ SequencePropertyBean specVersionBean = new SequencePropertyBean(offeredSequenceId,
+ Sandesha2Constants.SequenceProperties.RM_SPEC_VERSION, rmSpecVersion);
sequencePropMgr.insert(specVersionBean);
-
- SequencePropertyBean receivedMsgBean = new SequencePropertyBean(
- offeredSequenceId, Sandesha2Constants.SequenceProperties.SERVER_COMPLETED_MESSAGES, "");
+
+ SequencePropertyBean receivedMsgBean = new SequencePropertyBean(offeredSequenceId,
+ Sandesha2Constants.SequenceProperties.SERVER_COMPLETED_MESSAGES, "");
sequencePropMgr.insert(receivedMsgBean);
-
+
SequencePropertyBean msgsBean = new SequencePropertyBean();
msgsBean.setSequenceID(offeredSequenceId);
msgsBean.setName(Sandesha2Constants.SequenceProperties.CLIENT_COMPLETED_MESSAGES);
msgsBean.setValue("");
sequencePropMgr.insert(msgsBean);
-
-
- //setting the addressing version.
+
+ // setting the addressing version.
String addressingNamespace = createSeqResponseRMMsgCtx.getAddressingNamespaceValue();
- SequencePropertyBean addressingVersionBean = new SequencePropertyBean (
- offeredSequenceId,Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE,addressingNamespace);
+ SequencePropertyBean addressingVersionBean = new SequencePropertyBean(offeredSequenceId,
+ Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE, addressingNamespace);
sequencePropMgr.insert(addressingVersionBean);
-
+
}
SenderBean target = new SenderBean();
@@ -231,32 +222,31 @@
while (iterator.hasNext()) {
SenderBean tempBean = (SenderBean) iterator.next();
- //updating the application message
+ // updating the application message
String key = tempBean.getMessageContextRefKey();
- MessageContext applicationMsg = storageManager.retrieveMessageContext(key,configCtx);
+ MessageContext applicationMsg = storageManager.retrieveMessageContext(key, configCtx);
+
+ // TODO make following exception message more understandable to the
+ // user (probably some others exceptions messages as well)
+ if (applicationMsg == null)
+ throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.unavailableAppMsg));
+
+ String rmVersion = SandeshaUtil.getRMVersion(internalSequenceId, storageManager);
+ if (rmVersion == null)
+ throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotDecideRMVersion));
- //TODO make following exception message more understandable to the user (probably some others exceptions messages as well)
- if (applicationMsg==null)
- throw new SandeshaException ("Unavailable application message");
-
- String rmVersion = SandeshaUtil.getRMVersion(internalSequenceId,storageManager);
- if (rmVersion==null)
- throw new SandeshaException ("Cant find the rmVersion of the given message");
-
String assumedRMNamespace = SpecSpecificConstants.getRMNamespaceValue(rmVersion);
-
- RMMsgContext applicaionRMMsg = MsgInitializer
- .initializeMessage(applicationMsg);
- Sequence sequencePart = (Sequence) applicaionRMMsg
- .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
+ RMMsgContext applicaionRMMsg = MsgInitializer.initializeMessage(applicationMsg);
+
+ Sequence sequencePart = (Sequence) applicaionRMMsg.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
if (sequencePart == null) {
- String message = "Sequence part is null";
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.seqPartIsNull);
log.debug(message);
throw new SandeshaException(message);
}
-
- Identifier identifier = new Identifier(factory,assumedRMNamespace);
+
+ Identifier identifier = new Identifier(factory, assumedRMNamespace);
identifier.setIndentifer(newOutSequenceId);
sequencePart.setIdentifier(identifier);
@@ -264,7 +254,7 @@
AckRequested ackRequestedPart = (AckRequested) applicaionRMMsg
.getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
if (ackRequestedPart != null) {
- Identifier id1 = new Identifier(factory,assumedRMNamespace);
+ Identifier id1 = new Identifier(factory, assumedRMNamespace);
id1.setIndentifer(newOutSequenceId);
ackRequestedPart.setIdentifier(id1);
}
@@ -274,33 +264,31 @@
} catch (AxisFault e) {
throw new SandeshaException(e.getMessage());
}
-
- //asking to send the application msssage
+
+ // asking to send the application msssage
tempBean.setSend(true);
retransmitterMgr.update(tempBean);
-
- //updating the message. this will correct the SOAP envelope string.
- storageManager.updateMessageContext(key,applicationMsg);
+
+ // updating the message. this will correct the SOAP envelope string.
+ storageManager.updateMessageContext(key, applicationMsg);
}
-
- SequenceManager.updateLastActivatedTime(internalSequenceId,storageManager);
-
- createSeqResponseRMMsgCtx.getMessageContext().getOperationContext()
- .setProperty(org.apache.axis2.Constants.RESPONSE_WRITTEN,
- "false");
+
+ SequenceManager.updateLastActivatedTime(internalSequenceId, storageManager);
+
+ createSeqResponseRMMsgCtx.getMessageContext().getOperationContext().setProperty(
+ org.apache.axis2.Constants.RESPONSE_WRITTEN, "false");
createSeqResponseRMMsgCtx.pause();
-
- if (log.isDebugEnabled())
- log.debug("Exit: CreateSeqResponseMsgProcessor::processInMessage");
+
+ if (log.isDebugEnabled())
+ log.debug("Exit: CreateSeqResponseMsgProcessor::processInMessage");
}
-
+
public void processOutMessage(RMMsgContext rmMsgCtx) throws SandeshaException {
- if (log.isDebugEnabled())
- {
- log.debug("Enter: CreateSeqResponseMsgProcessor::processOutMessage");
- log.debug("Exit: CreateSeqResponseMsgProcessor::processOutMessage");
- }
+ if (log.isDebugEnabled()) {
+ log.debug("Enter: CreateSeqResponseMsgProcessor::processOutMessage");
+ log.debug("Exit: CreateSeqResponseMsgProcessor::processOutMessage");
+ }
}
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/MsgProcessorFactory.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/MsgProcessorFactory.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/MsgProcessorFactory.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/MsgProcessorFactory.java Tue Jul 18 19:58:31 2006
@@ -27,9 +27,9 @@
public class MsgProcessorFactory {
public static MsgProcessor getMessageProcessor(RMMsgContext rmMessageContext) {
-
+
int messageType = rmMessageContext.getMessageType();
-
+
switch (messageType) {
case (Sandesha2Constants.MessageTypes.CREATE_SEQ):
return new CreateSeqMsgProcessor();
@@ -44,9 +44,9 @@
case (Sandesha2Constants.MessageTypes.ACK):
return new AcknowledgementProcessor();
case (Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE):
- return new CloseSequenceProcessor ();
+ return new CloseSequenceProcessor();
case (Sandesha2Constants.MessageTypes.ACK_REQUEST):
- return new AckRequestedProcessor ();
+ return new AckRequestedProcessor();
default:
return null;
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java Tue Jul 18 19:58:31 2006
@@ -39,6 +39,8 @@
import org.apache.sandesha2.Sandesha2Constants;
import org.apache.sandesha2.SandeshaException;
import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.storage.StorageManager;
import org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
@@ -64,308 +66,332 @@
public class TerminateSeqMsgProcessor implements MsgProcessor {
private static final Log log = LogFactory.getLog(TerminateSeqMsgProcessor.class);
-
- public void processInMessage(RMMsgContext terminateSeqRMMsg)
- throws SandeshaException {
-
- if (log.isDebugEnabled())
- log.debug("Enter: TerminateSeqMsgProcessor::processInMessage");
+
+ public void processInMessage(RMMsgContext terminateSeqRMMsg) throws SandeshaException {
+
+ if (log.isDebugEnabled())
+ log.debug("Enter: TerminateSeqMsgProcessor::processInMessage");
MessageContext terminateSeqMsg = terminateSeqRMMsg.getMessageContext();
- //Processing for ack if any
+ // Processing for ack if any
SequenceAcknowledgement sequenceAck = (SequenceAcknowledgement) terminateSeqRMMsg
.getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
if (sequenceAck != null) {
AcknowledgementProcessor ackProcessor = new AcknowledgementProcessor();
- //setting message type temporarily as ack message. so that the ack processor would not be confused
+ // setting message type temporarily as ack message. so that the ack
+ // processor would not be confused
int messageType = terminateSeqRMMsg.getMessageType();
terminateSeqRMMsg.setMessageType(Sandesha2Constants.MessageTypes.ACK);
-
+
ackProcessor.processInMessage(terminateSeqRMMsg);
-
- //resetting the correct message type.
+
+ // resetting the correct message type.
terminateSeqRMMsg.setMessageType(messageType);
}
-
- //Processing the terminate message
- //TODO Add terminate sequence message logic.
- TerminateSequence terminateSequence = (TerminateSequence) terminateSeqRMMsg.getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
- if (terminateSequence==null) {
- String message = "Terminate Sequence part is not available";
+
+ // Processing the terminate message
+ // TODO Add terminate sequence message logic.
+ TerminateSequence terminateSequence = (TerminateSequence) terminateSeqRMMsg
+ .getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
+ if (terminateSequence == null) {
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noTerminateSeqPart);
log.debug(message);
- throw new SandeshaException (message);
+ throw new SandeshaException(message);
}
-
+
String sequenceId = terminateSequence.getIdentifier().getIdentifier();
- if (sequenceId==null || "".equals(sequenceId)) {
- String message = "Invalid sequence id";
+ if (sequenceId == null || "".equals(sequenceId)) {
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.invalidSequenceID, null);
log.debug(message);
- throw new SandeshaException (message);
+ throw new SandeshaException(message);
}
-
+
ConfigurationContext context = terminateSeqMsg.getConfigurationContext();
- StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context,context.getAxisConfiguration());
-
+ StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context, context.getAxisConfiguration());
+
FaultManager faultManager = new FaultManager();
- RMMsgContext faultMessageContext = faultManager.checkForUnknownSequence(terminateSeqRMMsg,sequenceId,storageManager);
+ RMMsgContext faultMessageContext = faultManager.checkForUnknownSequence(terminateSeqRMMsg, sequenceId,
+ storageManager);
if (faultMessageContext != null) {
ConfigurationContext configurationContext = terminateSeqMsg.getConfigurationContext();
AxisEngine engine = new AxisEngine(configurationContext);
-
+
try {
engine.sendFault(faultMessageContext.getMessageContext());
} catch (AxisFault e) {
- throw new SandeshaException ("Could not send the fault message",e);
+ throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.couldNotSendFault, e
+ .toString()), e);
}
-
+
terminateSeqMsg.pause();
return;
}
-
SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();
- SequencePropertyBean terminateReceivedBean = new SequencePropertyBean ();
+ SequencePropertyBean terminateReceivedBean = new SequencePropertyBean();
terminateReceivedBean.setSequenceID(sequenceId);
terminateReceivedBean.setName(Sandesha2Constants.SequenceProperties.TERMINATE_RECEIVED);
terminateReceivedBean.setValue("true");
-
+
sequencePropertyBeanMgr.insert(terminateReceivedBean);
-
- //add the terminate sequence response if required.
- if (SpecSpecificConstants.isTerminateSequenceResponseRequired (terminateSeqRMMsg.getRMSpecVersion()))
- addTerminateSequenceResponse (terminateSeqRMMsg,sequenceId,storageManager);
-
- setUpHighestMsgNumbers(context,storageManager,sequenceId,terminateSeqRMMsg);
-
- TerminateManager.cleanReceivingSideOnTerminateMessage(context,sequenceId,storageManager);
-
-
- SequencePropertyBean terminatedBean = new SequencePropertyBean (
- sequenceId,Sandesha2Constants.SequenceProperties.SEQUENCE_TERMINATED,Sandesha2Constants.VALUE_TRUE);
-
+
+ // add the terminate sequence response if required.
+ if (SpecSpecificConstants.isTerminateSequenceResponseRequired(terminateSeqRMMsg.getRMSpecVersion()))
+ addTerminateSequenceResponse(terminateSeqRMMsg, sequenceId, storageManager);
+
+ setUpHighestMsgNumbers(context, storageManager, sequenceId, terminateSeqRMMsg);
+
+ TerminateManager.cleanReceivingSideOnTerminateMessage(context, sequenceId, storageManager);
+
+ SequencePropertyBean terminatedBean = new SequencePropertyBean(sequenceId,
+ Sandesha2Constants.SequenceProperties.SEQUENCE_TERMINATED, Sandesha2Constants.VALUE_TRUE);
+
sequencePropertyBeanMgr.insert(terminatedBean);
-
-
- //removing an entry from the listener
+
+ // removing an entry from the listener
String transport = terminateSeqMsg.getTransportIn().getName().getLocalPart();
-
- SequenceManager.updateLastActivatedTime(sequenceId,storageManager);
-
+
+ SequenceManager.updateLastActivatedTime(sequenceId, storageManager);
+
terminateSeqMsg.pause();
-
- if (log.isDebugEnabled())
- log.debug("Exit: TerminateSeqMsgProcessor::processInMessage");
+
+ if (log.isDebugEnabled())
+ log.debug("Exit: TerminateSeqMsgProcessor::processInMessage");
}
- private void setUpHighestMsgNumbers (ConfigurationContext configCtx, StorageManager storageManager, String sequenceID, RMMsgContext terminateRMMsg) throws SandeshaException {
+ private void setUpHighestMsgNumbers(ConfigurationContext configCtx, StorageManager storageManager,
+ String sequenceID, RMMsgContext terminateRMMsg) throws SandeshaException {
+
+ if (log.isDebugEnabled())
+ log.debug("Enter: TerminateSeqMsgProcessor::setUpHighestMsgNumbers, " + sequenceID);
- if (log.isDebugEnabled())
- log.debug("Enter: TerminateSeqMsgProcessor::setUpHighestMsgNumbers, "+sequenceID);
-
SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
-
- String highestImMsgNumberStr = SandeshaUtil.getSequenceProperty(sequenceID,Sandesha2Constants.SequenceProperties.HIGHEST_IN_MSG_NUMBER,storageManager);
- String highestImMsgKey = SandeshaUtil.getSequenceProperty(sequenceID,Sandesha2Constants.SequenceProperties.HIGHEST_IN_MSG_KEY,storageManager);
-
+
+ String highestImMsgNumberStr = SandeshaUtil.getSequenceProperty(sequenceID,
+ Sandesha2Constants.SequenceProperties.HIGHEST_IN_MSG_NUMBER, storageManager);
+ String highestImMsgKey = SandeshaUtil.getSequenceProperty(sequenceID,
+ Sandesha2Constants.SequenceProperties.HIGHEST_IN_MSG_KEY, storageManager);
+
long highestInMsgNo = 0;
- if (highestImMsgNumberStr!=null) {
- if (highestImMsgKey==null)
- throw new SandeshaException ("Key of the highest message number has not been stored");
-
+ if (highestImMsgNumberStr != null) {
+ if (highestImMsgKey == null)
+ throw new SandeshaException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.highestMsgKeyNotStored, sequenceID));
+
highestInMsgNo = Long.parseLong(highestImMsgNumberStr);
}
-
- //following will be valid only for the server side, since the obtained int. seq ID is only valid there.
+
+ // following will be valid only for the server side, since the obtained
+ // int. seq ID is only valid there.
String responseSideInternalSequenceID = SandeshaUtil.getOutgoingSideInternalSequenceID(sequenceID);
-
+
long highestOutMsgNo = 0;
try {
boolean addResponseSideTerminate = false;
- if (highestInMsgNo==0) {
- addResponseSideTerminate=false;
+ if (highestInMsgNo == 0) {
+ addResponseSideTerminate = false;
} else {
-
- //setting the last in message property
- SequencePropertyBean lastInMsgBean = new SequencePropertyBean (
- sequenceID,Sandesha2Constants.SequenceProperties.LAST_IN_MESSAGE_NO,highestImMsgNumberStr);
+
+ // setting the last in message property
+ SequencePropertyBean lastInMsgBean = new SequencePropertyBean(sequenceID,
+ Sandesha2Constants.SequenceProperties.LAST_IN_MESSAGE_NO, highestImMsgNumberStr);
seqPropMgr.insert(lastInMsgBean);
-
- MessageContext highestInMsg = storageManager.retrieveMessageContext(highestImMsgKey,configCtx);
-
- //TODO get the out message in a storage friendly manner.
- MessageContext highestOutMessage = highestInMsg.getOperationContext().getMessageContext(OperationContextFactory.MESSAGE_LABEL_FAULT_VALUE);
-
- if (highestOutMessage==null || highestOutMessage.getEnvelope()==null)
- highestOutMessage = highestInMsg.getOperationContext().getMessageContext(OperationContextFactory.MESSAGE_LABEL_OUT_VALUE);
-
- if (highestOutMessage!=null) {
- if (highestOutMessage.getEnvelope()==null)
- throw new SandeshaException ("Out message does not have a envelope");
-
+
+ MessageContext highestInMsg = storageManager.retrieveMessageContext(highestImMsgKey, configCtx);
+
+ // TODO get the out message in a storage friendly manner.
+ MessageContext highestOutMessage = highestInMsg.getOperationContext().getMessageContext(
+ OperationContextFactory.MESSAGE_LABEL_FAULT_VALUE);
+
+ if (highestOutMessage == null || highestOutMessage.getEnvelope() == null)
+ highestOutMessage = highestInMsg.getOperationContext().getMessageContext(
+ OperationContextFactory.MESSAGE_LABEL_OUT_VALUE);
+
+ if (highestOutMessage != null) {
+ if (highestOutMessage.getEnvelope() == null)
+ throw new SandeshaException(SandeshaMessageHelper
+ .getMessage(SandeshaMessageKeys.outMsgHasNoEnvelope));
+
RMMsgContext highestOutRMMsg = MsgInitializer.initializeMessage(highestOutMessage);
- Sequence seqPartOfOutMsg = (Sequence) highestOutRMMsg.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
-
- if (seqPartOfOutMsg!=null) {
-
- //response message of the last in message can be considered as the last out message.
+ Sequence seqPartOfOutMsg = (Sequence) highestOutRMMsg
+ .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
+
+ if (seqPartOfOutMsg != null) {
+
+ // response message of the last in message can be
+ // considered as the last out message.
highestOutMsgNo = seqPartOfOutMsg.getMessageNumber().getMessageNumber();
- SequencePropertyBean highestOutMsgBean = new SequencePropertyBean (
+ SequencePropertyBean highestOutMsgBean = new SequencePropertyBean(
responseSideInternalSequenceID,
- Sandesha2Constants.SequenceProperties.LAST_OUT_MESSAGE_NO,
- new Long(highestOutMsgNo).toString() );
-
+ Sandesha2Constants.SequenceProperties.LAST_OUT_MESSAGE_NO, new Long(highestOutMsgNo)
+ .toString());
+
seqPropMgr.insert(highestOutMsgBean);
addResponseSideTerminate = true;
}
}
}
-
- // If all the out message have been acked, add the outgoing terminate seq msg.
- String outgoingSqunceID = SandeshaUtil.getSequenceProperty(responseSideInternalSequenceID,Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID,storageManager);
- if (addResponseSideTerminate && highestOutMsgNo>0
- && responseSideInternalSequenceID!=null && outgoingSqunceID!=null ) {
- boolean allAcked = SandeshaUtil.isAllMsgsAckedUpto (highestOutMsgNo, responseSideInternalSequenceID, storageManager);
-
- if (allAcked)
- TerminateManager.addTerminateSequenceMessage(terminateRMMsg, outgoingSqunceID,responseSideInternalSequenceID,storageManager);
+
+ // If all the out message have been acked, add the outgoing
+ // terminate seq msg.
+ String outgoingSqunceID = SandeshaUtil.getSequenceProperty(responseSideInternalSequenceID,
+ Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID, storageManager);
+ if (addResponseSideTerminate && highestOutMsgNo > 0 && responseSideInternalSequenceID != null
+ && outgoingSqunceID != null) {
+ boolean allAcked = SandeshaUtil.isAllMsgsAckedUpto(highestOutMsgNo, responseSideInternalSequenceID,
+ storageManager);
+
+ if (allAcked)
+ TerminateManager.addTerminateSequenceMessage(terminateRMMsg, outgoingSqunceID,
+ responseSideInternalSequenceID, storageManager);
}
} catch (AxisFault e) {
- throw new SandeshaException (e);
+ throw new SandeshaException(e);
}
- if (log.isDebugEnabled())
- log.debug("Exit: TerminateSeqMsgProcessor::setUpHighestMsgNumbers");
+ if (log.isDebugEnabled())
+ log.debug("Exit: TerminateSeqMsgProcessor::setUpHighestMsgNumbers");
}
-
- private void addTerminateSequenceResponse (RMMsgContext terminateSeqRMMsg, String sequenceID, StorageManager storageManager) throws SandeshaException {
-
- if (log.isDebugEnabled())
- log.debug("Enter: TerminateSeqMsgProcessor::addTerminateSequenceResponse, " + sequenceID);
- MessageContext terminateSeqMsg = terminateSeqRMMsg.getMessageContext();
+ private void addTerminateSequenceResponse(RMMsgContext terminateSeqRMMsg, String sequenceID,
+ StorageManager storageManager) throws SandeshaException {
+
+ if (log.isDebugEnabled())
+ log.debug("Enter: TerminateSeqMsgProcessor::addTerminateSequenceResponse, " + sequenceID);
+
+ MessageContext terminateSeqMsg = terminateSeqRMMsg.getMessageContext();
ConfigurationContext configCtx = terminateSeqMsg.getConfigurationContext();
-
+
MessageContext outMessage = null;
-
+
try {
outMessage = Utils.createOutMessageContext(terminateSeqMsg);
} catch (AxisFault e1) {
- throw new SandeshaException (e1);
+ throw new SandeshaException(e1);
}
-
- RMMsgContext terminateSeqResponseRMMsg = RMMsgCreator
- .createTerminateSeqResponseMsg(terminateSeqRMMsg, outMessage,storageManager);
-
- RMMsgContext ackRMMessage = AcknowledgementManager.generateAckMessage(terminateSeqRMMsg,sequenceID,storageManager);
- SequenceAcknowledgement seqAck = (SequenceAcknowledgement) ackRMMessage.getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
- terminateSeqResponseRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT,seqAck);
-
- terminateSeqResponseRMMsg.addSOAPEnvelope();
-
-
+
+ RMMsgContext terminateSeqResponseRMMsg = RMMsgCreator.createTerminateSeqResponseMsg(terminateSeqRMMsg,
+ outMessage, storageManager);
+
+ RMMsgContext ackRMMessage = AcknowledgementManager.generateAckMessage(terminateSeqRMMsg, sequenceID,
+ storageManager);
+ SequenceAcknowledgement seqAck = (SequenceAcknowledgement) ackRMMessage
+ .getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
+ terminateSeqResponseRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT, seqAck);
+
+ terminateSeqResponseRMMsg.addSOAPEnvelope();
+
terminateSeqResponseRMMsg.setFlow(MessageContext.OUT_FLOW);
- terminateSeqResponseRMMsg.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE,"true");
+ terminateSeqResponseRMMsg.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
outMessage.setResponseWritten(true);
-
- AxisEngine engine = new AxisEngine (terminateSeqMsg.getConfigurationContext());
-
+
+ AxisEngine engine = new AxisEngine(terminateSeqMsg.getConfigurationContext());
+
EndpointReference toEPR = terminateSeqMsg.getTo();
-
+
try {
engine.send(outMessage);
} catch (AxisFault e) {
- String message = "Could not send the terminate sequence response";
- throw new SandeshaException (message,e);
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.couldNotSendTerminateResponse, e
+ .toString());
+ throw new SandeshaException(message, e);
}
-
- String addressingNamespaceURI = SandeshaUtil.getSequenceProperty(sequenceID,Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE,storageManager);
+
+ String addressingNamespaceURI = SandeshaUtil.getSequenceProperty(sequenceID,
+ Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE, storageManager);
String anonymousURI = SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespaceURI);
-
- if (anonymousURI.equals(
- toEPR.getAddress())) {
+
+ if (anonymousURI.equals(toEPR.getAddress())) {
terminateSeqMsg.getOperationContext().setProperty(org.apache.axis2.Constants.RESPONSE_WRITTEN, "true");
} else {
terminateSeqMsg.getOperationContext().setProperty(org.apache.axis2.Constants.RESPONSE_WRITTEN, "false");
}
-
- if (log.isDebugEnabled())
- log.debug("Exit: TerminateSeqMsgProcessor::addTerminateSequenceResponse");
+
+ if (log.isDebugEnabled())
+ log.debug("Exit: TerminateSeqMsgProcessor::addTerminateSequenceResponse");
}
-
+
public void processOutMessage(RMMsgContext rmMsgCtx) throws SandeshaException {
- if (log.isDebugEnabled())
- log.debug("Enter: TerminateSeqMsgProcessor::processOutMessage");
+ if (log.isDebugEnabled())
+ log.debug("Enter: TerminateSeqMsgProcessor::processOutMessage");
MessageContext msgContext = rmMsgCtx.getMessageContext();
ConfigurationContext configurationContext = msgContext.getConfigurationContext();
Options options = msgContext.getOptions();
-
- StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
-
+
+ StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,
+ configurationContext.getAxisConfiguration());
+
SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
-
+
String toAddress = rmMsgCtx.getTo().getAddress();
String sequenceKey = (String) options.getProperty(SandeshaClientConstants.SEQUENCE_KEY);
- String internalSeqenceID = SandeshaUtil.getInternalSequenceID(toAddress,sequenceKey);
-
- String outSequenceID = SandeshaUtil.getSequenceProperty(internalSeqenceID,Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID,storageManager);
- if (outSequenceID==null)
- throw new SandeshaException ("SequenceID was not found. Cannot send the terminate message");
-
-/// Transaction addTerminateSeqTransaction = storageManager.getTransaction();
-
+ String internalSeqenceID = SandeshaUtil.getInternalSequenceID(toAddress, sequenceKey);
+
+ String outSequenceID = SandeshaUtil.getSequenceProperty(internalSeqenceID,
+ Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID, storageManager);
+ if (outSequenceID == null)
+ throw new SandeshaException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.couldNotSendTerminateSeqNotFound, internalSeqenceID));
+
+ // / Transaction addTerminateSeqTransaction =
+ // storageManager.getTransaction();
+
String terminated = SandeshaUtil.getSequenceProperty(outSequenceID,
- Sandesha2Constants.SequenceProperties.TERMINATE_ADDED,storageManager);
-
-
- //registring an InOutOperationContext for this.
- //since the serviceContext.fireAndForget only sets a inOnly One
- //this does not work when there is a terminateSequnceResponse
- //TODO do processing of terminateMessagesCorrectly., create a new message instead of sendign the one given by the serviceClient
- //TODO important
+ Sandesha2Constants.SequenceProperties.TERMINATE_ADDED, storageManager);
+
+ // registring an InOutOperationContext for this.
+ // since the serviceContext.fireAndForget only sets a inOnly One
+ // this does not work when there is a terminateSequnceResponse
+ // TODO do processing of terminateMessagesCorrectly., create a new
+ // message instead of sendign the one given by the serviceClient
+ // TODO important
try {
AxisOperation oldOPeration = msgContext.getAxisOperation();
- AxisOperation outInAxisOp = new OutInAxisOperation (new QName ("temp"));
- //setting flows
+ AxisOperation outInAxisOp = new OutInAxisOperation(new QName("temp"));
+ // setting flows
outInAxisOp.setRemainingPhasesInFlow(oldOPeration.getRemainingPhasesInFlow());
-
- OperationContext opcontext = OperationContextFactory.createOperationContext(WSDL20_2004Constants.MEP_CONSTANT_OUT_IN,outInAxisOp);
- opcontext.setParent(msgContext.getServiceContext());
- configurationContext.registerOperationContext(rmMsgCtx.getMessageId(),opcontext);
+
+ OperationContext opcontext = OperationContextFactory.createOperationContext(
+ WSDL20_2004Constants.MEP_CONSTANT_OUT_IN, outInAxisOp);
+ opcontext.setParent(msgContext.getServiceContext());
+ configurationContext.registerOperationContext(rmMsgCtx.getMessageId(), opcontext);
} catch (AxisFault e1) {
- throw new SandeshaException ("Could not register an outInAxisOperation");
+ throw new SandeshaException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.axisOperationRegisterError, e1.toString()));
}
-
- if (terminated != null
- && "true".equals(terminated)) {
- String message = "Terminate was added previously.";
+
+ if (terminated != null && "true".equals(terminated)) {
+ String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.terminateAddedPreviously);
log.debug(message);
return;
}
- TerminateSequence terminateSequencePart = (TerminateSequence) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
+ TerminateSequence terminateSequencePart = (TerminateSequence) rmMsgCtx
+ .getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
terminateSequencePart.getIdentifier().setIndentifer(outSequenceID);
-
+
rmMsgCtx.setFlow(MessageContext.OUT_FLOW);
- msgContext.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE,"true");
-
+ msgContext.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
+
rmMsgCtx.setTo(new EndpointReference(toAddress));
-
- String rmVersion = SandeshaUtil.getRMVersion(internalSeqenceID,storageManager);
- if (rmVersion==null)
- throw new SandeshaException ("Cant find the rmVersion of the given message");
-
+
+ String rmVersion = SandeshaUtil.getRMVersion(internalSeqenceID, storageManager);
+ if (rmVersion == null)
+ throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotDecideRMVersion));
+
rmMsgCtx.setWSAAction(SpecSpecificConstants.getTerminateSequenceAction(rmVersion));
rmMsgCtx.setSOAPAction(SpecSpecificConstants.getTerminateSequenceSOAPAction(rmVersion));
- String transportTo = SandeshaUtil.getSequenceProperty(internalSeqenceID,Sandesha2Constants.SequenceProperties.TRANSPORT_TO,storageManager);
- if (transportTo!=null) {
- rmMsgCtx.setProperty(MessageContextConstants.TRANSPORT_URL,transportTo);
+ String transportTo = SandeshaUtil.getSequenceProperty(internalSeqenceID,
+ Sandesha2Constants.SequenceProperties.TRANSPORT_TO, storageManager);
+ if (transportTo != null) {
+ rmMsgCtx.setProperty(MessageContextConstants.TRANSPORT_URL, transportTo);
}
-
+
try {
rmMsgCtx.addSOAPEnvelope();
} catch (AxisFault e) {
@@ -373,61 +399,55 @@
}
String key = SandeshaUtil.getUUID();
-
+
SenderBean terminateBean = new SenderBean();
terminateBean.setMessageContextRefKey(key);
-
- storageManager.storeMessageContext(key,msgContext);
+ storageManager.storeMessageContext(key, msgContext);
-
- //Set a retransmitter lastSentTime so that terminate will be send with
+ // Set a retransmitter lastSentTime so that terminate will be send with
// some delay.
- //Otherwise this get send before return of the current request (ack).
- //TODO: refine the terminate delay.
- terminateBean.setTimeToSend(System.currentTimeMillis()
- + Sandesha2Constants.TERMINATE_DELAY);
+ // Otherwise this get send before return of the current request (ack).
+ // TODO: refine the terminate delay.
+ terminateBean.setTimeToSend(System.currentTimeMillis() + Sandesha2Constants.TERMINATE_DELAY);
terminateBean.setMessageID(msgContext.getMessageID());
-
- //this will be set to true at the sender.
+
+ // this will be set to true at the sender.
terminateBean.setSend(true);
-
- msgContext.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING,
- Sandesha2Constants.VALUE_FALSE);
-
+
+ msgContext.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING, Sandesha2Constants.VALUE_FALSE);
+
terminateBean.setReSend(false);
- SenderBeanMgr retramsmitterMgr = storageManager
- .getRetransmitterBeanMgr();
+ SenderBeanMgr retramsmitterMgr = storageManager.getRetransmitterBeanMgr();
retramsmitterMgr.insert(terminateBean);
-
+
SequencePropertyBean terminateAdded = new SequencePropertyBean();
terminateAdded.setName(Sandesha2Constants.SequenceProperties.TERMINATE_ADDED);
terminateAdded.setSequenceID(outSequenceID);
terminateAdded.setValue("true");
-
seqPropMgr.insert(terminateAdded);
-
- //This should be dumped to the storage by the sender
+
+ // This should be dumped to the storage by the sender
TransportOutDescription transportOut = msgContext.getTransportOut();
- rmMsgCtx.setProperty(Sandesha2Constants.ORIGINAL_TRANSPORT_OUT_DESC,transportOut);
- rmMsgCtx.setProperty(Sandesha2Constants.MESSAGE_STORE_KEY,key);
- rmMsgCtx.setProperty(Sandesha2Constants.SET_SEND_TO_TRUE,Sandesha2Constants.VALUE_TRUE);
- rmMsgCtx.getMessageContext().setTransportOut(new Sandesha2TransportOutDesc ());
-/// addTerminateSeqTransaction.commit();
-
- AxisEngine engine = new AxisEngine (configurationContext);
- try {
+ rmMsgCtx.setProperty(Sandesha2Constants.ORIGINAL_TRANSPORT_OUT_DESC, transportOut);
+ rmMsgCtx.setProperty(Sandesha2Constants.MESSAGE_STORE_KEY, key);
+ rmMsgCtx.setProperty(Sandesha2Constants.SET_SEND_TO_TRUE, Sandesha2Constants.VALUE_TRUE);
+ rmMsgCtx.getMessageContext().setTransportOut(new Sandesha2TransportOutDesc());
+ // / addTerminateSeqTransaction.commit();
+
+ AxisEngine engine = new AxisEngine(configurationContext);
+ try {
engine.send(msgContext);
} catch (AxisFault e) {
- throw new SandeshaException (e.getMessage());
+ throw new SandeshaException(e.getMessage());
}
-
- if (log.isDebugEnabled())
- log.debug("Exit: TerminateSeqMsgProcessor::processOutMessage");
+
+ if (log.isDebugEnabled())
+ log.debug("Exit: TerminateSeqMsgProcessor::processOutMessage");
}
-
+
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqResponseMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqResponseMsgProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqResponseMsgProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqResponseMsgProcessor.java Tue Jul 18 19:58:31 2006
@@ -28,17 +28,15 @@
public class TerminateSeqResponseMsgProcessor implements MsgProcessor {
private static final Log log = LogFactory.getLog(TerminateSeqResponseMsgProcessor.class);
-
- public void processInMessage(RMMsgContext terminateResRMMsg)
- throws SandeshaException {
-
-
- //TODO add processing logic
-
+
+ public void processInMessage(RMMsgContext terminateResRMMsg) throws SandeshaException {
+
+ // TODO add processing logic
+
terminateResRMMsg.pause();
}
-
+
public void processOutMessage(RMMsgContext rmMsgCtx) throws SandeshaException {
-
+
}
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/RMPolicyProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/RMPolicyProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/RMPolicyProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/RMPolicyProcessor.java Tue Jul 18 19:58:31 2006
@@ -23,6 +23,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.policy.processors.AcknowledgementIntervalProcessor;
import org.apache.sandesha2.policy.processors.ExponentialBackoffProcessor;
import org.apache.sandesha2.policy.processors.InactivityTimeoutMeasureProcessor;
@@ -233,8 +235,9 @@
RMPolicyToken currentToken = rmProcessorContext
.readCurrentRMToken();
if (currentToken == null) {
- logger.error("Internal error on token stack - No current token");
- System.exit(1);
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.errorOnTokenStack));
+ System.exit(1);
}
rmpt = currentToken.getChildToken(tokenName);
rmProcessorContext.pushRMToken(rmpt);
@@ -261,7 +264,8 @@
try {
ret = rmpt.invokeProcessTokenMethod(rmProcessorContext);
} catch (Exception ex) {
- logger.error("Exception occured when invoking processTokenMethod",
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.generalError, ex.toString()),
ex);
} finally {
rmProcessorContext.setAction(RMProcessorContext.NONE);
@@ -273,8 +277,9 @@
RMPolicyToken currentToken = rmProcessorContext
.readCurrentRMToken();
if (currentToken == null) {
- logger.debug("Abort transaction because of unknown token: '"
- + pa.getName().getLocalPart() + "'");
+ logger.debug(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownTokenAbortTran,
+ pa.getName().getLocalPart()));
rmProcessorContext.popRMToken();
return;
@@ -286,7 +291,8 @@
currentToken.invokeProcessTokenMethod(rmProcessorContext);
} catch (Exception ex) {
- logger.error("Exception occured when invoking processTokenMethod:",
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.processTokenMethodError, ex.toString()),
ex);
} finally {
@@ -301,8 +307,9 @@
RMPolicyToken currentToken = rmProcessorContext
.readCurrentRMToken();
if (currentToken == null) {
- logger.error("Internal error on token stack - Commiting an unknown token: "
- + pa.getName().getLocalPart() + "'");
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.commitingUnknownToken,
+ pa.getName().getLocalPart()));
System.exit(1);
}
rmProcessorContext.setAssertion(pa);
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/AcknowledgementIntervalProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/AcknowledgementIntervalProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/AcknowledgementIntervalProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/AcknowledgementIntervalProcessor.java Tue Jul 18 19:58:31 2006
@@ -19,6 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.policy.PolicyEngineData;
import org.apache.sandesha2.policy.RMPolicyToken;
import org.apache.sandesha2.policy.RMProcessorContext;
@@ -45,7 +47,10 @@
initializeAcknowledgementIterval(rmpt);
initializedAcknowledgementInterval = true;
} catch (NoSuchMethodException e) {
- logger.error("AcknowledgementIntervalProcessor:doAcknowledgementInterval", e);
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.policyProcessingException,
+ e.toString(),
+ "AcknowledgementInterval"), e);
return new Boolean(false);
}
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/ExponentialBackoffProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/ExponentialBackoffProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/ExponentialBackoffProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/ExponentialBackoffProcessor.java Tue Jul 18 19:58:31 2006
@@ -19,6 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.policy.PolicyEngineData;
import org.apache.sandesha2.policy.RMPolicyToken;
import org.apache.sandesha2.policy.RMProcessorContext;
@@ -45,7 +47,10 @@
initializeExponentialBackoff(rmpt);
initializedExponentialBackoff = true;
} catch (NoSuchMethodException e) {
- logger.error("Exception occured when invoking processTokenMethod", e);
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.policyProcessingException,
+ e.toString(),
+ "ExponentialBackoff"), e);
return new Boolean(false);
}
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InactivityTimeoutMeasureProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InactivityTimeoutMeasureProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InactivityTimeoutMeasureProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InactivityTimeoutMeasureProcessor.java Tue Jul 18 19:58:31 2006
@@ -19,6 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.policy.PolicyEngineData;
import org.apache.sandesha2.policy.RMPolicyToken;
import org.apache.sandesha2.policy.RMProcessorContext;
@@ -42,7 +44,10 @@
initializeInactivityTimeoutMeasure(rmpt);
initializedInactivityTimeoutMeasure = true;
} catch (NoSuchMethodException e) {
- logger.error("Exception occured when initializeInactivityTimeoutMeasure", e);
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.policyProcessingException,
+ e.toString(),
+ "InactivityTimeoutMeasure"), e);
return new Boolean(false);
}
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InactivityTimeoutProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InactivityTimeoutProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InactivityTimeoutProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InactivityTimeoutProcessor.java Tue Jul 18 19:58:31 2006
@@ -19,6 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.policy.PolicyEngineData;
import org.apache.sandesha2.policy.RMPolicyToken;
import org.apache.sandesha2.policy.RMProcessorContext;
@@ -44,7 +46,10 @@
initializeInactivityTimeout(rmpt);
initializedInactivityTimeout = true;
} catch (NoSuchMethodException e) {
- logger.error("Exception occured in initializeInactivityTimeout", e);
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.policyProcessingException,
+ e.toString(),
+ "InactivityTimeout"), e);
return new Boolean(false);
}
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InvokeInOrderProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InvokeInOrderProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InvokeInOrderProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/InvokeInOrderProcessor.java Tue Jul 18 19:58:31 2006
@@ -19,6 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.policy.PolicyEngineData;
import org.apache.sandesha2.policy.RMPolicyToken;
import org.apache.sandesha2.policy.RMProcessorContext;
@@ -42,7 +44,10 @@
initializeInvokeInOrder(rmpt);
initializedInvokeInOrder = true;
} catch (NoSuchMethodException e) {
- logger.error("Exception occured in initializeInvokeInOrder", e);
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.policyProcessingException,
+ e.toString(),
+ "InvokeInOrder"), e);
return new Boolean(false);
}
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/MaximumRetransmissionCountProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/MaximumRetransmissionCountProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/MaximumRetransmissionCountProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/MaximumRetransmissionCountProcessor.java Tue Jul 18 19:58:31 2006
@@ -19,6 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.policy.PolicyEngineData;
import org.apache.sandesha2.policy.RMPolicyToken;
import org.apache.sandesha2.policy.RMProcessorContext;
@@ -44,7 +46,10 @@
initializeMaximumRetransmissionCount(rmpt);
initializedMaximumRetransmissionCount = true;
} catch (NoSuchMethodException e) {
- logger.error("MaximumRetransmissionCountProcessor:doAcknowledgementInterval", e);
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.policyProcessingException,
+ e.toString(),
+ "MaximumRetransmissionCount"), e);
return new Boolean(false);
}
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/MessageTypesToDropProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/MessageTypesToDropProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/MessageTypesToDropProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/MessageTypesToDropProcessor.java Tue Jul 18 19:58:31 2006
@@ -19,6 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.policy.PolicyEngineData;
import org.apache.sandesha2.policy.RMPolicyToken;
import org.apache.sandesha2.policy.RMProcessorContext;
@@ -45,7 +47,10 @@
} catch (NoSuchMethodException e) {
logger
.error(
- "Exception occured in initializeMessageTypesToDrop",
+ SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.policyProcessingException,
+ e.toString(),
+ "MessageTypesToDrop"),
e);
return new Boolean(false);
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/RetransmissionItervalProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/RetransmissionItervalProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/RetransmissionItervalProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/RetransmissionItervalProcessor.java Tue Jul 18 19:58:31 2006
@@ -19,6 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.policy.PolicyEngineData;
import org.apache.sandesha2.policy.RMPolicyToken;
import org.apache.sandesha2.policy.RMProcessorContext;
@@ -44,7 +46,10 @@
initializeRetranmissionIterval(rmpt);
initializedRetransmissionInterval = true;
} catch (NoSuchMethodException e) {
- logger.error("Exception in initializeRetransmissionInterval", e);
+ logger.error(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.policyProcessingException,
+ e.toString(),
+ "RetransmissionInterval"), e);
return new Boolean(false);
}
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/StorageManagersProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/StorageManagersProcessor.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/StorageManagersProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/policy/processors/StorageManagersProcessor.java Tue Jul 18 19:58:31 2006
@@ -19,6 +19,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.policy.PolicyEngineData;
import org.apache.sandesha2.policy.RMPolicy;
import org.apache.sandesha2.policy.RMPolicyToken;
@@ -56,7 +58,10 @@
initializedStorageManager = true;
} catch (NoSuchMethodException e) {
logger.error(
- "Exception occured in initializeStorageManager", e);
+ SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.policyProcessingException,
+ e.toString(),
+ "StorageManagers"), e);
return new Boolean(false);
}
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryCreateSeqBeanMgr.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryCreateSeqBeanMgr.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryCreateSeqBeanMgr.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryCreateSeqBeanMgr.java Tue Jul 18 19:58:31 2006
@@ -28,6 +28,8 @@
import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.Sandesha2Constants;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
import org.apache.sandesha2.storage.beans.CreateSeqBean;
@@ -102,13 +104,15 @@
}
public synchronized ResultSet find(String query) {
- throw new UnsupportedOperationException("selectRS() is not supported");
+ throw new UnsupportedOperationException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.selectRSNotSupported));
}
public synchronized CreateSeqBean findUnique (CreateSeqBean bean) throws SandeshaException {
Collection coll = find(bean);
if (coll.size()>1) {
- String message = "Non-Unique result";
+ String message = SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.nonUniqueResult);
log.error(message);
throw new SandeshaException (message);
}
@@ -120,4 +124,4 @@
return null;
}
-}
\ No newline at end of file
+}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryInvokerBeanMgr.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryInvokerBeanMgr.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryInvokerBeanMgr.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryInvokerBeanMgr.java Tue Jul 18 19:58:31 2006
@@ -28,6 +28,8 @@
import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.Sandesha2Constants;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
import org.apache.sandesha2.storage.beans.InvokerBean;
@@ -60,7 +62,8 @@
}
public synchronized ResultSet find(String query) {
- throw new UnsupportedOperationException("selectRS() is not implemented");
+ throw new UnsupportedOperationException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.selectRSNotSupported));
}
public synchronized Collection find(InvokerBean bean) {
@@ -101,7 +104,8 @@
public synchronized InvokerBean findUnique (InvokerBean bean) throws SandeshaException {
Collection coll = find(bean);
if (coll.size()>1) {
- String message = "Non-Unique result";
+ String message = SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.nonUniqueResult);
log.error(message);
throw new SandeshaException (message);
}
@@ -113,4 +117,4 @@
return null;
}
-}
\ No newline at end of file
+}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java Tue Jul 18 19:58:31 2006
@@ -28,6 +28,8 @@
import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.Sandesha2Constants;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
import org.apache.sandesha2.storage.beans.NextMsgBean;
@@ -61,7 +63,8 @@
}
public synchronized ResultSet find(String query) {
- throw new UnsupportedOperationException("selectRS() is not supported");
+ throw new UnsupportedOperationException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.selectRSNotSupported));
}
public synchronized Collection find(NextMsgBean bean) {
@@ -107,7 +110,8 @@
public synchronized NextMsgBean findUnique(NextMsgBean bean) throws SandeshaException {
Collection coll = find(bean);
if (coll.size()>1) {
- String message = "Non-Unique result";
+ String message = SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.nonUniqueResult);
log.error(message);
throw new SandeshaException (message);
}
@@ -118,4 +122,4 @@
else
return null;
}
-}
\ No newline at end of file
+}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemorySenderBeanMgr.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemorySenderBeanMgr.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemorySenderBeanMgr.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemorySenderBeanMgr.java Tue Jul 18 19:58:31 2006
@@ -27,6 +27,8 @@
import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.Sandesha2Constants;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.storage.SandeshaStorageException;
import org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
import org.apache.sandesha2.storage.beans.SenderBean;
@@ -56,7 +58,8 @@
public synchronized boolean insert(SenderBean bean) throws SandeshaStorageException {
if (bean.getMessageID() == null)
- throw new SandeshaStorageException("Key (MessageId) is null. Cant insert.");
+ throw new SandeshaStorageException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.nullMsgId));
table.put(bean.getMessageID(), bean);
return true;
}
@@ -206,7 +209,8 @@
public synchronized SenderBean findUnique(SenderBean bean) throws SandeshaException {
Collection coll = find(bean);
if (coll.size()>1) {
- String message = "Non-Unique result";
+ String message = SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.nonUniqueResult);
log.error(message);
throw new SandeshaException (message);
}
@@ -234,4 +238,4 @@
-}
\ No newline at end of file
+}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java Tue Jul 18 19:58:31 2006
@@ -28,6 +28,8 @@
import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.Sandesha2Constants;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
import org.apache.sandesha2.storage.beans.SequencePropertyBean;
@@ -63,7 +65,8 @@
}
public synchronized ResultSet find(String query) {
- throw new UnsupportedOperationException("selectRS() is not supported");
+ throw new UnsupportedOperationException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.selectRSNotSupported));
}
public synchronized Collection find(SequencePropertyBean bean) {
@@ -124,7 +127,8 @@
public synchronized SequencePropertyBean findUnique(SequencePropertyBean bean) throws SandeshaException {
Collection coll = find(bean);
if (coll.size()>1) {
- String message = "Non-Unique result";
+ String message = SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.nonUniqueResult);
log.error(message);
throw new SandeshaException (message);
}
@@ -149,4 +153,4 @@
}
-}
\ No newline at end of file
+}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java Tue Jul 18 19:58:31 2006
@@ -23,6 +23,8 @@
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.description.AxisModule;
import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.storage.SandeshaStorageException;
import org.apache.sandesha2.storage.StorageManager;
import org.apache.sandesha2.storage.Transaction;
@@ -116,12 +118,14 @@
HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
if (storageMap==null) {
- throw new SandeshaStorageException ("Storage Map not present");
+ throw new SandeshaStorageException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.storageMapNotPresent));
}
Object oldEntry = storageMap.get(key);
if (oldEntry==null)
- throw new SandeshaStorageException ("Entry is not present for updating");
+ throw new SandeshaStorageException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.entryNotPresentForUpdating));
storeMessageContext(key,msgContext);
}
Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/transport/Sandesha2TransportSender.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/transport/Sandesha2TransportSender.java?rev=423350&r1=423349&r2=423350&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/transport/Sandesha2TransportSender.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/transport/Sandesha2TransportSender.java Tue Jul 18 19:58:31 2006
@@ -29,6 +29,8 @@
import org.apache.axis2.transport.TransportSender;
import org.apache.sandesha2.Sandesha2Constants;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
import org.apache.sandesha2.storage.StorageManager;
import org.apache.sandesha2.util.SandeshaUtil;
@@ -48,14 +50,16 @@
TransportOutDescription transportOut = (TransportOutDescription) msgContext.getProperty(Sandesha2Constants.ORIGINAL_TRANSPORT_OUT_DESC);
if (transportOut==null)
- throw new SandeshaException ("Original transport sender is not present");
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.transportOutNotPresent));
msgContext.setTransportOut(transportOut);
String key = (String) msgContext.getProperty(Sandesha2Constants.MESSAGE_STORE_KEY);
if (key==null)
- throw new SandeshaException ("Cant store message without the storage key");
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.cannotGetStorageKey));
ConfigurationContext configurationContext = msgContext.getConfigurationContext();
AxisConfiguration axisConfiguration = configurationContext.getAxisConfiguration();
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org