public interface CopyProvider extends Service
Service
providing Copier
instances.
The CacheManager
obtains
an instance of this
Service
prior to creating any Cache
instances. Before creating each Cache
instance, the CacheManager
calls the
createKeyCopier(Class, Serializer, ServiceConfiguration[])
and
createValueCopier(Class, Serializer, ServiceConfiguration[])
methods to obtain
Copier
instances supplied to the Cache
.
Modifier and Type | Method and Description |
---|---|
<T> Copier<T> |
createKeyCopier(java.lang.Class<T> clazz,
Serializer<T> serializer,
ServiceConfiguration<?,?>... configs)
Creates a key
Copier with the given parameters. |
<T> Copier<T> |
createValueCopier(java.lang.Class<T> clazz,
Serializer<T> serializer,
ServiceConfiguration<?,?>... configs)
Creates a value
Copier with the given parameters. |
void |
releaseCopier(Copier<?> copier)
Releases the provided
Copier instance. |
<T> Copier<T> createKeyCopier(java.lang.Class<T> clazz, Serializer<T> serializer, ServiceConfiguration<?,?>... configs)
Copier
with the given parameters.T
- the type to copy to/fromclazz
- the class of the type to copy to/fromserializer
- the key serializer configured for the Cache
for which the Copier
is
being created; may be null
. If provided, this serializer may be used
during the copy operation.configs
- specific configurationsnull
Copier
instance<T> Copier<T> createValueCopier(java.lang.Class<T> clazz, Serializer<T> serializer, ServiceConfiguration<?,?>... configs)
Copier
with the given parameters.T
- the type to copy to/fromclazz
- the class of the type to copy to/fromserializer
- the value serializer configured for the Cache
for which the Copier
is
being created; may be null
. If provided, this serializer may be used
during the copy operation.configs
- specific configurationsnull
Copier
instancevoid releaseCopier(Copier<?> copier) throws java.lang.Exception
Copier
instance.
If the copier instance is provided by the user, Closeable.close()
will not be invoked.copier
- the copier instance to be releasedjava.lang.Exception
- when the release fails