Class PojoCodec
java.lang.Object
org.springframework.integration.codec.kryo.AbstractKryoCodec
org.springframework.integration.codec.kryo.PojoCodec
- All Implemented Interfaces:
- Codec
- Direct Known Subclasses:
- MessageCodec
Kryo Codec that can encode and decode arbitrary types. Classes and associated
 
Serializers may be registered via
 KryoRegistrars.- Since:
- 4.2
- Author:
- David Turanski, Artem Bilan
- 
Field SummaryFields inherited from class org.springframework.integration.codec.kryo.AbstractKryoCodecpool
- 
Constructor SummaryConstructorsConstructorDescriptionPojoCodec(List<KryoRegistrar> kryoRegistrars) Create an instance with zero to many KryoRegistrars.PojoCodec(List<KryoRegistrar> kryoRegistrars, boolean useReferences) Create an instance with zero to many KryoRegistrars.PojoCodec(KryoRegistrar kryoRegistrar) Create an instance with a single KryoRegistrar.PojoCodec(KryoRegistrar kryoRegistrar, boolean useReferences) Create an instance with a single KryoRegistrar.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidconfigureKryoInstance(com.esotericsoftware.kryo.Kryo kryo) Subclasses implement this to configure the kryo instance.protected <T> TdoDecode(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<T> type) Subclasses implement this method to decode with Kryo.protected voiddoEncode(com.esotericsoftware.kryo.Kryo kryo, Object object, com.esotericsoftware.kryo.io.Output output) Subclasses implement this method to encode with Kryo.Methods inherited from class org.springframework.integration.codec.kryo.AbstractKryoCodecdecode, decode, encode, encode
- 
Constructor Details- 
PojoCodecpublic PojoCodec()
- 
PojoCodecCreate an instance with a single KryoRegistrar.- Parameters:
- kryoRegistrar- the registrar.
 
- 
PojoCodecCreate an instance with zero to many KryoRegistrars.- Parameters:
- kryoRegistrars- a list KryoRegistrars.
 
- 
PojoCodecCreate an instance with a single KryoRegistrar.- Parameters:
- kryoRegistrar- the registrar.
- useReferences- set to false if references are not required (if the object graph is known to be acyclical). The default is 'true' which is less performant but more flexible.
 
- 
PojoCodecCreate an instance with zero to many KryoRegistrars.- Parameters:
- kryoRegistrars- a list KryoRegistrars.
- useReferences- set to false if references are not required (if the object graph is known to be acyclical). The default is 'true' which is less performant but more flexible.
 
 
- 
- 
Method Details- 
doEncodeprotected void doEncode(com.esotericsoftware.kryo.Kryo kryo, Object object, com.esotericsoftware.kryo.io.Output output) Description copied from class:AbstractKryoCodecSubclasses implement this method to encode with Kryo.- Specified by:
- doEncodein class- AbstractKryoCodec
- Parameters:
- kryo- the Kryo instance
- object- the object to encode
- output- the Kryo Output instance
 
- 
doDecodeprotected <T> T doDecode(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<T> type) Description copied from class:AbstractKryoCodecSubclasses implement this method to decode with Kryo.- Specified by:
- doDecodein class- AbstractKryoCodec
- Type Parameters:
- T- the type for decoded object
- Parameters:
- kryo- the Kryo instance
- input- the Kryo Input instance
- type- the class of the decoded object
- Returns:
- the decoded object
 
- 
configureKryoInstanceprotected void configureKryoInstance(com.esotericsoftware.kryo.Kryo kryo) Description copied from class:AbstractKryoCodecSubclasses implement this to configure the kryo instance. This is invoked on each new Kryo instance when it is created.- Specified by:
- configureKryoInstancein class- AbstractKryoCodec
- Parameters:
- kryo- the Kryo instance
 
 
-