Package org.ehcache.spi.copy
Interface CopyProvider
-
- All Superinterfaces:
Service
public interface CopyProvider extends Service
AServiceprovidingCopierinstances.The
CacheManagerobtainsan instance of thisServiceprior to creating anyCacheinstances. Before creating eachCacheinstance, theCacheManagercalls thecreateKeyCopier(Class, Serializer, ServiceConfiguration[])andcreateValueCopier(Class, Serializer, ServiceConfiguration[])methods to obtainCopierinstances supplied to theCache.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Copier<T>createKeyCopier(java.lang.Class<T> clazz, Serializer<T> serializer, ServiceConfiguration<?,?>... configs)Creates a keyCopierwith the given parameters.<T> Copier<T>createValueCopier(java.lang.Class<T> clazz, Serializer<T> serializer, ServiceConfiguration<?,?>... configs)Creates a valueCopierwith the given parameters.voidreleaseCopier(Copier<?> copier)Releases the providedCopierinstance.
-
-
-
Method Detail
-
createKeyCopier
<T> Copier<T> createKeyCopier(java.lang.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(java.lang.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
void releaseCopier(Copier<?> copier) throws java.lang.Exception
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:
java.lang.Exception- when the release fails
-
-