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

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=17964&r1=17963&r2=17964&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:25:06 2008
@@ -108,6 +108,9 @@
 
     private AxisConfiguration axisConfig;
 
+    // States weather services will be exposed via http or not
+    private boolean allowHttpAccess;
+
     protected Map schemaMap = new Hashtable();
 
     private ConfigurationContext configCtx;
@@ -139,6 +142,11 @@
     public void init(ConfigurationContext configCtx) {
         this.configCtx = configCtx;
         this.axisConfig = this.configCtx.getAxisConfiguration();
+
+        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
+        String allowHttpAccessString = 
serverConfig.getFirstProperty("Management.AllowHTTPAccess");
+        this.allowHttpAccess = 
JavaUtils.isFalseExplicitly(allowHttpAccessString);
+
         try {
             // Creating the global function scheduler instance
             SchedulerFactory schedulerFactory = new StdSchedulerFactory();
@@ -419,7 +427,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);
+                    .getAxisConfiguration(), MashupConstants.EMPTY_STRING, 
allowHttpAccess);
 
             FileInputStream fileInputStream;
             fileInputStream = new FileInputStream(file);
@@ -640,7 +648,8 @@
             if (init != null) {
                 JavaScriptEngineUtils
                                     .loadGlobalPropertyObjects(engine, 
axisConfig,
-                                                               
axisService.getName());
+                                                               
axisService.getName(),
+                                                               
allowHttpAccess);
                 init.call(engine.getCx(), engine, engine, new Object[0]);
             }
             // Check weather we need to call the init functions of any services
@@ -680,7 +689,8 @@
                             // parameter
                             // <parameter 
name="javascript.global.propertyobjects"> in the axis2.xml
                             JavaScriptEngineUtils
-                                    .loadGlobalPropertyObjects(engine, 
axisConfig, serviceName);
+                                    .loadGlobalPropertyObjects(engine, 
axisConfig, serviceName,
+                                                               
allowHttpAccess);
 
                             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