svn commit r17965 - trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit r17965 - trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino

Keith Chapman-4
Author: keith
Date: Thu Jun  5 00:35:56 2008
New Revision: 17965
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=17965

Log:
Changed the way of Fixing Mashup-845. Initially passed in a parameter to indicate weather http access is allowed but that seemed troublecome. So noe setting it as a parameter in the axis
configuration


Modified:
   trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineConstants.java
   trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java

Modified: trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineConstants.java
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineConstants.java?rev=17965&r1=17964&r2=17965&view=diff
==============================================================================
--- trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineConstants.java (original)
+++ trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineConstants.java Thu Jun  5 00:35:56 2008
@@ -44,4 +44,7 @@
 
     // Used to keep track of the presence of annotation of the types
     public static final String ANNOTATED = "annotated";
+
+    // Refers to username of the mashup Author
+    public static final String ALLOW_HTTP_TRAFFIC_TO_MASHUPS ="allowHTTPAccess";
 }

Modified: trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java?rev=17965&r1=17964&r2=17965&view=diff
==============================================================================
--- trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java (original)
+++ trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java Thu Jun  5 00:35:56 2008
@@ -109,19 +109,18 @@
     }
 
     public static void loadGlobalPropertyObjects(JavaScriptEngine engine,
-                                                 AxisConfiguration axisConfig, String serviceName,
-                                                 boolean allowHttpAccess) {
+                                                 AxisConfiguration axisConfig, String serviceName) {
         Parameter propertyObjectParameter = axisConfig
                 .getParameter("javascript.global.propertyobjects");
         if ((propertyObjectParameter != null) &&
                 (propertyObjectParameter.getParameterType() == 2)) {
             OMElement paraElement = propertyObjectParameter.getParameterElement();
-            loadGlobalProperties(paraElement, engine, serviceName, allowHttpAccess);
+            loadGlobalProperties(paraElement, engine, serviceName);
         }
     }
 
     private static void loadGlobalProperties(OMElement hostObjectElement, JavaScriptEngine engine,
-                                             String serviceName, boolean allowHttpAccess) {
+                                             String serviceName) {
         Iterator iterator = hostObjectElement.getChildrenWithName(new QName("global.property"));
         while (iterator.hasNext()) {
             OMElement element = (OMElement) iterator.next();
@@ -143,6 +142,8 @@
                     if (object instanceof ConfigurationContext) {
                         ConfigurationContext configurationContext = (ConfigurationContext) object;
                         AxisConfiguration configuration = configurationContext.getAxisConfiguration();
+                        Boolean allowHttpAccess = (Boolean) configuration.getParameterValue(
+                                JavaScriptEngineConstants.ALLOW_HTTP_TRAFFIC_TO_MASHUPS);
 
                         // The Mashup server may be running behind a proxy so the best way to get
                         // the http address would be to get it from the http transport listener
@@ -151,7 +152,7 @@
                         // If httpAccess is allowed we take the http transport else we switch to the
                         // https transport
                         TransportInDescription inDescription;
-                        if (allowHttpAccess) {
+                        if (allowHttpAccess.booleanValue()) {
                             inDescription = configuration
                                         .getTransportIn("http");
                         } else {

_______________________________________________
Wsf-javascript-dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/wsf-javascript-dev