What happens when a OSGi service using JNI is unregistered while in use?
Posted
by schngrg
on Stack Overflow
See other posts from Stack Overflow
or by schngrg
Published on 2010-03-17T14:17:18Z
Indexed on
2010/03/17
14:21 UTC
Read the original article
Hit count: 158
As I understand, OSGi services can be unregistered anytime, including when they are in use.
Consider an OSGi service which internally makes a long-running JNI call. And while that JNI call is executing, the service is unregistered by OSGi.
Will the JNI call be allowed to finish or terminated mid-way? What if it was just a normal non-jni long running Java call? Will that call be allowed to finish execution or will OSGi terminate everything immediately and unregister?
What is the expected behavior in such a case? Does the expected behavior depend on if the service was loaded using a 'tracker' or not?
SG
© Stack Overflow or respective owner