Here is a more complete HOW TO with OSGi to relaod a bundle:

For folks working in APPC or SDNC, when developing, note you don't have to 
rebuild and bbounce the container each time.
With OSGi you have the functionality to watch a given bundle, so when the 
underlying jar changes, it reloads it.
Here is the trick:
1. Find the bbundle id you're interested in to reload; e.g. the piece you're 
developing.

```opendaylight-user@root>bundle:list | grep blueprint
200 | Active   |  80 | 0.3.0.SNAPSHOT                         | 
blueprints-assignment-provider
201 | Active   |  80 | 0.3.0.SNAPSHOT                         | 
blueprints-data-adaptor-provider
202 | Active   |  80 | 0.3.0.SNAPSHOT                         | 
blueprints-generator-provider
203 | Active   |  80 | 0.3.0.SNAPSHOT                         | 
blueprints-model-provider
204 | Active   |  80 | 0.3.0.SNAPSHOT                         | 
blueprints-rest-adaptor-provider```

For instance, here, bbundle id 203 is the one of interest.
Then intstruct OSGi to watch the bundle

```opendaylight-user@root>bundle:watch 203
Watched URLs/IDs:
203```

That's what is telling OSGi to reload the bundle if the underlying jar is 
change in the system/ folder of ODLThen bbuild locally the new jar, and cp it 
at the right location, example:

```$ kubectl cp 
/Users/adetalhouet/.m2/repository/org/onap/ccsdk/features/blueprints-model-provider/0.3.0-SNAPSHOT/blueprints-model-provider-0.3.0-SNAPSHOT.jar
 
onap-sdnc-sdnc-0:/opt/opendaylight/system/org/onap/ccsdk/features/blueprints-model-provider/0.3.0-SNAPSHOT/blueprints-model-provider-0.3.0-SNAPSHOT.jar```

Kaboom, OSGi reloads your jar, and restart dependent bundle respecting the 
hierachie chain

Cheers, hope this will save some development cycles :)

> On Sep 20, 2018, at 5:54 PM, Steve Siani 
> <alphonse.steve.siani.djissit...@ibm.com> wrote:
> 
> This seems more fast.
> 
> I will try it.
> 
> Thanks Alexis!
> 
> /Steve
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#12672): https://lists.onap.org/g/onap-discuss/message/12672
Mute This Topic: https://lists.onap.org/mt/25759196/21656
Mute #appc: https://lists.onap.org/mk?hashtag=appc&subid=2740164
Group Owner: onap-discuss+ow...@lists.onap.org
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to