directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel L├ęcharny <>
Subject Re: OSGi startup and shutdown problems
Date Wed, 11 May 2011 13:56:05 GMT
On 5/11/11 3:42 PM, Alex Karasulu wrote:
>> Usually, we are just hiding it if the user does not have its own OSGi
>> container.
> Please clarify.

The user does not know we embed and start Felix. For him, it's 'hidden'.

Btw, the pb I was trying to solve (ie, the Felix EventDispatchQueue 
thread was still running even if we quit the application) has a nice 
workaround. The pb was that the felix thread was a User thread, not a 
Daemon thread, thus needed to be stopped explicitly. What would have 
been good is to be able to make this thread a Daemon thread, but as it's 
created internally of Felix, there was no way to do that.

Hopefully, Karl and Richard mentionned that if you start a thread from a 
daemon thread, then the inner thread will inheritate it's parent status. 
So I started felix inside a Daemon thread, and it did the trick :

         Thread felixThread = new Thread(new Runnable() {
             public void run()
                 catch ( BundleException e )
                     String message = "Failed to start embedded felix 
instance: " + e.getMessage();
                     LOG.error( message, e );
                     throw new RuntimeException( message, e );
         }, "FelixThread");

         felixThread.setDaemon( true );

instead of :


Emmanuel L├ęcharny

View raw message