java


When should osgi refresh be done?


Today I came across a situation when I updated bundle however the program continued working as there was no any changes in code. After some reading I understood that I have to do osgi refresh - the following code (found on SO):
Bundle systemBundle = bundleContext.getBundle(0);
FrameworkWiring frameworkWiring = systemBundle.adapt(FrameworkWiring.class);
frameworkWiring.refreshBundles(null);
So my question - when should I do osgi refresh? Only after update? After each bundle update or I can update N bundles and after that do refresh?
OSGi refresh needs to be done when you want OSGi to reinitialize wirings between packages. Usually this is needed after upgrading/downgrading some bundle's version.
You may find also useful: What do these OSGi commands really do?
or I can update N bundles and after that do refresh?
If not deeping into details, that's the answer to your question. In practice, I observed situations when some frameworks which are not well adopted to OSGi, may cause ClassLoader memory leaks at the time of refresh, so be careful.

Related Links

Problems with projectiles on a 2d plane
Why does getting a missing key from java.util.HashMap[Long,Long] return 0L?
Passing HTML code to browser via java
Morphia changes className when updating fields from entity subclass
Check carry from long operation in java
How can I exclude some attributes with JAXB to be convertet to xml
Convert a text with special unicode to normal text (java)
how to access a struts2 property value in jsp?
Android - no such collation sequence: SQL_Latin1_General_CP1_CI_AS
Unable to instantiate an error in hive
Check the value of image is valid? or not?
Struts2 : ognl.MethodFailedException: Method “setMontant” failed for object dao.Operation#1ed5095
creating an array of variables
calling java program from Jsp on click
Java program runs fine in Eclipse but not as a .jar file
Java - How to use a Layout Manager in only a part of the window?

Categories

HOME
client
openlayers
image
debugging
urbancode
react-virtualized
include
platform-builder
filtering
basic
slick-slider
reveal.js
google-cloud-spanner
php-7.1
moonmail
phaser
orchardcms
visual-studio-cordova
jsdoc
pugjs
sms-gateway
cx-freeze
mps
wkwebview
dcevm
extjs5
centos6.5
user-interaction
internet-explorer-9
minitab
elasticsearch-ruby
stormpath
twilio-api
google-qpx-express-api
repo
subset-sum
wallpaper
appfabric
jquery-bootgrid
espeak
unspecified
nomethoderror
bootstrap-dialog
vao
node-sass
komodoedit
promela
dotnetzip
veracode
mu
yii2-extension
statsd
elgg
drupal-6
imanage
titanium-android
dwscript
django-scheduler
eventkit
azure-virtual-network
multiple-regression
angstrom-linux
react-native-listview
sdf
suffix-tree
iad
pervasive-sql
intel-fortran
wyam
sysinternals
apache-commons-fileupload
web-controls
proj4js
javax.mail
facebook-graph-api-v2.4
tt-news
java-metro-framework
markers
code-access-security
tld
fluentautomation
xceed-datagrid
google-cloud-save
yui-compressor
limejs
html-editor
path-separator
sublist
online-compilation
netbeans-6.9
subscript
netdna-api
hirefire
gcj
hamachi
propagation
jmock
cxxtest
sortable-tables
thunderbird-lightning
scripting-languages
w3wp
post-build
grid-system

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App