Author: keith
Date: Thu Jun  5 00:57:19 2008
New Revision: 17966
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=17966

Log:
Fixing Mashup-845


Modified:
   
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java

Modified: 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
URL: 
http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java?rev=17966&r1=17965&r2=17966&view=diff
==============================================================================
--- 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   (original)
+++ 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   Thu Jun  5 00:57:19 2008
@@ -109,7 +109,7 @@
     private AxisConfiguration axisConfig;
 
     // States weather services will be exposed via http or not
-    private boolean allowHttpAccess;
+    private boolean disallowHttpAccess;
 
     protected Map schemaMap = new Hashtable();
 
@@ -144,10 +144,12 @@
         this.axisConfig = this.configCtx.getAxisConfiguration();
 
         ServerConfiguration serverConfig = ServerConfiguration.getInstance();
-        String allowHttpAccessString = 
serverConfig.getFirstProperty("Management.AllowHTTPAccess");
-        this.allowHttpAccess = 
JavaUtils.isFalseExplicitly(allowHttpAccessString);
+        String disallowHttpAccessString = 
serverConfig.getFirstProperty("Management.AllowHTTPAccess");
+        this.disallowHttpAccess = 
JavaUtils.isFalseExplicitly(disallowHttpAccessString);
 
         try {
+            
axisConfig.addParameter(JavaScriptEngineConstants.ALLOW_HTTP_TRAFFIC_TO_MASHUPS,
 
+                                    Boolean.valueOf(!disallowHttpAccess));
             // Creating the global function scheduler instance
             SchedulerFactory schedulerFactory = new StdSchedulerFactory();
             Scheduler scheduler = schedulerFactory.getScheduler();
@@ -427,7 +429,7 @@
             // Load the Global JavaScriptHostObjects that are spefified using 
the parameter
             // <parameter name="javascript.global.propertyobjects"> in the 
axis2.xml
             JavaScriptEngineUtils.loadGlobalPropertyObjects(engine, configCtx
-                    .getAxisConfiguration(), MashupConstants.EMPTY_STRING, 
allowHttpAccess);
+                    .getAxisConfiguration(), MashupConstants.EMPTY_STRING);
 
             FileInputStream fileInputStream;
             fileInputStream = new FileInputStream(file);
@@ -597,7 +599,7 @@
                 
axisService.addParameter(MashupConstants.UNDISPATCHED_OPERATION, undispatched);
             }
 
-            if (allowHttpAccess) {
+            if (disallowHttpAccess) {
                 axisService.setEnableAllTransports(false);
                 HashMap map = axisConfig.getTransportsIn();
                 Iterator iterator = map.values().iterator();
@@ -648,8 +650,7 @@
             if (init != null) {
                 JavaScriptEngineUtils
                                     .loadGlobalPropertyObjects(engine, 
axisConfig,
-                                                               
axisService.getName(),
-                                                               
allowHttpAccess);
+                                                               
axisService.getName());
                 init.call(engine.getCx(), engine, engine, new Object[0]);
             }
             // Check weather we need to call the init functions of any services
@@ -689,8 +690,7 @@
                             // parameter
                             // <parameter 
name="javascript.global.propertyobjects"> in the axis2.xml
                             JavaScriptEngineUtils
-                                    .loadGlobalPropertyObjects(engine, 
axisConfig, serviceName,
-                                                               
allowHttpAccess);
+                                    .loadGlobalPropertyObjects(engine, 
axisConfig, serviceName);
 
                             URL repoURL = axisConfig.getRepository();
                             if (repoURL != null) {

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to