/** * Create binary marshaller. * * @return Marshaller. */ public static GridBinaryMarshaller marshaller() { BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), new IgniteConfiguration(), new NullLogger()); BinaryMarshaller marsh = new BinaryMarshaller(); marsh.setContext(new MarshallerContextImpl(null, null)); ctx.configure(marsh, new IgniteConfiguration()); return new GridBinaryMarshaller(ctx); }
/** {@inheritDoc} */ @Override protected Marshaller createMarshaller() throws IgniteCheckedException { BinaryMarshaller marsh = new BinaryMarshaller(); IgniteConfiguration iCfg = new IgniteConfiguration(); iCfg.setDiscoverySpi(new TcpDiscoverySpi() { @Override public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException { // No-op. } }); iCfg.setClientMode(false); GridTestKernalContext kernCtx = new GridTestKernalContext(log, iCfg); kernCtx.add(new GridDiscoveryManager(kernCtx)); MarshallerContextTestImpl marshCtx = new MarshallerContextTestImpl(null); marshCtx.onMarshallerProcessorStarted(kernCtx, null); marsh.setContext(marshCtx); BinaryContext pCtx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg, new NullLogger()); IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", pCtx, iCfg); return marsh; } }
BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg, new NullLogger());
/** * Create binary marshaller. * * @return Marshaller. */ @SuppressWarnings("deprecation") public static GridBinaryMarshaller marshaller() { BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), new IgniteConfiguration(), new NullLogger()); BinaryMarshaller marsh = new BinaryMarshaller(); marsh.setContext(new MarshallerContextImpl(null, null)); ctx.configure(marsh, new IgniteConfiguration()); return new GridBinaryMarshaller(ctx); }