Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2013-05-15 20:39:14 +0000
committerThomas Watson2013-05-21 19:44:17 +0000
commitec635d407bcd928ff84d2d0a2e22cf3066ab3fd2 (patch)
tree05d0bff8934853142b2a3ed876784c1914a94427 /bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java
parent8f791908bd8cedd1ddfd69fc33c6109763169e6d (diff)
downloadrt.equinox.framework-ec635d407bcd928ff84d2d0a2e22cf3066ab3fd2.tar.gz
rt.equinox.framework-ec635d407bcd928ff84d2d0a2e22cf3066ab3fd2.tar.xz
rt.equinox.framework-ec635d407bcd928ff84d2d0a2e22cf3066ab3fd2.zip
Bug 405918 - [unity] save persistent data after period of inactivity
Add the eclipse.stateSaveDelayInterval property, along with its default value, to EquinoxConfiguration. The configuration is responsible for filling in the default value and type validation. Zero means the state is saved immediately with each update. A negative value means the state is never saved as part of an update. A positive value results in a scheduled task being created that executes every value milliseconds and saves the current state. Add a ScheduledExecutorService to EquinoxContainer with a min pool size of zero and a max size of one. The service is created on init() and shutdown on close(). Add the method updatedDatabase() to ModuleContainerAdaptor. This method is called whenever a database update occurs. The default behavior is to do nothing. The EquinoxContainerAdaptor overrides the method and saves the database state based on the value of the eclipse.stateSaveDelayInterval property. Add the StorageSaver class. It encapsulates the scheduling of the task, registering of the shutdown hook, and determining which type of save is required. This same functionality was removed from EquinoxContainerAdaptor. EquinoxContainer initializes the StorageSaver on init() and disposes of it on close(). EquinoxContainerAdaptor receives the updatedDatabase() call from ModuleDatabase and requests a save by getting the StorageSaver from the container. The osgi.framework.activeThreadType property is obsolete. The framework active thread task is no longer necessary because the ExecutorService maintained by the EquinoxContainer will always have one and only one active, non-daemon thread until system shutdown.
Diffstat (limited to 'bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java')
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java
index 9004269da..56e245068 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java
@@ -216,4 +216,12 @@ public class EquinoxContainerAdaptor extends ModuleContainerAdaptor {
public String toString() {
return container.toString();
}
+
+ @Override
+ public void updatedDatabase() {
+ StorageSaver saver = container.getStorageSaver();
+ if (saver == null)
+ return;
+ saver.save();
+ }
} \ No newline at end of file

Back to the top