HHH-10306 Plug Externalizers via module initializer
This commit is contained in:
parent
603059b640
commit
c4d5e3b950
|
@ -493,7 +493,6 @@ public class InfinispanRegionFactory implements RegionFactory {
|
|||
.globalJmxStatistics()
|
||||
.enabled( Boolean.parseBoolean( globalStats ) );
|
||||
}
|
||||
holder.getGlobalConfigurationBuilder().serialization().addAdvancedExternalizer(Externalizers.ALL_EXTERNALIZERS);
|
||||
|
||||
return createCacheManager( holder );
|
||||
}
|
||||
|
|
|
@ -29,17 +29,6 @@ public class Externalizers {
|
|||
public final static int VERSIONED_ENTRY = 1206;
|
||||
public final static int EXCLUDE_EMPTY_EXTRACT_VALUE = 1207;
|
||||
|
||||
public final static AdvancedExternalizer[] ALL_EXTERNALIZERS = new AdvancedExternalizer[] {
|
||||
new UUIDExternalizer(),
|
||||
new Tombstone.Externalizer(),
|
||||
new Tombstone.ExcludeTombstonesFilterExternalizer(),
|
||||
new TombstoneUpdate.Externalizer(),
|
||||
new FutureUpdate.Externalizer(),
|
||||
new FutureUpdate.ValueExtractorExternalizer(),
|
||||
new VersionedEntry.Externalizer(),
|
||||
new VersionedEntry.ExcludeEmptyExtractValueExternalizer()
|
||||
};
|
||||
|
||||
public static class UUIDExternalizer implements AdvancedExternalizer<UUID> {
|
||||
|
||||
@Override
|
||||
|
|
25
hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/LifecycleCallbacks.java
vendored
Normal file
25
hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/LifecycleCallbacks.java
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
package org.hibernate.cache.infinispan.util;
|
||||
|
||||
import org.infinispan.commons.marshall.AdvancedExternalizer;
|
||||
import org.infinispan.configuration.global.GlobalConfiguration;
|
||||
import org.infinispan.factories.GlobalComponentRegistry;
|
||||
import org.infinispan.lifecycle.AbstractModuleLifecycle;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class LifecycleCallbacks extends AbstractModuleLifecycle {
|
||||
|
||||
@Override
|
||||
public void cacheManagerStarting(GlobalComponentRegistry gcr, GlobalConfiguration globalCfg) {
|
||||
Map<Integer, AdvancedExternalizer<?>> externalizerMap = globalCfg.serialization().advancedExternalizers();
|
||||
externalizerMap.put( Externalizers.UUID, new Externalizers.UUIDExternalizer() );
|
||||
externalizerMap.put( Externalizers.TOMBSTONE, new Tombstone.Externalizer() );
|
||||
externalizerMap.put( Externalizers.EXCLUDE_TOMBSTONES_FILTER, new Tombstone.ExcludeTombstonesFilterExternalizer() );
|
||||
externalizerMap.put( Externalizers.TOMBSTONE_UPDATE, new TombstoneUpdate.Externalizer() );
|
||||
externalizerMap.put( Externalizers.FUTURE_UPDATE, new FutureUpdate.Externalizer() );
|
||||
externalizerMap.put( Externalizers.VALUE_EXTRACTOR, new FutureUpdate.ValueExtractorExternalizer() );
|
||||
externalizerMap.put( Externalizers.VERSIONED_ENTRY, new VersionedEntry.Externalizer() );
|
||||
externalizerMap.put( Externalizers.EXCLUDE_EMPTY_EXTRACT_VALUE, new VersionedEntry.ExcludeEmptyExtractValueExternalizer() );
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
org.hibernate.cache.infinispan.util.LifecycleCallbacks
|
Loading…
Reference in New Issue