org.qi4j.library.invocationcache

## Class SimpleInvocationCacheMixin

- java.lang.Object
- - org.qi4j.library.invocationcache.SimpleInvocationCacheMixin

- All Implemented Interfaces:
    InvocationCache

      public class SimpleInvocationCacheMixin
      extends Object
      implements InvocationCache

  Simple implementation of InvocationCache.

  This `InvocationCache` should typically not be used at all, and only serves as an example. The @{code cachedValues} member is never emptied, so it constitutes a memory leak if the method arguments keep changing.

  IMPORTANT: Only use this is you know that only a small set of arguments are used into your method(s).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleInvocationCacheMixin()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `cachedValue(String name)`
    `void` | `clearCachedValues()`
    `int` | `currentCacheSize()`
    `Object` | `removeCachedValue(String name)`
    `Object` | `setCachedValue(String name, Object aResult)`

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

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

- - ### Constructor Detail

    - #### SimpleInvocationCacheMixin

          public SimpleInvocationCacheMixin()

  - ### Method Detail

    - #### setCachedValue

          public Object setCachedValue(String name,
                              Object aResult)

      Specified by:
        `setCachedValue` in interface `InvocationCache`

    - #### cachedValue

          public Object cachedValue(String name)

      Specified by:
        `cachedValue` in interface `InvocationCache`

    - #### removeCachedValue

          public Object removeCachedValue(String name)

      Specified by:
        `removeCachedValue` in interface `InvocationCache`

    - #### clearCachedValues

          public void clearCachedValues()

      Specified by:
        `clearCachedValues` in interface `InvocationCache`

    - #### currentCacheSize

          public int currentCacheSize()

      Specified by:
        `currentCacheSize` in interface `InvocationCache`