Package org.ehcache.spi.copy
Interface CopyProvider
- All Superinterfaces:
Service
A
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.
-
Method Summary
Modifier and TypeMethodDescription<T> Copier<T>createKeyCopier(Class<T> clazz, Serializer<T> serializer, ServiceConfiguration<?, ?>... configs) Creates a keyCopierwith the given parameters.<T> Copier<T>createValueCopier(Class<T> clazz, Serializer<T> serializer, ServiceConfiguration<?, ?>... configs) Creates a valueCopierwith the given parameters.voidreleaseCopier(Copier<?> copier) Releases the providedCopierinstance.
-
Method Details
-
createKeyCopier
<T> Copier<T> createKeyCopier(Class<T> clazz, Serializer<T> serializer, ServiceConfiguration<?, ?>... configs) Creates a keyCopierwith the given parameters.- Type Parameters:
T- the type to copy to/from- Parameters:
clazz- the class of the type to copy to/fromserializer- the key serializer configured for theCachefor which theCopieris being created; may benull. If provided, this serializer may be used during the copy operation.configs- specific configurations- Returns:
- a non
nullCopierinstance
-
createValueCopier
<T> Copier<T> createValueCopier(Class<T> clazz, Serializer<T> serializer, ServiceConfiguration<?, ?>... configs) Creates a valueCopierwith the given parameters.- Type Parameters:
T- the type to copy to/from- Parameters:
clazz- the class of the type to copy to/fromserializer- the value serializer configured for theCachefor which theCopieris being created; may benull. If provided, this serializer may be used during the copy operation.configs- specific configurations- Returns:
- a non
nullCopierinstance
-
releaseCopier
Releases the providedCopierinstance. If the copier instance is provided by the user,Closeable.close()will not be invoked.- Parameters:
copier- the copier instance to be released- Throws:
Exception- when the release fails
-