Author: chamikara
Date: Sat Dec  2 01:40:33 2006
New Revision: 481533

URL: http://svn.apache.org/viewvc?view=rev&rev=481533
Log:
Corrected the SandeshaUtil to get property names from module.xml when creating 
relatedMsgContexts.

Modified:
    
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/Sandesha2Constants.java
    
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/SandeshaModule.java
    
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/AcknowledgementManager.java
    
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/SandeshaUtil.java

Modified: 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/Sandesha2Constants.java
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/Sandesha2Constants.java?view=diff&rev=481533&r1=481532&r2=481533
==============================================================================
--- 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/Sandesha2Constants.java
 (original)
+++ 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/Sandesha2Constants.java
 Sat Dec  2 01:40:33 2006
@@ -546,6 +546,10 @@
        
        String RETRANSMITTABLE_PHASES = "RMRetransmittablePhases";
        
+       String propertiesToCopyFromReferenceMessage = 
"propertiesToCopyFromReferenceMessage";
+       
+       String propertiesToCopyFromReferenceRequestMessage = 
"propertiesToCopyFromReferenceRequestMessage";
+       
        String [] SPEC_NS_URIS = {
                        SPEC_2005_02.NS_URI,
                        SPEC_2006_08.NS_URI

Modified: 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/SandeshaModule.java
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/SandeshaModule.java?view=diff&rev=481533&r1=481532&r2=481533
==============================================================================
--- 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/SandeshaModule.java
 (original)
+++ 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/SandeshaModule.java
 Sat Dec  2 01:40:33 2006
@@ -57,6 +57,9 @@
                //init the i18n messages
                SandeshaMessageHelper.innit();
                
+               //storing the module as a static variable
+               SandeshaUtil.setAxisModule(module);
+               
                // continueUncompletedSequences (storageManager,configCtx);
 
                SandeshaPolicyBean constantPropertyBean = 
PropertyManager.loadPropertiesFromDefaultValues();

Modified: 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/AcknowledgementManager.java
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/AcknowledgementManager.java?view=diff&rev=481533&r1=481532&r2=481533
==============================================================================
--- 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/AcknowledgementManager.java
 (original)
+++ 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/AcknowledgementManager.java
 Sat Dec  2 01:40:33 2006
@@ -73,6 +73,7 @@
                        throws SandeshaException {
                if (log.isDebugEnabled())
                        log.debug("Enter: 
AcknowledgementManager::piggybackAcksIfPresent");
+               
 
                ConfigurationContext configurationContext = 
rmMessageContext.getConfigurationContext();
 
@@ -224,7 +225,6 @@
 
                MessageContext referenceMsg = 
referenceRMMessage.getMessageContext();
 
-               ConfigurationContext configurationContext = 
referenceRMMessage.getMessageContext().getConfigurationContext();
                SequencePropertyBeanMgr seqPropMgr = 
storageManager.getSequencePropertyBeanMgr();
 
                // Setting the ack depending on AcksTo.
@@ -259,6 +259,8 @@
                                                                                
                                                                        // the
                                                                                
                                                                        // 
RMMsgCreator
 
+               ackMsgCtx.setServerSide(referenceMsg.isServerSide());
+               
                
ackMsgCtx.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
 
                RMMsgContext ackRMMsgCtx = 
MsgInitializer.initializeMessage(ackMsgCtx);

Modified: 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/SandeshaUtil.java
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/SandeshaUtil.java?view=diff&rev=481533&r1=481532&r2=481533
==============================================================================
--- 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/SandeshaUtil.java
 (original)
+++ 
webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/SandeshaUtil.java
 Sat Dec  2 01:40:33 2006
@@ -18,13 +18,9 @@
 package org.apache.sandesha2.util;
 
 import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.io.OutputStream;
-import java.io.StringBufferInputStream;
 import java.lang.reflect.Constructor;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.StringTokenizer;
@@ -34,7 +30,6 @@
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLOutputFactory;
 import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.axiom.om.OMElement;
@@ -57,6 +52,7 @@
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.description.AxisDescription;
+import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
@@ -68,7 +64,6 @@
 import org.apache.axis2.util.UUIDGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.rampart.RampartMessageData;
 import org.apache.sandesha2.RMMsgContext;
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.SandeshaException;
@@ -89,7 +84,6 @@
 import org.apache.sandesha2.wsrm.CloseSequenceResponse;
 import org.apache.sandesha2.wsrm.Sequence;
 import org.apache.sandesha2.wsrm.SequenceAcknowledgement;
-import org.apache.ws.security.handler.WSHandlerConstants;
 
 /**
  * Contains utility methods that are used in many plases of Sandesha2.
@@ -100,6 +94,15 @@
        // private static Hashtable storedMsgContexts = new Hashtable();
 
        private static Log log = LogFactory.getLog(SandeshaUtil.class);
+       private static AxisModule axisModule = null;
+
+       public static AxisModule getAxisModule() {
+               return axisModule;
+       }
+
+       public static void setAxisModule(AxisModule module) {
+               axisModule = module;
+       }
 
        /**
         * Create a new UUID.
@@ -631,11 +634,50 @@
                        
newMessageContext.setProperty(MessageContext.TRANSPORT_OUT, referenceMessage
                                        
.getProperty(MessageContext.TRANSPORT_OUT));
                        
-                       //TODO - move these to a property file.
-            
newMessageContext.setProperty(RampartMessageData.KEY_RAMPART_POLICY, 
referenceMessage
-                    .getProperty(RampartMessageData.KEY_RAMPART_POLICY));
-            newMessageContext.setProperty(WSHandlerConstants.RECV_RESULTS, 
-                    
referenceMessage.getProperty(WSHandlerConstants.RECV_RESULTS));
+
+                       //copyint properties as configured in the module.xml 
properties. Module xml has several
+                       //properties which gives comma seperated lists of 
property names that have to be copited
+                       //from various places when creating related messages.
+                       
+                       AxisModule axisModule = SandeshaUtil.getAxisModule();
+
+                       Parameter propertiesFromRefMsg = 
axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceMessage);
+                       if (propertiesFromRefMsg!=null) {
+                               String value = (String) 
propertiesFromRefMsg.getValue();
+                               if (value!=null) {
+                                       value = value.trim();
+                                       String[] propertyNames = 
value.split(",");
+                                       for (int 
i=0;i<propertyNames.length;i++) {
+                                               String propertyName = 
propertyNames[i];
+                                               Object val = 
referenceMessage.getProperty(propertyName);
+                                               if (val!=null) {
+                                                       
newMessageContext.setProperty(propertyName,val);
+                                               }
+                                       }
+                               }
+                       }
+                       
+                       Parameter propertiesFromRefReqMsg = 
axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceRequestMessage);
+                       OperationContext referenceOpCtx = 
referenceMessage.getOperationContext();
+                       MessageContext referenceRequestMessage = null;
+                       if (referenceOpCtx!=null) 
+                               
referenceRequestMessage=referenceOpCtx.getMessageContext(OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
+                       
+                       if (propertiesFromRefReqMsg!=null && 
referenceRequestMessage!=null) {
+                               String value = (String) 
propertiesFromRefReqMsg.getValue();
+                               if (value!=null) {
+                                       value = value.trim();
+                                       String[] propertyNames = 
value.split(",");
+                                       for (int 
i=0;i<propertyNames.length;i++) {
+                                               String propertyName = 
propertyNames[i];
+                                               Object val = 
referenceRequestMessage.getProperty(propertyName);
+                                               if (val!=null) {
+                                                       
newMessageContext.setProperty(propertyName,val);
+                                               }
+                                       }
+                               }
+                       }
+                       
             
                        
newMessageContext.setExecutionChain(referenceMessage.getExecutionChain());
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to