|How to use locally cached bundles [message #734271]
||Fri, 07 October 2011 06:47
| Barbara Rosi-Schwartz
Registered: July 2009
In our app's architecture we have a Virgo kernel (the client) which sits on the user's machine and which is associated to a remote Virgo server which is the repository of all up to date bundles. Depending upon the user's specific request, a service in the Virgo client reads the appropriate plan file from the server and deposits a copy of this plan into the client's pickup directory. This in turn triggers download of the required bundles and their activation in the kernel.
This is all working like magic.
However I want to make the code more solid and ensure that the application is instantiated even if the remote Virgo server is temporarily unavailable.
To this end, every time I build a plan file and deposit it in the pickup directory, I also cache it somewhere else so that, next time the user request the same feature, I can check if the server is available and, if not, simply copy the most recently cached plan file from the cache to the pickup directory. However, when this happens, I get a deploy failure because Virgo still looks to download the bundles that are defined in that plan from the remote server, even if it does have those bundles in its work directory.
How do I go about persuading Virgo to use completely local information if the remote server is not available?
Is it a matter of modifying the org.eclipse.virgo.repository.properties file?
My file currently reads as follows:
[Updated on: Fri, 07 October 2011 06:49]
Report message to a moderator
|Re: How to use locally cached bundles [message #734277 is a reply to message #734275]
||Fri, 07 October 2011 07:13
| Glyn Normington
Registered: July 2009
[quote title=Barbara Rosi-Schwartz wrote on Fri, 07 October 2011 12:00]Thanks Glyn.|
What I deposit is the plan file in the pickup directory, and then I let Virgo do its magic in terms of getting bundles and their dependencies.
So a couple of questions:
1) do you mean to say that I need to deposit my plan file in a watched repository or that I need to actually dereference the plan file by hand and deposit the actual bundles in that watched repo?]/quote]
You need to deposit the actual bundles in that watched repo. Admittedly you'd have to parse the plan file to know what bundles you need to cache, but you should be able to use the remote repository service in the client to manage the downloads if you want to.
Alternatively, you might consider extending the current remote repository support so that it can cope with temporary outages of the repository server. That would involve caching the remote index on disk and adding checksums to the remote index for artifacts other than bundles (only bundles get the checksum at the moment and get cached on the client). But maybe that's too much to bite off.
2) if I put the watched repository ahead of the remote one, does this mean that, if I do have a remote server available, my (possibly stale) bundles will be used even if newer ones may be available in the remote Virgo server? This would be an issue, as I use this mechanism not just for dynamic download of lean portions of the app, but also as an update mechanism.
Thanks, as always.
Yes , it does. You would need to increment the bundle version of a bundle on the server in order for the chain search to find it on the repository client.
Powered by FUDForum
. Page generated in 0.01818 seconds