Skip to content

Commit

Permalink
#IGNITE-GG-10429 Fixed client marshaller.
Browse files Browse the repository at this point in the history
  • Loading branch information
niktikhonov committed Jun 17, 2015
1 parent 092bb91 commit 9142eb7
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
import org.apache.ignite.internal.processors.rest.client.message.*;
import org.apache.ignite.internal.util.nio.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.plugin.*;
import org.jetbrains.annotations.*;

import java.security.*;
import java.util.*;

import static org.apache.ignite.internal.util.nio.GridNioSessionMetaKey.*;
Expand Down Expand Up @@ -65,7 +67,20 @@ public GridTcpRouterNioListenerAdapter(IgniteLogger log, GridRouterClientImpl cl

marshMap = new HashMap<>();

marshMap.put(GridClientOptimizedMarshaller.ID, new GridClientOptimizedMarshaller());
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;
}
});

marshMap.put(GridClientOptimizedMarshaller.ID, new GridClientOptimizedMarshaller(plugins));
marshMap.put(GridClientJdkMarshaller.ID, new GridClientJdkMarshaller());

init();
Expand Down

0 comments on commit 9142eb7

Please sign in to comment.