Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E7D0E10F2B for ; Sun, 30 Jun 2013 15:38:56 +0000 (UTC) Received: (qmail 60871 invoked by uid 500); 30 Jun 2013 15:38:56 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 60836 invoked by uid 500); 30 Jun 2013 15:38:56 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 60829 invoked by uid 99); 30 Jun 2013 15:38:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Jun 2013 15:38:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Jun 2013 15:38:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 88C52238897A for ; Sun, 30 Jun 2013 15:38:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r867912 - in /websites/staging/felix/trunk/content: ./ documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.html Date: Sun, 30 Jun 2013 15:38:34 -0000 To: commits@felix.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130630153834.88C52238897A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: buildbot Date: Sun Jun 30 15:38:34 2013 New Revision: 867912 Log: Staging update by buildbot for felix Modified: websites/staging/felix/trunk/content/ (props changed) websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.html Propchange: websites/staging/felix/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Sun Jun 30 15:38:34 2013 @@ -1 +1 @@ -1498141 +1498142 Modified: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.html ============================================================================== --- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.html (original) +++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.html Sun Jun 30 15:38:34 2013 @@ -162,12 +162,7 @@

iPOJO in 10 minutes

-

This page presents how to use the iPOJO runtime and its associated service component model. The concepts of the service component model are introduced, followed by a simple example that demonstrates the features of iPOJO. This tutorial uses annotations to describe components. However, iPOJO also supports

-
* XML
-* A Java [API|apache-felix-ipojo-api]
-
- - +

This page presents how to use the iPOJO runtime and its associated service component model. The concepts of the service component model are introduced, followed by a simple example that demonstrates the features of iPOJO. This tutorial uses annotations to describe components. However, you can also use XML or a programmatic API to create iPOJO applications.

Introduction

iPOJO aims to simplify service-oriented programming on OSGi frameworks; the name iPOJO is an abbreviation for injected POJO. iPOJO provides a new way to develop OSGi service components, simplifying service component implementation by transparently managing the dynamics of the environment as well as other non-functional requirements. The iPOJO framework allows developers to more clearly separate functional code (i.e., POJOs) from the non-functional code (i.e., dependency management, service provision, configuration, etc.). At run time, iPOJO combines the functional and non-functional aspects. To achieve this, iPOJO provides a simple and extensible service component model based on POJOs.

The POJO concept

@@ -308,7 +303,7 @@ Total time: 0 se

Notice that this class does not contains neither OSGi nor iPOJO specific code except a few annotations. It is just an implementation of the Dictionary Service interface.

-

The @Component annotation is used to declare an iPOJO component. The @Provides annotation indicates that the component provides a service. Provided service interfaces are computed by iPOJO, so it is not necessary to specify them. Finally, the @Instantiate annotation instructs iPOJO to create an instance of our component. The relation between components and instances is the same than between classes and objects in the object oriented programming.

+

The @Component annotation is used to declare an iPOJO component. The @Provides annotation indicates that the component provides a service. Provided service interfaces are computed by iPOJO, so it is not necessary to specify them. Finally, the @Instantiate annotation instructs iPOJO to create an instance of our component. The relation between components and instances is the same than between classes and objects in the object-oriented programming.

Then, we are able to create the bundle. In the spell.english directory launch the ant command:

$ ant
 Buildfile: /Users/clement/Projects/felix-trunk/ipojo/distributions/ten-minutes-tutorial/target/test/spell.english/build.xml
@@ -538,7 +533,7 @@ Total time: 0 se
 
-

Look at the three last methods. The check methods collects the user input and uses a Check speller service to check this input. The speller is injected into the checker field thanks to the @Requires annotation. This method is called when the button is pressed by the user. The start and stop methods are lifecycle callbacks. As we display the user interface when the instance is created and to dispose it when the instance stops, we need a way to be notified when we need to execute these actions. iPOJO provides an easy way to do this. The component provides two callback methods for its activation and deactivation. Callbacks are used when the component needs to be informed about a component state change. In iPOJO, the component state is either INVALID (i.e., not all of the component's constraints are satisfied) or VALID (i.e., all of the component's constraints are satisfied). In this example, the start ca llback method sets the GUI visibility to true; the stop callback method deletes the GUI. The @Validate and @Invalidate annotations are used to specify these callbacks.

+

Look at the three last methods. The check methods collects the user input and uses a Check speller service to check this input. The speller is injected into the checker field thanks to the @Requires annotation. This method is called when the user presses the button. The start and stop methods are lifecycle callbacks. As we display the user interface when the instance is created and to dispose it when the instance stops, we need a way to be notified when we need to execute these actions. iPOJO provides an easy way to do this. The component provides two callback methods for its activation and deactivation. Callbacks are used when the component needs to be informed about a component state change. In iPOJO, the component state is either INVALID (i.e., not all of the component's constraints are satisfied) or VALID (i.e., all of the component's constraints are satisfied). In this example, the start callback method sets the GUI visibility to true; the stop callback method deletes the GUI. The @Validate and @Invalidate annotations are used to specify these callbacks.

Once this file is created, you can compile the project by launching ant in the spell.checker.gui directory.

Running the application

We have all the bundles required to start playing with the application.

@@ -645,7 +640,7 @@ Instance spell.english.EnglishDictionary may be trademarks or registered trademarks of their respective owners.
- Rev. 1498141 by clement on Sun, 30 Jun 2013 15:31:37 +0000 + Rev. 1498142 by clement on Sun, 30 Jun 2013 15:38:27 +0000