org.ehcache.spi.copy
Interface CopyProvider

All Superinterfaces:
Service

public interface CopyProvider
extends 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
<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.
 
Methods inherited from interface org.ehcache.spi.service.Service
start, stop
 

Method Detail

createKeyCopier

<T> Copier<T> createKeyCopier(java.lang.Class<T> clazz,
                              Serializer<T> serializer,
                              ServiceConfiguration<?>... configs)
Creates a key Copier with the given parameters.

Type Parameters:
T - the type to copy to/from
Parameters:
clazz - the class of the type to copy to/from
serializer - 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 configurations
Returns:
a non null Copier instance

createValueCopier

<T> Copier<T> createValueCopier(java.lang.Class<T> clazz,
                                Serializer<T> serializer,
                                ServiceConfiguration<?>... configs)
Creates a value Copier with the given parameters.

Type Parameters:
T - the type to copy to/from
Parameters:
clazz - the class of the type to copy to/from
serializer - 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 configurations
Returns:
a non null Copier instance

releaseCopier

void releaseCopier(Copier<?> copier)
                   throws java.lang.Exception
Releases the provided Copier instance. 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