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

How to get Inventory FA fulfilled product using flipkart api
RxJava only emit item if another source will not item for some period
Java code that compiles in older Oracle versions gives compile error in Oracle 12.2
How to get the settings and how to change settings using adb commands
Can't build docker image via gradle on Windows 10
Custom JPA Bean Validator with parameters similiar to #Size
Java Null pointer exception thrown when checking length of blank excel cell
contextless sqlite “attempt to re-open an already-closed object” error in Android
How to retrieve contents on a web page using Java
set the link to edittext when get the link from browser
How to show notification on internet connect?
How to reuse navigation bar code?
#Converter(autoApply = true) not working
How to check is the button is selected in each radio group?
How cancel specific scheduled task?
java.io.FileNotFoundException when trying accessing localhost file in android physical device

Categories

HOME
variables
reflection
oracle11g
azure-data-factory
path-finding
smarty
relative-path
fme
octobercms
twitter-bootstrap-4
gps
applepay
gitpitch
here-api
spring-xd
collectd
task
phaser
visual-studio-2005
fallback
django-simple-history
ghc
graphlab
transformation
finite-automata
sms-gateway
extjs5
jndi
claims-based-identity
qhull
facebook-access-token
entitlements
libuv
librato
media-queries
siesta-swift
commit
ghost4j
cloud-code
mapdb
bower-install
x11-forwarding
reportbuilder
angularjs-factory
mesos-chronos
ws-security
eclipse-scout
gzipstream
nand2tetris
import-from-excel
acoustics
cubic-spline
parentheses
alphabet
winscp-net
git-diff
boost-preprocessor
ifs
spring-cache
xcb
mikroc
transmitfile
flash-cs5
blackberry-10
ios4
javax.sound.midi
spim
maven-tomcat-plugin
jms2
ruby-2.2
generic-programming
mmc
mdt
qcodo
id3v2
wordpress-theme-customize
socketexception
document-classification
sgen
ember-charts
tidy
apc
hamiltonian-cycle
armcc
javaspaces
buildr
boost-filesystem
data-loss
subgurim-maps
hamachi
yui-datatable
telerik-scheduler
dmx512
perfect-hash
database-management
avatar
boost-smart-ptr
phonon
anti-piracy
gacutil
ubuntu-9.04

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