org.qi4j.cache.ehcache

## Class EhCachePoolMixin

- java.lang.Object
- - org.qi4j.cache.ehcache.EhCachePoolMixin

- All Implemented Interfaces:
    ServiceActivation, EhCachePoolService, CachePool

      public abstract class EhCachePoolMixin
      extends Object
      implements EhCachePoolService

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.qi4j.api.service.ServiceActivation

      `ServiceActivation.ServiceActivator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EhCachePoolMixin()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activateService()` Called after ServiceComposite Activation.
    `<T> Cache<T>` | `fetchCache(String cacheId, Class<T> valueType)` Fetches a cache from the pool.
    `void` | `passivateService()` Called before ServiceComposite Passivation.
    `void` | `returnCache(Cache<?> cache)` Returns the cache back to the pool.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EhCachePoolMixin

          public EhCachePoolMixin()

  - ### Method Detail

    - #### fetchCache

          public <T> Cache<T> fetchCache(String cacheId,
                                Class<T> valueType)

      Description copied from interface: `CachePool`
      Fetches a cache from the pool. If the cache does not exist already, then a new Cache should be created and returned. For each fetchCache() call, a reference count on the Cache must be increased.
      Specified by:
        `fetchCache` in interface `CachePool`
      Parameters:
        `cacheId` - The identity of the cache. If the same id is given as a previous fetch, the same cache will be returned.
      Returns:
        The cache fetched from the pool.

    - #### returnCache

          public void returnCache(Cache<?> cache)

      Description copied from interface: `CachePool`
      Returns the cache back to the pool. The reference count for the cache must then be decreased and if the count reaches zero, the Cache should be destroyed and cleared from memory.
      Specified by:
        `returnCache` in interface `CachePool`
      Parameters:
        `cache` - The cache to return to the pool.

    - #### activateService

          public void activateService()
                               throws Exception

      Description copied from interface: `ServiceActivation`
      Called after ServiceComposite Activation.
      Specified by:
        `activateService` in interface `ServiceActivation`
      Throws:
        `Exception`

    - #### passivateService

          public void passivateService()
                                throws Exception

      Description copied from interface: `ServiceActivation`
      Called before ServiceComposite Passivation.
      Specified by:
        `passivateService` in interface `ServiceActivation`
      Throws:
        `Exception`