ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [16/50] incubator-ignite git commit: #IGNITE-GG-10429 Fixed client marshaller.
Date Thu, 18 Jun 2015 10:16:55 GMT
#IGNITE-GG-10429 Fixed client marshaller.


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

Branch: refs/heads/ignite-917-review
Commit: 092bb91f1cf8b99b0f43903fd493d85cac89ee7e
Parents: 7785544
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Wed Jun 17 10:17:49 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Wed Jun 17 10:17:49 2015 +0300

----------------------------------------------------------------------
 .../internal/client/GridClientConfiguration.java | 19 +++++++++++++++++--
 .../optimized/GridClientOptimizedMarshaller.java |  5 +++--
 2 files changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/092bb91f/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
index ee16f94..4a909a3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
@@ -23,10 +23,12 @@ import org.apache.ignite.internal.client.marshaller.optimized.*;
 import org.apache.ignite.internal.client.ssl.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.plugin.*;
 import org.apache.ignite.plugin.security.*;
 import org.jetbrains.annotations.*;
 
 import java.net.*;
+import java.security.*;
 import java.util.*;
 import java.util.concurrent.*;
 
@@ -110,7 +112,7 @@ public class GridClientConfiguration {
     private ExecutorService executor;
 
     /** Marshaller. */
-    private GridClientMarshaller marshaller = new GridClientOptimizedMarshaller();
+    private GridClientMarshaller marshaller;
 
     /** Daemon flag. */
     private boolean daemon;
@@ -119,7 +121,20 @@ public class GridClientConfiguration {
      * Creates default configuration.
      */
     public GridClientConfiguration() {
-        // No-op.
+        List<PluginProvider> plugins = AccessController.doPrivileged(new PrivilegedAction<List<PluginProvider>>()
{
+            @Override public List<PluginProvider> run() {
+                List<PluginProvider> providers = new ArrayList<>();
+
+                ServiceLoader<PluginProvider> ldr = ServiceLoader.load(PluginProvider.class);
+
+                for (PluginProvider provider : ldr)
+                    providers.add(provider);
+
+                return providers;
+            }
+        });
+
+        marshaller = new GridClientOptimizedMarshaller(plugins);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/092bb91f/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
b/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
index 28b129e..0d99d75 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
@@ -23,6 +23,7 @@ import org.apache.ignite.internal.client.marshaller.*;
 import org.apache.ignite.internal.processors.rest.client.message.*;
 import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.plugin.*;
+import org.jetbrains.annotations.*;
 
 import java.io.*;
 import java.nio.*;
@@ -53,7 +54,7 @@ public class GridClientOptimizedMarshaller implements GridClientMarshaller
{
      *
      * @param plugins Plugins.
      */
-    public GridClientOptimizedMarshaller(List<PluginProvider> plugins) {
+    public GridClientOptimizedMarshaller(@Nullable List<PluginProvider> plugins) {
         opMarsh = new OptimizedMarshaller();
 
         opMarsh.setContext(new ClientMarshallerContext(plugins));
@@ -121,7 +122,7 @@ public class GridClientOptimizedMarshaller implements GridClientMarshaller
{
         /**
          * @param plugins Plugins.
          */
-        public ClientMarshallerContext(List<PluginProvider> plugins) {
+        public ClientMarshallerContext(@Nullable List<PluginProvider> plugins) {
             super(plugins);
         }
 


Mime
View raw message