public interface SerializationProvider extends Service
Serializer
for a given type.Modifier and Type | Method and Description |
---|---|
<T> Serializer<T> |
createKeySerializer(java.lang.Class<T> clazz,
java.lang.ClassLoader classLoader,
ServiceConfiguration<?>... configs)
Creates a key
Serializer with the given parameters. |
<T> Serializer<T> |
createValueSerializer(java.lang.Class<T> clazz,
java.lang.ClassLoader classLoader,
ServiceConfiguration<?>... configs)
Creates a value
Serializer with the given parameters. |
void |
releaseSerializer(Serializer<?> serializer)
Releases the given
Serializer instance |
<T> Serializer<T> createKeySerializer(java.lang.Class<T> clazz, java.lang.ClassLoader classLoader, ServiceConfiguration<?>... configs) throws UnsupportedTypeException
Serializer
with the given parameters.T
- the type serialized to serialize to/fromclazz
- the class of the type to serialize to/fromclassLoader
- the classloader to useconfigs
- specific configurationSerializer
instanceUnsupportedTypeException
- if a serializer cannot be created for the given type<T> Serializer<T> createValueSerializer(java.lang.Class<T> clazz, java.lang.ClassLoader classLoader, ServiceConfiguration<?>... configs) throws UnsupportedTypeException
Serializer
with the given parameters.T
- the type serialized to serialize to/fromclazz
- the class of the type to serialize to/fromclassLoader
- the classloader to useconfigs
- specific configurationSerializer
instanceUnsupportedTypeException
- if a serializer cannot be created for the given typevoid releaseSerializer(Serializer<?> serializer) throws java.lang.Exception
Serializer
instanceserializer
- the serializer to be releasedjava.lang.Exception
- when the release fails