public class RemoteDataCache<DataType>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected xal.extension.service.RemoteData<DataType> |
_cachedData
latest data that has been cached
|
Constructor and Description |
---|
RemoteDataCache(java.util.concurrent.Callable<DataType> remoteOperation)
Constructor
|
RemoteDataCache(java.util.concurrent.Callable<DataType> remoteOperation,
UpdateListener updateHandler)
Primary Constructor
|
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getTimestamp()
Get the timestamp of the last fetch
|
UpdateListener |
getUpdateListener()
get the update handler
|
DataType |
getValue()
Fetch the value and cache it for future requests
|
boolean |
isConnected()
determine whether the remote service is connected
|
void |
refresh()
Refresh the cache with a fresh call to the remote unless a fetch is already pending
|
void |
setUpdateListener(UpdateListener handler)
set the update handler which is called when the cache has been updated
|
protected volatile xal.extension.service.RemoteData<DataType> _cachedData
public RemoteDataCache(java.util.concurrent.Callable<DataType> remoteOperation)
public RemoteDataCache(java.util.concurrent.Callable<DataType> remoteOperation, UpdateListener updateHandler)
public void setUpdateListener(UpdateListener handler)
public UpdateListener getUpdateListener()
public void refresh()
public java.util.Date getTimestamp()
public DataType getValue()
public boolean isConnected()