Interface IDataCacheContext


public interface IDataCacheContext

Runtime context for clients to access data caches in its scope. This is used for accessing the data caching framework within the ivy variable in IvyScript snippets

The framework offers caching on three different scopes in whose context the data cache groups and entries are valid. Furthermore, the life cycle of data cache groups and entries is bound to their life cycle. The scopes are the application, the environment and the session.

Application wide caching represents some sort of global cache, its content is valid for the whole application and the same for all actors within the application.

Environment scope should be used when data source is dependent from the tenant. In ivy if Tenant A has his data in data source A and Tenant B in data source B, then the sources are stored in one environment per tenant and the data should be cached per tenant i.e. per environment.

Session scope binds cached data to the user session, i.e. it is valid from the first user request and is at latest invalidated when the user logs off or an inactivation time out is hit. This is the right spot to cache data corresponding to the current interaction or corresponding the user that is logged in

Since:
16.09.2008
API:
This is a public API.
  • Method Details

    • getSessionCache

      IDataCache getSessionCache()
      Returns the cache for the current client session
      Returns:
      the session cache
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
    • getAppCache

      IDataCache getAppCache()
      Returns the data cache for the current application
      Returns:
      the current application data cache
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
    • getEnvironmentCache

      @Deprecated(since="9.4", forRemoval=true) IDataCache getEnvironmentCache()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the data cache for the current environment
      Returns:
      the current environment cache
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
    • current

      static IDataCacheContext current()

      Gets the current data cache context.

      Will return null if called out of scope. The scope is set if you call this method from an ivy process or any supported ivy environment. It is not set in non supported ivy environments (e.g. if you start your own threads, etc.).

      Returns:
      current data cache context or null if out of scope
      Since:
      9.1
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.