org.apache.felix.dm.samples.annotation
Class DictionaryImpl

java.lang.Object
  extended by org.apache.felix.dm.samples.annotation.DictionaryImpl
All Implemented Interfaces:
DictionaryService

public class DictionaryImpl
extends Object
implements DictionaryService

A Dictionary Service. This service uses a FactoryConfigurationAdapterService annotation, allowing to instantiate this service from webconsole. This annotation will actually register a ManagedServiceFactory in the registry, and also supports meta types for configuring this service from WebConsole. You must configure at least one Dictionary from web console, since the SpellCheck won't start if no Dictionary Service is available.


Constructor Summary
DictionaryImpl()
           
 
Method Summary
 boolean checkWord(String word)
          Check if a word exists if the list of words we have been configured from ConfigAdmin/WebConsole.
protected  void start()
          A new Dictionary Service is starting (because a new factory configuration has been created from webconsole).
 String toString()
           
protected  void updated( config)
          Our service will be initialized from ConfigAdmin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DictionaryImpl

public DictionaryImpl()
Method Detail

updated

protected void updated( config)
Our service will be initialized from ConfigAdmin.

Parameters:
config - The configuration where we'll lookup our words list (key=".words").

start

protected void start()
A new Dictionary Service is starting (because a new factory configuration has been created from webconsole).


checkWord

public boolean checkWord(String word)
Check if a word exists if the list of words we have been configured from ConfigAdmin/WebConsole.

Specified by:
checkWord in interface DictionaryService
Parameters:
word - the word to be checked.
Returns:
true if the word is in the dictionary, false otherwise.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Apache Software Foundation. All Rights Reserved.