new BinaryContext(metaHnd, ctx.config(), ctx.log(BinaryContext.class));
/** * 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); }
/** Create new marshaller implementation. */ private GridBinaryMarshaller createImpl(BinaryConfiguration binCfg) { IgniteConfiguration igniteCfg = new IgniteConfiguration(); if (binCfg == null) { binCfg = new BinaryConfiguration(); binCfg.setCompactFooter(false); } igniteCfg.setBinaryConfiguration(binCfg); BinaryContext ctx = new BinaryContext(metaHnd, igniteCfg, new NullLogger()); BinaryMarshaller marsh = new BinaryMarshaller(); marsh.setContext(marshCtx); ctx.configure(marsh, igniteCfg); ctx.registerUserTypesSchema(); return new GridBinaryMarshaller(ctx); } }
/** * Create instance of {@link BinaryMarshaller} suitable for use * without starting a grid upon given {@link IgniteConfiguration}. * * @return Binary marshaller. * @throws IgniteCheckedException if failed. */ protected BinaryMarshaller createStandaloneBinaryMarshaller(IgniteConfiguration cfg) throws IgniteCheckedException { BinaryMarshaller marsh = new BinaryMarshaller(); BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), cfg, new NullLogger()); marsh.setContext(new MarshallerContextTestImpl()); IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, cfg); return marsh; }
new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration(), new NullLogger());
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration(), new NullLogger()); marsh = new BinaryMarshaller(); IgniteConfiguration iCfg = new IgniteConfiguration(); BinaryConfiguration bCfg = new BinaryConfiguration(); bCfg.setTypeConfigurations(Arrays.asList(new BinaryTypeConfiguration(TestObject.class.getName()))); bCfg.setCompactFooter(compactFooter()); iCfg.setBinaryConfiguration(bCfg); marsh.setContext(new MarshallerContextTestImpl(null)); IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg); }
/** * Create marshaller. * * @return Binary marshaller. * @throws Exception If failed. */ protected BinaryMarshaller createMarshaller() throws Exception { BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration(), new NullLogger()); BinaryMarshaller marsh = new BinaryMarshaller(); BinaryConfiguration bCfg = new BinaryConfiguration(); bCfg.setCompactFooter(compactFooter()); bCfg.setTypeConfigurations(Arrays.asList( new BinaryTypeConfiguration(TestObject.class.getName()), new BinaryTypeConfiguration(TestOuterObject.class.getName()), new BinaryTypeConfiguration(TestInnerObject.class.getName()) )); IgniteConfiguration iCfg = new IgniteConfiguration(); iCfg.setBinaryConfiguration(bCfg); marsh.setContext(new MarshallerContextTestImpl(null)); IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg); return marsh; }
/** * @return Binary marshaller. * @throws IgniteCheckedException if failed. */ private BinaryMarshaller binaryMarshaller() throws IgniteCheckedException { IgniteConfiguration iCfg = new IgniteConfiguration(); BinaryConfiguration bCfg = new BinaryConfiguration(); iCfg.setBinaryConfiguration(bCfg); BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg, new NullLogger()); BinaryMarshaller marsh = new BinaryMarshaller(); marsh.setContext(new MarshallerContextTestImpl(null)); IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg); return marsh; }
/** * Create marshaller. * * @return Binary marshaller. * @throws Exception If failed. */ protected BinaryMarshaller createMarshaller() throws Exception { BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration(), log()); BinaryMarshaller marsh = new BinaryMarshaller(); BinaryConfiguration bCfg = new BinaryConfiguration(); IgniteConfiguration iCfg = new IgniteConfiguration(); iCfg.setBinaryConfiguration(bCfg); marsh.setContext(new MarshallerContextTestImpl(null)); IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg); return marsh; }
/** {@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());
BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), cfg, new NullLogger());
BinaryContext context = new BinaryContext(BinaryCachingMetadataHandler.create(), cfg, new NullLogger());
BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg, new NullLogger());
binaryCtx = new BinaryContext(metaHnd, ctx.config(), ctx.log(BinaryContext.class));
/** * 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); }
/** Create new marshaller implementation. */ private GridBinaryMarshaller createImpl(BinaryConfiguration binCfg) { IgniteConfiguration igniteCfg = new IgniteConfiguration(); if (binCfg == null) { binCfg = new BinaryConfiguration(); binCfg.setCompactFooter(false); } igniteCfg.setBinaryConfiguration(binCfg); BinaryContext ctx = new BinaryContext(metaHnd, igniteCfg, new NullLogger()); BinaryMarshaller marsh = new BinaryMarshaller(); marsh.setContext(marshCtx); ctx.configure(marsh, igniteCfg); ctx.registerUserTypesSchema(); return new GridBinaryMarshaller(ctx); } }