[mashup-dev] svn commit r3494 - in trunk/mashup/java/modules:
hostobjects/src/org/wso2/mashup/hostobjects/wsrequest
integration/test-resources/scripts
svn at wso2.org
svn at wso2.org
Mon Jun 4 08:35:07 PDT 2007
Author: thilina
Date: Mon Jun 4 08:34:58 2007
New Revision: 3494
Modified:
trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/wsrequest/WSRequestHostImpl.java
trunk/mashup/java/modules/integration/test-resources/scripts/hostObjectTest.js
Log:
fixing the build break & MASHUP-55... The issue was much harder to tackle than I assumed:(.
Modified: trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/wsrequest/WSRequestHostImpl.java
==============================================================================
--- trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/wsrequest/WSRequestHostImpl.java (original)
+++ trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/wsrequest/WSRequestHostImpl.java Mon Jun 4 08:34:58 2007
@@ -32,9 +32,11 @@
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.MessageContext;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;
import org.apache.axis2.transport.http.HttpTransportProperties.Authenticator;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.NativeArray;
@@ -43,6 +45,7 @@
import org.mozilla.javascript.Undefined;
import org.mozilla.javascript.UniqueTag;
import org.mozilla.javascript.xmlimpl.XML;
+import org.wso2.javascript.rhino.JavaScriptEngineConstants;
/**
* TODO: DOM Support
@@ -198,8 +201,17 @@
} else {
throw Context.reportRuntimeError("INVALID_SYNTAX_EXCEPTION");
}
+ Object object = cx.getThreadLocal(JavaScriptEngineConstants.AXIS2_MESSAGECONTEXT);
+ if (!(object instanceof MessageContext)) {
+ MessageContext messageContext = (MessageContext) object;
+ wsRequest.sender = new ServiceClient(messageContext.getConfigurationContext(), null);
+ } else {
+ wsRequest.sender = new ServiceClient();
+ }
+ wsRequest.sender.getServiceContext().setProperty(
+ HTTPConstants.MUTTITHREAD_HTTP_CONNECTION_MANAGER,
+ new MultiThreadedHttpConnectionManager());
- wsRequest.sender = new ServiceClient();
Options options = getOptionsObject(httpMethod, url, username, passwd, useSOAP, useWSA,
action, optionsArray, wsRequest);
wsRequest.sender.setOptions(options);
Modified: trunk/mashup/java/modules/integration/test-resources/scripts/hostObjectTest.js
==============================================================================
--- trunk/mashup/java/modules/integration/test-resources/scripts/hostObjectTest.js (original)
+++ trunk/mashup/java/modules/integration/test-resources/scripts/hostObjectTest.js Mon Jun 4 08:34:58 2007
@@ -72,10 +72,12 @@
if (!file.exists){
throw new Error();
}
+ file.openFileForWriting();
file.write("WSO2 Mashup Server");
- file.finishWriting();
+ file.close();
+ file.openFileForReading();
file.readLine();
- file.finishReading();
+ file.close();
var result= file.deleteFile();
return <result>{result}</result>;
}
\ No newline at end of file
More information about the Mashup-dev
mailing list