Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Dynamic PAR extension
Dynamic PAR extension [message #1405417] Thu, 07 August 2014 09:55 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 9
Registered: March 2011
Junior Member
Hi,

I'm new to Virgo and I would like to know if it's possible to dynamically (in production) extend a Plan ?
The idea is to have a "core" application and provide a plugin like mechanism where plugins can be added from the "core" application at runtime (like we can do in Confluence product)

Thanks for any feedback
Re: Dynamic PAR extension [message #1405425 is a reply to message #1405417] Thu, 07 August 2014 10:25 Go to previous messageGo to next message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
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

Re: Dynamic PAR extension [message #1405429 is a reply to message #1405425] Thu, 07 August 2014 10:30 Go to previous message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 9
Registered: March 2011
Junior Member
Yes it was about PLAN Sad

And thanks for answer
Previous Topic:VIRGO OSGI
Next Topic:Cannot declare service
Goto Forum:
  


Current Time: Thu Apr 25 17:50:53 GMT 2024

Powered by FUDForum. Page generated in 0.02968 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top