org.apache.felix.examples.spellcheckclient
Class Activator

java.lang.Object
  extended by org.apache.felix.examples.spellcheckclient.Activator
All Implemented Interfaces:
EventListener, BundleActivator, ServiceListener

public class Activator
extends Object
implements BundleActivator, ServiceListener

Author:
Felix Project Team

Constructor Summary
Activator()
           
 
Method Summary
 void serviceChanged(ServiceEvent event)
          Implements ServiceListener.serviceChanged().
 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(). Adds itself as a listener for service events, then queries for all available spell check services. If none are found it goes into its normal "passage checking loop" and waits for a spell check service to arrive. Once it has a spell check service it reads passages from standard input and checks their spelling using the spell check service. (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.

serviceChanged

public void serviceChanged(ServiceEvent event)
Implements ServiceListener.serviceChanged(). Checks to see if the service we are using is leaving or tries to get a service if we need one.

Specified by:
serviceChanged in interface ServiceListener
Parameters:
event - the fired service event.


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