public class KryoClassListRegistrar extends java.lang.Object implements KryoRegistrar
KryoRegistrar used to register a
list of Java classes. This assigns a sequential registration ID starting with an initial value (50 by default), but
may be configured. This is easiest to set up but requires that every server node be configured with the identical
list in the same order.| Constructor and Description |
|---|
KryoClassListRegistrar(java.util.List<java.lang.Class<?>> classes) |
| Modifier and Type | Method and Description |
|---|---|
void |
registerTypes(com.esotericsoftware.kryo.Kryo kryo)
This method is invoked by the
PojoCodec and
applied to the Kryo instance whenever one is provided. |
void |
setInitialValue(int initialValue)
Set the inital ID value.
|
public KryoClassListRegistrar(java.util.List<java.lang.Class<?>> classes)
classes - the list of classes to registerpublic void setInitialValue(int initialValue)
initialValue - the initial valuepublic void registerTypes(com.esotericsoftware.kryo.Kryo kryo)
KryoRegistrarPojoCodec and
applied to the Kryo instance whenever one is provided. This is currently done using an object pool so it
is inevitable that this method will be invoked repeatedly on the same instance. Kryo registration is idempotent,
but this could become inefficient if registering a large amount of types.registerTypes in interface KryoRegistrarkryo - the provided instance