ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivasilin...@apache.org
Subject [39/50] [abbrv] incubator-ignite git commit: #ignite-964: java8 js is working
Date Mon, 13 Jul 2015 06:35:40 GMT
#ignite-964: java8 js is working


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/eebdd647
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/eebdd647
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/eebdd647

Branch: refs/heads/ignite-961
Commit: eebdd64755d215fb24262e0542d691a623af475c
Parents: 4e4547a
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Jul 10 18:03:17 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Jul 10 18:03:17 2015 +0300

----------------------------------------------------------------------
 .../handlers/scripting/IgniteScriptingCommandHandler.java     | 7 +++----
 .../processors/scripting/IgniteScriptingProcessor.java        | 6 +++---
 .../ScriptingObjectConverter8.java                            | 7 +++++++
 3 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eebdd647/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
index 21381f1..088e6be 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
@@ -156,7 +156,7 @@ public class IgniteScriptingCommandHandler extends GridRestCommandHandlerAdapter
                 List<T3<Object, Object, Object>> jsMapRes = emitRes.getEmitResult();
 
                 for (T3<Object, Object, Object> task : jsMapRes) {
-                    map.put(new JsCallFunctionJob((String)task.get1(), task.get2()),
+                    map.put(new JsCallFunctionJob(ctx.scripting(), (String)task.get1(), task.get2()),
                         (ClusterNode)task.get3());
                 }
 
@@ -207,14 +207,13 @@ public class IgniteScriptingCommandHandler extends GridRestCommandHandlerAdapter
         private Ignite ignite;
 
         /**
+         * @param proc Scripting processor.
          * @param func Function to call.
          * @param argv Function argument.
          */
-        public JsCallFunctionJob(String func, Object argv) {
+        public JsCallFunctionJob(IgniteScriptingProcessor proc, String func, Object argv)
{
             this.func = func;
 
-            IgniteScriptingProcessor proc = ((IgniteKernal) ignite).context().scripting();
-
             this.argv = proc.toScriptingObject(proc.toJavaObject(argv));
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eebdd647/modules/core/src/main/java/org/apache/ignite/internal/processors/scripting/IgniteScriptingProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/scripting/IgniteScriptingProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/scripting/IgniteScriptingProcessor.java
index e5eba31..733fc10 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/scripting/IgniteScriptingProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/scripting/IgniteScriptingProcessor.java
@@ -32,7 +32,7 @@ import static javax.script.ScriptContext.*;
  */
 public class IgniteScriptingProcessor extends GridProcessorAdapter {
     /** Javascript engine name. */
-    public static final String JAVA_SCRIPT_ENGINE_NAME = "rhino";
+    public static final String JAVA_SCRIPT_ENGINE_NAME = "JavaScript";
 
     /** Java8 scripting converter class. */
     private static final String CONV_CLS_JAVA8 =
@@ -56,9 +56,9 @@ public class IgniteScriptingProcessor extends GridProcessorAdapter {
         try {
             Class<?> cls = Class.forName(CONV_CLS_JAVA8);
 
-            Constructor<?> ctor = cls.getConstructor(GridKernalContext.class);
+            Constructor<?> ctor = cls.getConstructor();
 
-            converter = (ScriptingObjectConverter)ctor.newInstance(ctx);
+            converter = (ScriptingObjectConverter)ctor.newInstance();
             System.out.println("JDK 8 is found!!!!");
         }
         catch (ClassNotFoundException ignored) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eebdd647/modules/core/src/main/java8/org.apache.ignite.internal.processors.scripting/ScriptingObjectConverter8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java8/org.apache.ignite.internal.processors.scripting/ScriptingObjectConverter8.java
b/modules/core/src/main/java8/org.apache.ignite.internal.processors.scripting/ScriptingObjectConverter8.java
index 1355b46..ae4051e 100644
--- a/modules/core/src/main/java8/org.apache.ignite.internal.processors.scripting/ScriptingObjectConverter8.java
+++ b/modules/core/src/main/java8/org.apache.ignite.internal.processors.scripting/ScriptingObjectConverter8.java
@@ -31,6 +31,13 @@ public class ScriptingObjectConverter8 extends ScriptingObjectConverter
implemen
     private final JSONCacheObject fields;
 
     /**
+     * Default constructor.
+     */
+    public ScriptingObjectConverter8() {
+        fields = null;
+    }
+
+    /**
      * @param o JSON object.
      */
     private ScriptingObjectConverter8(JSONCacheObject o) {


Mime
View raw message