本文整理汇总了Java中com.esotericsoftware.kryo.util.MapReferenceResolver类的典型用法代码示例。如果您正苦于以下问题:Java MapReferenceResolver类的具体用法?Java MapReferenceResolver怎么用?Java MapReferenceResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MapReferenceResolver类属于com.esotericsoftware.kryo.util包,在下文中一共展示了MapReferenceResolver类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createKryo
import com.esotericsoftware.kryo.util.MapReferenceResolver; //导入依赖的package包/类
public Kryo createKryo() {
Kryo kryo = new Kryo(new DefaultClassResolver(), new MapReferenceResolver() {
@Override
public boolean useReferences(Class type) {
// avoid calling System.identityHashCode
if (type == String.class || type == Date.class) {
return false;
}
return super.useReferences(type);
}
});
registerClasses(kryo);
kryo.setAutoReset(true);
kryo.setInstantiatorStrategy(new Kryo.DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
return kryo;
}
示例2: newKryoInstance
import com.esotericsoftware.kryo.util.MapReferenceResolver; //导入依赖的package包/类
private Kryo newKryoInstance() {
Kryo kryo;
if (IGNORE_HAZELCAST_CLASSLOADER) {
kryo = new Kryo();
} else {
ClassLoader classLoader = ClassLoaderUtils.getConfiguredClassLoader(hazelcastInstance);
DelegatingClassResolver classResolver = new DelegatingClassResolver(classLoader);
MapReferenceResolver mapReferenceResolver = new MapReferenceResolver();
DefaultStreamFactory defaultStreamFactory = new DefaultStreamFactory();
kryo = new Kryo(classResolver, mapReferenceResolver, defaultStreamFactory);
}
registerCustomSerializers(kryo);
kryo.setInstantiatorStrategy(new Kryo.DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
return kryo;
}
示例3: DefaultStatefulStreamCodec
import com.esotericsoftware.kryo.util.MapReferenceResolver; //导入依赖的package包/类
@SuppressWarnings("OverridableMethodCallInConstructor")
public DefaultStatefulStreamCodec()
{
super(new ClassResolver(), new MapReferenceResolver());
data = new Output(4096, Integer.MAX_VALUE);
state = new Output(4096, Integer.MAX_VALUE);
input = new Input();
register(Class.class);
register(ClassIdPair.class);
classResolver = (ClassResolver)getClassResolver();
this.pairs = classResolver.pairs;
classResolver.init();
dataStatePair = new DataStatePair();
}
示例4: getCommonSettingsKryo
import com.esotericsoftware.kryo.util.MapReferenceResolver; //导入依赖的package包/类
public static Kryo getCommonSettingsKryo () {
Kryo kryo = new Kryo(new VisKryoClassResolver(), new MapReferenceResolver());
kryo.setInstantiatorStrategy(new DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
kryo.setDefaultSerializer(new SettingsSerializerFactory());
kryo.register(Array.class, new ArraySerializer(), 10);
kryo.register(UUID.class, new UUIDSerializer(), 12);
kryo.register(Color.class, new ColorSerializer(), 11);
kryo.register(Texture.TextureFilter.class, 13);
return kryo;
}
示例5: newInstance
import com.esotericsoftware.kryo.util.MapReferenceResolver; //导入依赖的package包/类
@Override
public Kryo newInstance() {
Kryo next = new Kryo(new DefaultClassResolver(),new MapReferenceResolver());
if(kryoRegistry!=null)
kryoRegistry.register(next);
return next;
}
示例6: statelessKryo
import com.esotericsoftware.kryo.util.MapReferenceResolver; //导入依赖的package包/类
private Kryo statelessKryo() {
return new Kryo(new DefaultClassResolver(), new MapReferenceResolver());
}
示例7: statefulKryo
import com.esotericsoftware.kryo.util.MapReferenceResolver; //导入依赖的package包/类
private Kryo statefulKryo() {
return new Kryo(new NonResettableClassResolver(), new MapReferenceResolver());
}
示例8: Kryo
import com.esotericsoftware.kryo.util.MapReferenceResolver; //导入依赖的package包/类
/** Creates a new Kryo with a {@link DefaultClassResolver} and a {@link MapReferenceResolver}. */
public Kryo () {
this(new DefaultClassResolver(), new MapReferenceResolver(), new DefaultStreamFactory());
}