|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.examples.spellcheckscr.SpellCheckServiceImpl
public class SpellCheckServiceImpl
This class re-implements the spell check service of Example 5. This service implementation behaves exactly like the one in Example 5, specifically, it aggregates all available dictionary services, monitors their dynamic availability, and only offers the spell check service if there are dictionary services available. The service implementation is greatly simplified, though, by using the Service Component Runtime. Notice that there is no OSGi references in the application code; intead, the metadata.xml file describes the service dependencies to the Service Component Runtime, which automatically manages them and it also automatically registers the spell check services as appropriate.
Constructor Summary | |
---|---|
SpellCheckServiceImpl()
|
Method Summary | |
---|---|
void |
addDictionary(DictionaryService dictionary)
This method is used by the Service Component Runtime to add new dictionaries to the spell check service. |
String[] |
check(String passage)
Checks a given passage for spelling errors. |
void |
removeDictionary(DictionaryService dictionary)
This method is used by the Service Component Runtime to remove dictionaries from the spell check service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpellCheckServiceImpl()
Method Detail |
---|
public void addDictionary(DictionaryService dictionary)
dictionary
- the dictionary to add to the spell check service.public void removeDictionary(DictionaryService dictionary)
dictionary
- the dictionary to remove from the spell check service.public String[] check(String passage)
check
in interface SpellCheckService
passage
- the passage to spell check.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |