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 - Reference Guide
Date Thu, 24 Dec 2009 07:29:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=FELIX&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Dependency+Manager+-+Reference+Guide">Apache
Felix Dependency Manager - Reference Guide</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~marrs">Marcel
Offermans</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <h2><a name="ApacheFelixDependencyManager-ReferenceGuide-ReferenceGuide"></a>Reference
Guide</h2>

<h3><a name="ApacheFelixDependencyManager-ReferenceGuide-Services"></a>Services</h3>

<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-Lifecycle"></a>Life
cycle</h4>

<p>The dependency manager, as part of a bundle, shares the generic bundle life cycle
explained in the OSGi specification. The life cycle of the dependency manager itself, and
the services it manages, can be located inside the <b>active</b> state of the
hosting bundle.</p>

<p>Each service you define gets its own life cycle, which is explained in the state
diagram below.</p>

<p>TODO: add diagram</p>

<p>...</p>

<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-Interfacesandproperties"></a>Interfaces
and properties</h4>

<p>Services in the context of the dependency manager can be published as OSGi services
under one or more interface names, plus optionally a set of properties. This is no different
than a normal OSGi service. It's important to mention that you don't have to register a service.
If you don't, you basically created a component that can do work and have dependencies and
a managed life cycle.</p>

<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-Composition"></a>Composition</h4>

<p>When implementing more complex services, you often find yourself using more than
one instance. However, several of these instances might want to have dependencies injected.
In such cases you need to tell the dependency manager which instances to consider.</p>

<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-Factories"></a>Factories</h4>

<p>Out of the box, there already is support for lazy instantiation, meaning that the
dependency manager can create instances for you when their required dependencies are resolved.
However, sometimes creating a single instance using a default constructor is not enough. In
those cases, you can tell the dependency manager to delegate the creation process to a factory.</p>

<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-Aspects"></a>Aspects</h4>

<p>Aspects, as part of aspect oriented programming, can be used in a dynamic environment
such as OSGi to "extend" existing services and add certain "capabilities" to them. Examples
of these are adding a specific caching mechanism to a storage service or implementing logging.
Aspects in OSGi can be applied to services and can be added and removed at runtime.</p>

<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-Adapters"></a>Adapters</h4>

<p>Adapters, like aspects, are used to "extend" existing services, and can publish different
services based on the existing one. An example would be implementing a management interface.</p>

<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-ResourceAdapters"></a>Resource
Adapters</h4>

<p>Resource adapters work just like adapters, but instead of working with services,
they work with resources. Resources are an abstraction introduced to provide a generic way
of dealing with "blobs" and can be resources inside a bundle, filesystem or some kind of data
store.</p>

<h3><a name="ApacheFelixDependencyManager-ReferenceGuide-Dependencies"></a>Dependencies</h3>

<p>...</p>

<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-Injection"></a>Injection</h4>
<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-Callbacks"></a>Callbacks</h4>
<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-TypesofDependencies"></a>Types
of Dependencies</h4>
<h5><a name="ApacheFelixDependencyManager-ReferenceGuide-Service"></a>Service</h5>
<h5><a name="ApacheFelixDependencyManager-ReferenceGuide-Bundle"></a>Bundle</h5>
<h5><a name="ApacheFelixDependencyManager-ReferenceGuide-Configuration"></a>Configuration</h5>
<h5><a name="ApacheFelixDependencyManager-ReferenceGuide-Resource"></a>Resource</h5>
<h5><a name="ApacheFelixDependencyManager-ReferenceGuide-TemporalService"></a>Temporal
Service</h5>
<h5><a name="ApacheFelixDependencyManager-ReferenceGuide-ImplementingYourOwnDependency"></a>Implementing
Your Own Dependency</h5>

<h3><a name="ApacheFelixDependencyManager-ReferenceGuide-MonitoringandShell"></a>Monitoring
and Shell</h3>

<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-ServiceInterfacesforMonitoring"></a>Service
Interfaces for Monitoring</h4>
<h4><a name="ApacheFelixDependencyManager-ReferenceGuide-ApacheFelixandEclipseEquinoxShell"></a>Apache
Felix and Eclipse Equinox Shell</h4>
     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Dependency+Manager+-+Reference+Guide">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=9374249&revisedVersion=2&originalVersion=1">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Dependency+Manager+-+Reference+Guide?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message