Hi, 

I am currently working on POCs to check whether we will be able to use OSGI
in my current project, that deals with a framework development using thick
client. If things go well, OSGI will be used for the kernel implementation
of the framework.

My requirement is something like this:
I will have to fetch a bundle(and its dependent bundles) on demand, from a
repository and deploy them in  my OSGI runtime. The order of looking up is:
First, it will look into my local repository, if it finds that   particular
bundle, it fetches it. Otherwise it looks into the remote repository and so
on. Once a bundle(s) have been deployed, it should be available in the local
repository for future reference.

What I have done so far:
I am using felix as an OSGI implementation. I am having a local OBR and a
remote OBR. I have generated the repository.xmls using Bindex tool.
Local obr    : Bundle1-1.0.0, Bundle3-1.0.0
Remote obr : Bundle2-1.0.0, Bundle3-1.0.1
Dependency: Bundle1 depends on Bundle3 and Bundle3 depends on
Bundle2.(B1->B3->B2)

This a code snippet in one of the bundles that I deploy:
RepositoryAdmin repoAdmin = (RepositoryAdmin)serviceTracker.getService();
repoAdmin.addRepository(localRepositoryURL);
repoAdmin.addRepository(remoteRepositoryURL);
Resource[] resources =
repoAdmin.discoverResources("(|(symbolicname=Bundle1))");
Resolver resolver = repoAdmin.resolver();
if (resolver.resolve())
{
   resolver.deploy(true);
}

What is happening as of now:
Bundles Bundle1-1.0.0, Bundle2-1.0.0 and Bundle3-1.0.1 gets installed in my
OSGI runtime and I can see all these jars in the cache directory I did set
using configMap.put(BundleCache.CACHE_PROFILE_DIR_PROP, "E:/cache");
This is what was expected, and is working properly. 

But, this is what I want, and cant achieve:
Bundle2-1.0.0 and Bundle3-1.0.1 do not get installed in my local OBR. So,
when I uninstall these bundles from my virtual machine(it gets removed from
the cache), all the bundles again needs to get fetched from the remote URL
with the next reference of Bundle1.

Can you please give me some pointers about how I can retain the bundles
installed in OSGI virtual machine in some local OBR(residing on same
machine); so that even after it has been uninstalled from the runtime;  the
jars won't have to be fetched from the remote OBR. I understand, that I need
to regenerate my local repository.xml with every installation in local
repository, if it happens.

I have not used OSGI in any of my previous applications, so an elaborate
answer is highly appreciated.

thanks,
krish
-- 
View this message in context: 
http://www.nabble.com/Retaining-bundles-installed-in-OSGI-virtual-machine-from-remote-OBR%2C-in-local-OBR-tp19033664p19033664.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to