ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlov...@apache.org
Subject svn commit: r575276 - in /webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2: Sandesha2Constants.java SandeshaModule.java util/SandeshaUtil.java
Date Thu, 13 Sep 2007 11:55:41 GMT
Author: mlovett
Date: Thu Sep 13 04:55:41 2007
New Revision: 575276

URL: http://svn.apache.org/viewvc?rev=575276&view=rev
Log:
Move string.split() off the mainline code and into module init, to improve performance

Modified:
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/Sandesha2Constants.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/Sandesha2Constants.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/Sandesha2Constants.java?rev=575276&r1=575275&r2=575276&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/Sandesha2Constants.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/Sandesha2Constants.java
Thu Sep 13 04:55:41 2007
@@ -558,6 +558,10 @@
 	
 	static final String propertiesToCopyFromReferenceRequestMessage = "propertiesToCopyFromReferenceRequestMessage";
 	
+	static final String propertiesToCopyFromReferenceMessageAsStringArray = "propertiesToCopyFromReferenceMessageAsStringArray";
+	
+	static final String propertiesToCopyFromReferenceRequestMessageAsStringArray = "propertiesToCopyFromReferenceRequestMessageAsStringArray";
+	
 	static final String MSG_NO_OF_IN_MSG = "MsgNoOfInMsg";
 	
 	static final String MAKE_CONNECTION_RESPONSE = "MakeConnectionResponse";

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java?rev=575276&r1=575275&r2=575276&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
Thu Sep 13 04:55:41 2007
@@ -27,6 +27,7 @@
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.description.AxisDescription;
 import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisOperation;
@@ -198,6 +199,32 @@
 					}
 				}
 		);
+		
+		Parameter propertiesFromRefMsg = module.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceMessage);
+		if (propertiesFromRefMsg!=null) {
+			String value = (String) propertiesFromRefMsg.getValue();
+			if (value!=null) {
+				value = value.trim();
+				String[] propertyNames = value.split(",");
+				Parameter param = new Parameter();
+				param.setName(Sandesha2Constants.propertiesToCopyFromReferenceMessageAsStringArray);
+				param.setValue(propertyNames);
+				module.addParameter(param);
+			}
+		}
+		
+		Parameter propertiesFromRefReqMsg = module.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceRequestMessage);
+		if (propertiesFromRefReqMsg!=null) {
+			String value = (String) propertiesFromRefReqMsg.getValue();
+			if (value!=null) {
+				value = value.trim();
+				String[] propertyNames = value.split(",");
+				Parameter param = new Parameter();
+				param.setName(Sandesha2Constants.propertiesToCopyFromReferenceRequestMessageAsStringArray);
+				param.setValue(propertyNames);
+				module.addParameter(param);
+			}
+		}
 
 		if(log.isDebugEnabled()) log.debug("Exit: SandeshaModule::init");
 	}

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java?rev=575276&r1=575275&r2=575276&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
Thu Sep 13 04:55:41 2007
@@ -465,12 +465,10 @@
 			throw new SandeshaException (message);
 		}
 		
-		Parameter propertiesFromRefMsg = axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceMessage);
+		Parameter propertiesFromRefMsg = axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceMessageAsStringArray);
 		if (propertiesFromRefMsg!=null) {
-			String value = (String) propertiesFromRefMsg.getValue();
-			if (value!=null) {
-				value = value.trim();
-				String[] propertyNames = value.split(",");
+			String[] propertyNames = (String[]) propertiesFromRefMsg.getValue();
+			if (propertyNames!=null) {
 				for (int i=0;i<propertyNames.length;i++) {
 					String tmp = propertyNames[i];
 					String propertyName = null;
@@ -493,17 +491,15 @@
 			}
 		}
 		
-		Parameter propertiesFromRefReqMsg = axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceRequestMessage);
+		Parameter propertiesFromRefReqMsg = axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceRequestMessageAsStringArray);
 		OperationContext referenceOpCtx = fromMessage.getOperationContext();
 		MessageContext referenceRequestMessage = null;
 		if (referenceOpCtx!=null) 
 			referenceRequestMessage=referenceOpCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
 		
 		if (propertiesFromRefReqMsg!=null && referenceRequestMessage!=null) {
-			String value = (String) propertiesFromRefReqMsg.getValue();
-			if (value!=null) {
-				value = value.trim();
-				String[] propertyNames = value.split(",");
+			String[] propertyNames = (String[]) propertiesFromRefReqMsg.getValue();
+			if (propertyNames!=null) {
 				for (int i=0;i<propertyNames.length;i++) {
 					String propertyName = propertyNames[i];
 					Object val = referenceRequestMessage.getProperty(propertyName);



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


Mime
View raw message