|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
update mechanism: tasks to be executed alwaysHi,
one of the missing bits in the update mechanism is still the ability of executing a list of tasks independently of the installed version. Running update tasks based on a version number is fine, but having the ability of automatically running a list of consistency check (and fix) tasks is sometime better and more robust. Taking as an example the cache module, it recently needed the addiction of cache voters configuration in jcr. At this moment if the cache voters configuration is missing it will ungracefully die with a NPE. Now: when to add cache voter configuration? Using the current API I should do it in basic install tasks and, implementing ModuleVersionHandler, also return this task based on version passed to getDeltas(). This pretty work but handling a previous version number could be not so easy (from which version should I add this configuration?) and doesn't handle the fact that if this configuration is removed from an existing repository, nobody will ever set it back and the manager will keep throwing its NPE. This kind of operations could be probably handled better by a Task that is always called and that bases its execution of the conditional presence of an existing configuration. For this example I would like to simply have a task that automatically adds the voters configuration ONLY IF a voters configuration is missing. This will handle install, update, and check/restore of any invalid configuration. Differently from what happens with standard update tasks this kind of tasks should not require manual intervention (they will be run at each restart) and should be silently executed after update and before starting the module. Coming to the point: I would like to add support in ModuleVersionHandler for tasks that will always be executed AFTER install/update, BEFORE start and WITHOUT user intervention. This would mean adding a method like: List getUnconditionalTasks(InstallContext installContext); to ModuleVersionHandler and make it called it in ModuleManagerImpl WDYT? Is there any objection on this? fabrizio ---------------------------------------------------------------- for list details see http://documentation.magnolia.info/docs/en/editor/stayupdated.html ---------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |