org.apache.felix.examples.dictionaryclient
Class Activator
java.lang.Object
org.apache.felix.examples.dictionaryclient.Activator
- All Implemented Interfaces:
- org.osgi.framework.BundleActivator
public class Activator
- extends java.lang.Object
- implements org.osgi.framework.BundleActivator
This class implements a bundle that uses a dictionary service to check for
the proper spelling of a word by check for its existence in the dictionary.
This bundle uses the first service that it finds and does not monitor the
dynamic availability of the service (i.e., it does not listen for the arrival
or departure of dictionary services). When starting this bundle, the thread
calling the start() method is used to read words from standard input. You can
stop checking words by entering an empty line, but to start checking words
again you must stop and then restart the bundle.
- Author:
- Felix Project Team
Method Summary |
void |
start(org.osgi.framework.BundleContext context)
Implements BundleActivator.start(). |
void |
stop(org.osgi.framework.BundleContext context)
Implements BundleActivator.stop(). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Activator
public Activator()
start
public void start(org.osgi.framework.BundleContext context)
throws java.lang.Exception
- Implements BundleActivator.start(). Queries for all available dictionary
services. If none are found it simply prints a message and returns,
otherwise it reads words from standard input and checks for their
existence from the first dictionary that it finds. (NOTE: It is very bad
practice to use the calling thread to perform a lengthy process like
this; this is only done for the purpose of the tutorial.)
- Specified by:
start
in interface org.osgi.framework.BundleActivator
- Parameters:
context
- the framework context for the bundle.
- Throws:
java.lang.Exception
stop
public void stop(org.osgi.framework.BundleContext context)
- Implements BundleActivator.stop(). Does nothing since the framework will
automatically unget any used services.
- Specified by:
stop
in interface org.osgi.framework.BundleActivator
- Parameters:
context
- the framework context for the bundle.