How to clear persisted state if application model has changed? [message #1002493] |
Fri, 18 January 2013 12:48  |
Eclipse User |
|
|
|
It's a nice feature that E4 automatically persists the current model on shutdown but sometimes during the development process the application model becomes incompatible with the persisted state.
What I'd like to do is clear the persisted state on startup but only if the application model has changed since the application was last started. Is that possible?
Setting the system property "clearPersistedState" in a life cycle manager seems to work:
@PostContextCreate
public void startup() {
if (isNewApplicationModel()) {
System.setProperty("clearPersistedState", "true");
}
}
What I don't know is how to implement isNewApplicationModel()?
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04026 seconds