OSGi Activator showing wrong status

Problem Statement: OSGi Activator showing wrong status

Solution 1:
Make sure that we are throwing exception, in case of failure in start up.
Make sure that we are not starting new threads and exiting start method, without waiting and verifying its status.


public class MyProjectActivator implements BundleActivator {

public void start(BundleContext context) throws java.lang.Exception
{
// Make sure that all threads are completed.
// Catch Exception 
// Log Exception
// Throw exception.
}

public void stop(BundleContext context) throws java.lang.Exception
{
// Catch Exception 
// Log Exception
// Throw exception.
}

}

-o-

Advertisements