public static void configureSerialization(StoreProperties props, SerializationConfigurationBuilder builder) { StreamingMarshaller marshaller = getMarshaller(props); builder.marshaller(marshaller); configureExternalizers(props, builder); }
public static void amendMarshaller(GlobalConfigurationBuilder builder) { if (MARSHALLER != null) { try { Marshaller marshaller = Util.getInstanceStrict(MARSHALLER, Thread.currentThread().getContextClassLoader()); builder.serialization().marshaller(marshaller); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { // No-op, stick to GlobalConfiguration default. } } }
public void testConfigureMarshaller() { GlobalConfigurationBuilder gc = new GlobalConfigurationBuilder(); TestObjectStreamMarshaller marshaller = new TestObjectStreamMarshaller(); gc.serialization().marshaller(marshaller); withCacheManager(new CacheManagerCallable( createCacheManager(gc, new ConfigurationBuilder())) { @Override public void call() { cm.getCache(); } }); marshaller.stop(); }
protected EmbeddedCacheManager addClusterEnabledCacheManager(TransportFlags flags, GlobalConfigurationBuilder gcb, ConfigurationBuilder builder) { GlobalConfigurationBuilder clone = GlobalConfigurationBuilder.defaultClusteredBuilder(); //get the transport here as clone.read below would inject the same transport reference into the clone // which we don't want Transport transport = clone.transport().getTransport(); Marshaller marshaller = clone.serialization().getMarshaller(); clone.read(gcb.build()); clone.transport().transport(transport); clone.serialization().marshaller(marshaller); clone.transport().clusterName("ISPN(SITE " + siteName + ")"); EmbeddedCacheManager cm = TestCacheManagerFactory.createClusteredCacheManager(clone, builder, flags); cacheManagers.add(cm); return cm; }
builder.serialization().marshaller(Util.<Marshaller>getInstance(value, holder.getClassLoader())); break;