org.appng.core.service.cache

## Class CacheEntryListener

- java.lang.Object
- - org.appng.core.service.cache.CacheEntryListener

- All Implemented Interfaces:
    Serializable, EventListener, javax.cache.event.CacheEntryCreatedListener<String,CachedResponse>, javax.cache.event.CacheEntryExpiredListener<String,CachedResponse>, javax.cache.event.CacheEntryListener<String,CachedResponse>, javax.cache.event.CacheEntryRemovedListener<String,CachedResponse>

      public class CacheEntryListener
      extends Object
      implements javax.cache.event.CacheEntryCreatedListener<String,CachedResponse>, javax.cache.event.CacheEntryRemovedListener<String,CachedResponse>, javax.cache.event.CacheEntryExpiredListener<String,CachedResponse>, Serializable

  A `CacheEntryListener` that keeps track of the caches's keys. Used in `CacheService` to make it possible to expire cache elements by their key without having to iterate over all the values (which is slow for large caches).
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CacheEntryListener()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `Set<String>` | `getKeys()`
    `Set<String>` | `getKeys(String prefix)`
    `void` | `onCreated(Iterable<javax.cache.event.CacheEntryEvent<? extends String,? extends CachedResponse>> events)`
    `void` | `onExpired(Iterable<javax.cache.event.CacheEntryEvent<? extends String,? extends CachedResponse>> events)`
    `void` | `onRemoved(Iterable<javax.cache.event.CacheEntryEvent<? extends String,? extends CachedResponse>> events)`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### CacheEntryListener

          public CacheEntryListener()

  - ### Method Detail

    - #### onCreated

          public void onCreated(Iterable<javax.cache.event.CacheEntryEvent<? extends String,? extends CachedResponse>> events)
                         throws javax.cache.event.CacheEntryListenerException

      Specified by:
        `onCreated` in interface `javax.cache.event.CacheEntryCreatedListener<String,CachedResponse>`
      Throws:
        `javax.cache.event.CacheEntryListenerException`

    - #### onExpired

          public void onExpired(Iterable<javax.cache.event.CacheEntryEvent<? extends String,? extends CachedResponse>> events)
                         throws javax.cache.event.CacheEntryListenerException

      Specified by:
        `onExpired` in interface `javax.cache.event.CacheEntryExpiredListener<String,CachedResponse>`
      Throws:
        `javax.cache.event.CacheEntryListenerException`

    - #### onRemoved

          public void onRemoved(Iterable<javax.cache.event.CacheEntryEvent<? extends String,? extends CachedResponse>> events)
                         throws javax.cache.event.CacheEntryListenerException

      Specified by:
        `onRemoved` in interface `javax.cache.event.CacheEntryRemovedListener<String,CachedResponse>`
      Throws:
        `javax.cache.event.CacheEntryListenerException`

    - #### clear

          public void clear()

    - #### getKeys

          public Set<String> getKeys()

    - #### getKeys

          public Set<String> getKeys(String prefix)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.