org.apache.felix.examples.dictionaryclient
Class Activator

java.lang.Object
  extended by org.apache.felix.examples.dictionaryclient.Activator
All Implemented Interfaces:
BundleActivator

public class Activator
extends Object
implements 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

Constructor Summary
Activator()
           
 
Method Summary
 void start(BundleContext context)
          Implements BundleActivator.start().
 void stop(BundleContext context)
          Implements BundleActivator.stop().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Activator

public Activator()
Method Detail

start

public void start(BundleContext context)
           throws 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 BundleActivator
Parameters:
context - the framework context for the bundle.
Throws:
Exception

stop

public void stop(BundleContext context)
Implements BundleActivator.stop(). Does nothing since the framework will automatically unget any used services.

Specified by:
stop in interface BundleActivator
Parameters:
context - the framework context for the bundle.


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.