Created
February 10, 2020 21:26
-
-
Save robstryker/82785d855634f5c87bc6339eeedafbb3 to your computer and use it in GitHub Desktop.
simple osgi Activator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.wso2.mbp.sample01; | |
import org.osgi.framework.BundleActivator; | |
import org.osgi.framework.BundleContext; | |
public class Activator implements BundleActivator { | |
/** | |
* Implements BundleActivator.start(). | |
* | |
* @param context the framework context for the bundle. | |
*/ | |
public void start(BundleContext context) throws Exception { | |
System.out.println("Hello World, I've been updated!"); | |
new Thread("Testing stuff") { | |
public void run() { | |
for( int i = 0; i < 10; i++ ) { | |
System.out.println("Loop " + i); | |
try { | |
Thread.sleep(200); | |
} catch(InterruptedException ie) { | |
} | |
} | |
} | |
}.start(); | |
} | |
/** | |
* Implements BundleActivator.stop(). | |
* | |
* @param context the framework context for the bundle. | |
*/ | |
public void stop(BundleContext context) { | |
System.out.println("Goodbye World!!!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment