# Provider Events

Each cache provider has the potential of announcing life cycle events as it implements it. If you are a cache provider author, then you can use the aggregated `EventManager` to register, process and announce events a-la-carte. So let's investigate each provider's life cycle events:

## CacheBoxProvider-CacheBoxColdBoxProvider Events

| Event                    | Data                                                                                                                                                                                                                                                                                                                                   | Description                                                                                                          |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| afterCacheElementUpdated | <p><strong>cache</strong>: the cache provider<br><br><strong>cacheNewObject</strong>: the new object to cache<br><br><strong>cacheOldObject</strong>: the object replaced</p>                                                                                                                                                          | Called via a `set()` operation when there is already the same key in the cache. Called before the replacement occurs |
| afterCacheElementInsert  | <p><strong>cache</strong>: the cache provider<br><br><strong>cacheObject</strong>: the new object to cache<br><br><strong>cacheObjectKey</strong>: the key used to store the object<br><br><strong>cacheObjectTimeout</strong>: the timeout used<br><br><strong>cacheObjectLastAccessTimeout</strong>:the last access timeout used</p> | Called after a new cache element has been inserted into the cache                                                    |
| afterCacheElementRemoved | <p><strong>cache</strong>: the cache provdier<br><br><strong>cacheObjectKey</strong>: the key of the removed object</p>                                                                                                                                                                                                                | Called after a cache element has been removed from the cache                                                         |
| afterCacheClearAll       | **cache**: the cache provider                                                                                                                                                                                                                                                                                                          | Called after a `clearAll()` has been issued on the cache                                                             |
| afterCacheElementExpired | <p><strong>cache</strong>: the cache provider<br><br><strong>cacheObjectKey</strong>: the key of the expired object</p>                                                                                                                                                                                                                | Called after a cache element has been expired from the cache                                                         |

## CFProvider-CFColdboxProvider Events

| Event                    | Data                                                                                                                                                                                                                                                                                                                                      | Description                                                       |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| afterCacheElementInsert  | <p><strong>cache</strong>: the cache provider<br><br> <strong>cacheObject</strong>: the new object to cache<br><br> <strong>cacheObjectKey</strong>: the key used to store the object<br><br><strong>cacheObjectTimeout</strong>: the timeout used<br><br><strong>cacheObjectLastAccessTimeout</strong>: the last access timeout used</p> | Called after a new cache element has been inserted into the cache |
| afterCacheElementRemoved | <p><strong>cache</strong>: the cache provider<br><br> <strong>cacheObjectKey</strong>: the key of the removed object</p>                                                                                                                                                                                                                  | Called after a cache element has been removed from the cache      |
| afterCacheClearAll       | **cache**: the cache provider                                                                                                                                                                                                                                                                                                             | Called after a `clearAll()` has been issued on the cache          |
