|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.example.servicebased.host.Activator
public class Activator
The activator of the host application bundle. The activator creates the main application JFrame and starts tracking SimpleShape services. All activity is performed on the Swing event thread to avoid synchronization and repainting issues. Closing the application window will result in Bundle.stop() being called on the system bundle, which will cause the framework to shutdown and the JVM to exit.
This class also provides a static main() method so that it can be run as a stand-alone host application. In such a scenario, the application creates its own embedded Felix framework instance and interacts with the internal services to providing drawing functionality. To successfully launch the stand-alone application, it must be run from this bundle's installation directory using "java -jar".
Constructor Summary | |
---|---|
Activator()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] argv)
Enables the bundle to run as a stand-alone application. |
void |
run()
This method actually performs the creation of the application window. |
void |
start(org.osgi.framework.BundleContext context)
Displays the applications window and starts service tracking; everything is done on the Swing event thread to avoid synchronization and repainting issues. |
void |
stop(org.osgi.framework.BundleContext context)
Stops service tracking and disposes of the application window. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Activator()
Method Detail |
---|
public void start(org.osgi.framework.BundleContext context)
start
in interface org.osgi.framework.BundleActivator
context
- The context of the bundle.public void stop(org.osgi.framework.BundleContext context)
stop
in interface org.osgi.framework.BundleActivator
context
- The context of the bundle.public void run()
run
in interface java.lang.Runnable
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- The command-line arguments.
java.lang.Exception
- If anything goes wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |