Interface PersistenceHandler<T>
-
- All Known Implementing Classes:
PersistentItem
public interface PersistenceHandler<T>- Author:
- Daniele Strollo (ISTI-CNR)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddestroy()Requires the destroy of the persistent resource.TgetData()The implementation to retrieve data from the persistence manager.voidonDestroy()When the item need no more to be persisted the refresh loop is closed and this method is invoked.voidonLoad()Automatically invoked by the library at instantiation of persistent items.voidonRefresh()The code to execute once the persistent object is refreshed.voidsetData(T data)Sets the new data to persist.
-
-
-
Method Detail
-
onRefresh
void onRefresh()
The code to execute once the persistent object is refreshed.
-
onLoad
void onLoad()
Automatically invoked by the library at instantiation of persistent items. Used to make initializations before starting the persistence manager.
-
onDestroy
void onDestroy()
When the item need no more to be persisted the refresh loop is closed and this method is invoked.
-
destroy
void destroy()
Requires the destroy of the persistent resource. The persistent file will be deleted and the onDestroy event will be raised.
-
getData
T getData()
The implementation to retrieve data from the persistence manager.- Returns:
-
setData
void setData(T data)
Sets the new data to persist.- Parameters:
data-
-
-