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 Details

    • createKeyCopier

      <T> Copier<T> createKeyCopier(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(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 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:
      Exception - when the release fails