You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pd...@apache.org on 2010/04/26 00:57:56 UTC
svn commit: r937905 -
/felix/trunk/dependencymanager/samples.annotation/README
Author: pderop
Date: Sun Apr 25 22:57:56 2010
New Revision: 937905
URL: http://svn.apache.org/viewvc?rev=937905&view=rev
Log:
added a README file, which describes this sample
Added:
felix/trunk/dependencymanager/samples.annotation/README
Added: felix/trunk/dependencymanager/samples.annotation/README
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/samples.annotation/README?rev=937905&view=auto
==============================================================================
--- felix/trunk/dependencymanager/samples.annotation/README (added)
+++ felix/trunk/dependencymanager/samples.annotation/README Sun Apr 25 22:57:56 2010
@@ -0,0 +1,45 @@
+This sample illustrates the usage of the new DependencyManager annotations.
+
+Sample description:
+
+ This sample shows a basic "SpellChecker" application which provides a Felix "spellcheck" shell
+ command. The SpellChecker class is a Felix Shell command (it provides the "Command" service),
+ which accepts a string as parameter. So, when you type a string, the command just says if the
+ specified string has been found from one of its injected dictionaries. The SpellChecker class has a
+ required/multiple dependency over any available DictionaryService. Currently, there is one
+ "EnglishDictionary" which implements the DictionaryService. The EnglishDictionary service uses
+ MetaType, allowing to configure english words through ConfigAdmin and WebConsole.
+ So, before testing, you first have to go to webconsole Configuration panel, and specify some
+ english words in the configuration for the "English Dictionary" PID. Then, go to the felix shell,
+ and you will then see the "spellcheck" command (when typing "help").
+ Notice that in the sample, you will also find an Aspect Service (DictionaryAspect.java), which
+ decorates the EnglishDictionary service, by adding an "aspect" word in the dictionary.
+
+How to test:
+
+ 1) Install the following bundles:
+
+ org.apache.felix.configadmin
+ org.apache.felix.metatype
+ org.apache.felix.http.jetty
+ org.apache.felix.webconsole
+
+ org.apache.felix.dependencymanager
+ org.apache.felix.dependencymanager.shell
+ org.apache.felix.dependencymanager.runtime
+ org.apache.felix.dependencymanager.samples.annotation
+
+ 2) Start felix
+ 3) Go to web console, in the Configuration pannel
+ 4) Edit the "English Dictionary" Configuration, add some words, then click on "save".
+ At this point, the "EnglishDictionary" service will be enabled and the SpellCheck component
+ will be injected with it. Then you should see the "spellcheck" command, when typing "help" on the shell.
+
+ 5) Just type "spellcheck hello", and the command should reply a fantastic message, like "word hello is correct".
+
+
+
+
+
+
+