public class TimeSliceDefaultCacheProvider extends TimeSliceAbstractCacheProvider
This implementation uses a singleton (TimeSlicePersistence) which maintains a list of cache names and for each cache name a cache of time slices. This provider exposes methods that will call into the persistence for common usage; get and put.
In the adapter configuration file this class is aliased as time-slice-default-cache-provider which is the preferred alternative to the fully qualified classname when building your configuration.
CURRENT_TIME_SLICE_END_KEY, CURRENT_TIME_SLICE_MESSAGE_COUNT_KEY
Constructor and Description |
---|
TimeSliceDefaultCacheProvider() |
Modifier and Type | Method and Description |
---|---|
TimeSlice |
get(java.lang.String cacheName)
Will return the current time slice.
|
TimeSlicePersistence |
getPersistence() |
void |
init()
Once the adapter component initializes, any interceptors including any
cache providers will also be initialized.
|
void |
start()
Once the adapter component starts, any interceptors including any
cache providers will also be started.
|
void |
stop()
Once the adapter component stops, any interceptors including any
cache providers will also be stopped.
|
void |
update(java.lang.String cacheName,
TimeSlice timeslice)
Will persist the time slice for later retrieval.
|
setTimeSliceDurationMilliseconds, timeSliceDurationMilliseconds
public void start() throws CoreException
TimeSliceCacheProvider
CoreException
public void init() throws CoreException
TimeSliceCacheProvider
CoreException
public void stop()
TimeSliceCacheProvider
public TimeSlice get(java.lang.String cacheName)
TimeSliceCacheProvider
public void update(java.lang.String cacheName, TimeSlice timeslice)
TimeSliceCacheProvider
public TimeSlicePersistence getPersistence()