本文整理汇总了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;
}
开发者ID:visallo,项目名称:vertexium,代码行数:19,代码来源:KryoFactory.java
示例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;
}
开发者ID:jerrinot,项目名称:subzero,代码行数:16,代码来源:KryoStrategy.java
示例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();
}
开发者ID:apache,项目名称:apex-core,代码行数:16,代码来源:DefaultStatefulStreamCodec.java
示例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;
}
开发者ID:kotcrab,项目名称:vis-editor,代码行数:11,代码来源:KryoUtils.java
示例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;
}
开发者ID:splicemachine,项目名称:spliceengine,代码行数:8,代码来源:KryoPool.java
示例6: statelessKryo
import com.esotericsoftware.kryo.util.MapReferenceResolver; //导入依赖的package包/类
private Kryo statelessKryo() {
return new Kryo(new DefaultClassResolver(), new MapReferenceResolver());
}
开发者ID:hekate-io,项目名称:hekate,代码行数:4,代码来源:KryoCodec.java
示例7: statefulKryo
import com.esotericsoftware.kryo.util.MapReferenceResolver; //导入依赖的package包/类
private Kryo statefulKryo() {
return new Kryo(new NonResettableClassResolver(), new MapReferenceResolver());
}
开发者ID:hekate-io,项目名称:hekate,代码行数:4,代码来源:KryoCodec.java
示例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());
}
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:5,代码来源:Kryo.java
注:本文中的com.esotericsoftware.kryo.util.MapReferenceResolver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论