|
Re: Dynamic PAR extension [message #1405425 is a reply to message #1405417] |
Thu, 07 August 2014 10:25 |
GianMaria Romanato Messages: 72 Registered: July 2009 |
Member |
|
|
Hello,
the message is a bit confusing as the title refers to a PAR, but the body speaks about a PLAN.
In any case, assuming that PLAN is fine, unless you declare your PLAN as scoped, its content (exported packages, published OSGi services) will be visible to the whole container and similarly, bundles in the PLAN will be able to use OSGi services deployed by any other bundle included in any other non-scoped plan.
<?xml version="1.0" encoding="UTF-8"?>
<plan name="application.plan" version="1.0.0" scoped="false" atomic="true"
xmlns="http://www.springsource.org/schema/dm-server/plan"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springsource.org/schema/dm-server/plan
http://www.springsource.org/schema/dm-server/plan/springsource-dm-server-plan.xsd">
<artifact type="bundle" name="app.bundle.1"/>
<artifact type="bundle" name="app.bundle.2"/>
....
</plan>
So you could have your main application deployed as a non scoped plan.
When you want to hot-deploy a plug-in, just upload its bundles to a Virgo bundle repository (make sure it is declared as watched, see configuration/org.eclipse.virgo.repository.properties), then drop the plug-in plan in the pickup folder or upload it via the Virgo console and make sure it is not scoped aswell:
<?xml version="1.0" encoding="UTF-8"?>
<plan name="plugin.plan" version="1.0.0" scoped="false" atomic="true"
xmlns="http://www.springsource.org/schema/dm-server/plan"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springsource.org/schema/dm-server/plan
http://www.springsource.org/schema/dm-server/plan/springsource-dm-server-plan.xsd">
<artifact type="bundle" name="plugin.bundle.1"/>
...
</plan>
If your application code uses some dynamic discovery mechanism such as the OSGi Service Registry and ServiceTracker(s), blue-prints or the Equinox Registry, once the plug-in plan is deployed and its bundles activated the application bundles will be able to use the plug-in code.
Giamma.
Developing for Virgo using PDE: http://bit.ly/1w0tTit
Global JNDI in Virgo: http://bit.ly/1to42mn
Hyperic to monitor Virgo: http://bit.ly/W1Fst9
Profile Virgo with JProfiler http://bit.ly/1FBLGCw
[Updated on: Thu, 07 August 2014 10:25] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02849 seconds