felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Felix > Apache Felix Dependency Manager - Using Annotations
Date Sun, 22 Aug 2010 22:14:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=FELIX&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Dependency+Manager+-+Using+Annotations">Apache
Felix Dependency Manager - Using Annotations</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~pderop">Pierre
De Rop</a>
    </h4>
        <br/>
                         <h4>Changes (5)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-unchanged" >h1. Using Annotations <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Dependency
Manager provides a compact and versatile java API,  allowing to declaratively and programmatically
register, acquire, and  manage dynamic OSGi services. But since recently, support for  annotations
has been introduced in Dependency Manager, and you can also  manage your service components,
and their dynamic dependencies using  Java 5 annotations. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">To
write an OSGi application is to first develop bundle dependencies  using Import-Package or
Export-Package headers. But bundles can also  cooperate using services. Basically, using the
OSGi Service Regsitry, a  service providing bundle can publish a service (a Java object),
while a  client bundle can discover and bind to other services on which it  depends. All these
activities are dynamic and create a unique challenge  when using services: when a service
is required, it may not be available  yet, so that the client service is left clumsy. On the
other hand, even  if the dependency service is registered and available, then it can be  unregistered
later, leaving the client service with a stale service  reference. In this context, a first
solution to handle service  dependencies consists in using the OSGi API  (BundleContext/ServiceTracker),
but this programmatic API for  registering and acquiring services is often challenging, and
 DependencyManager addresses theses issues. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Dependency
Manager provides a compact and versatile java API,  allowing to declaratively and programmatically
register, acquire, and  manage dynamic OSGi services. But since recently, support for  annotations
has been introduced in Dependency Manager, and you can also  manage your service component
dependencies using Java 5 annotations. In  this chapter, we will detail the Dependency Manager
Annotations which  can be used to describe service components. We will also discuss the DM
 component lifecycle and how components can interract with the dynamic  OSGi service model.
<br> <br></td></tr>
            <tr><td class="diff-unchanged" >h1. Table of Contents <br> <br>*
[Quick Tour|Apache Felix Dependency Manager - Using Annotations - Quick Tour] helps
you with the basic concepts using a SpellChecker sample code. <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">*
[Reference Guide|Apache Felix Dependency Manager - Using Annotations - Reference Guide] a
full reference guide to lookup all annotation details. <br>* [Common Usages|Apache
Felix Dependency Manager - Using Annotations - Common Usages] Covers some common usage scenarios
using annotations <br>* [Compiling |Apache Felix Dependency Manager - Using Annotations
- Compiling] explains how to build annotated bundle using Maven, Bnd, or Ant. <br>*
[Testing |Apache Felix Dependency Manager - Using Annotations - Testing] shows how you can
write junit tests using Pax Exams.. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*
[Writing Components|Apache Felix Dependency Manager - Using Annotations - Components] Explains
how to write DM service components using annotations. <br>* [Using Dependencies|Apache
Felix Dependency Manager - Using Annotations - Dependencies] Explains how to annotate dependencies
for a given component. <br>* [Lifecycle|Apache Felix Dependency Manager - Using Annotations
- Lifecycle] Explains the DM component lifecycle and how components interact with the dynamic
OSGI service model. <br>* [Composition|Apache Felix Dependency Manager - Using Annotations
- Composition] Explains how a component may be implemented using multiple object instances.
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>h1. <br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="ApacheFelixDependencyManager-UsingAnnotations-UsingAnnotations"></a>Using
Annotations</h1>

<p>To write an OSGi application is to first develop bundle dependencies  using Import-Package
or Export-Package headers. But bundles can also  cooperate using services. Basically, using
the OSGi Service Regsitry, a  service providing bundle can publish a service (a Java object),
while a  client bundle can discover and bind to other services on which it  depends. All these
activities are dynamic and create a unique challenge  when using services: when a service
is required, it may not be available  yet, so that the client service is left clumsy. On the
other hand, even  if the dependency service is registered and available, then it can be  unregistered
later, leaving the client service with a stale service  reference. In this context, a first
solution to handle service  dependencies consists in using the OSGi API  (BundleContext/ServiceTracker),
but this programmatic API for  registering and acquiring services is often challenging, and
 DependencyManager addresses theses issues.</p>

<p>Dependency Manager provides a compact and versatile java API,  allowing to declaratively
and programmatically register, acquire, and  manage dynamic OSGi services. But since recently,
support for  annotations has been introduced in Dependency Manager, and you can also  manage
your service component dependencies using Java 5 annotations. In  this chapter, we will detail
the Dependency Manager Annotations which  can be used to describe service components. We will
also discuss the DM  component lifecycle and how components can interract with the dynamic
 OSGi service model.</p>

<h1><a name="ApacheFelixDependencyManager-UsingAnnotations-TableofContents"></a>Table
of Contents</h1>

<ul>
	<li><a href="/confluence/display/FELIX/Apache+Felix+Dependency+Manager+-+Using+Annotations+-+Quick+Tour"
title="Apache Felix Dependency Manager - Using Annotations - Quick Tour">Quick Tour</a>
helps you with the basic concepts using a SpellChecker sample code.</li>
	<li><a href="/confluence/pages/createpage.action?spaceKey=FELIX&amp;title=Apache+Felix+Dependency+Manager+-+Using+Annotations+-+Components&amp;linkCreation=true&amp;fromPageId=23334954"
class="createlink">Writing Components</a> Explains how to write DM service components
using annotations.</li>
	<li><a href="/confluence/pages/createpage.action?spaceKey=FELIX&amp;title=Apache+Felix+Dependency+Manager+-+Using+Annotations+-+Dependencies&amp;linkCreation=true&amp;fromPageId=23334954"
class="createlink">Using Dependencies</a> Explains how to annotate dependencies for
a given component.</li>
	<li><a href="/confluence/pages/createpage.action?spaceKey=FELIX&amp;title=Apache+Felix+Dependency+Manager+-+Using+Annotations+-+Lifecycle&amp;linkCreation=true&amp;fromPageId=23334954"
class="createlink">Lifecycle</a> Explains the DM component lifecycle and how components
interact with the dynamic OSGI service model.</li>
	<li><a href="/confluence/pages/createpage.action?spaceKey=FELIX&amp;title=Apache+Felix+Dependency+Manager+-+Using+Annotations+-+Composition&amp;linkCreation=true&amp;fromPageId=23334954"
class="createlink">Composition</a> Explains how a component may be implemented using
multiple object instances.</li>
</ul>


<h1><a name="ApacheFelixDependencyManager-UsingAnnotations-"></a></h1>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Dependency+Manager+-+Using+Annotations">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=23334954&revisedVersion=4&originalVersion=3">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Dependency+Manager+-+Using+Annotations?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message