Author: marrs
Date: Wed Mar 11 09:02:04 2015
New Revision: 1665812
URL: http://svn.apache.org/r1665812
Log:
Small formatting changes.
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/annotations.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/background.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/design-patterns.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/development.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/history.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-earlier-versions.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/performance-tuning.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/whatsnew.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-adapter.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-aspect.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-bundle-adapter.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-resource-adapter.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-singleton.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/components.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependencies.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-bundle.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-configuration.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-resource.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-service.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/thread-model.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/tutorials/getting-started.mdtext
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/tutorials/leveraging-the-shell.mdtext
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,4 +1,4 @@
-Title: Dependency Manager 4
+Title: Apache Felix Dependency Manager
Welcome to the Dependency Manager, a great bundle for managing your components
and dependencies!
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/annotations.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/annotations.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/annotations.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/annotations.mdtext
Wed Mar 11 09:02:04 2015
@@ -3,7 +3,7 @@ Title: Dependency Manager - Annotations
This section presents a quick overview of the capabilities and usage of the
DependencyManager Java annotations. In particular, we will recap the
DependencyManager annotation architecture, and identify some simple usage
scenarios using a SpellChecker
sample application with annotated components. The application is available
from the felix trunk, in the `dependencymanager/samples.annotation` subproject.
-# Architecture
+## Architecture
Instead of writing Activators which extends the DependencyActivatorBase class,
service
components can now be annotated using the annotations provided by the
@@ -22,7 +22,7 @@ DependencyManager programmatic API in or
Annotated components can then be inspected with the DependencyManager Gogo
shell, as it is
the case with DM components declared through the programmatic DM API.
-# Registering a Service
+## Registering a Service
To register a service, your can annotate your class with a *@Component*
annotation, and
an instance of your class will be registered under all directly implemented
interfaces
@@ -71,7 +71,7 @@ for invoking the proper functions.
So, coming back to the sample code, the SpellChecker class registers itself
into the OSGi registry, using the *provides* attribute, which just refer to our
SpellChecker class, and the two mandatory Gogo service properties are also
specified using the *@Property* annotation. It is not shown here, but service
properties can also be provided dynamically from a method that can return a
Map, and annotated with the *@Start* lifecycle callback, but we will see this
feature in a another section.
-# Depending on a Service
+## Depending on a Service
Our SpellChecker component can expose itself as a Gogo shell command, but
before being
registered into the OSGi registry, we also need to be injected with two
dependencies:
@@ -152,7 +152,7 @@ DictionaryService services in our dictio
existence. This list is a copy on write list because the dependency may be
injected at
any time, possibly from another thread. So, using a copy on write list avoid
us to use synchronized methods.
-# Creating a Service from ConfigAdmin
+## Creating a Service from ConfigAdmin
The *@Component* annotation is not the only one for creating services. Another
one is
the *@FactoryConfigurationAdapterService* annotation which allows to
instantiate many
@@ -265,7 +265,7 @@ Next, here is our DictionaryImpl that wi
}
-# Providing an Aspect
+## Providing an Aspect
As we have seen in the previous section, there are many annotations that can
be used
to specify a service. Another one is the *@AspectService* annotation. This
annotation
@@ -339,7 +339,7 @@ used to configure the extra English word
requires a pid parameter, which is a persistent identifier uniquely
identifying our
component, but by default, the pid is set to the fully qualified name of our
class.
-# How to run the sample code
+## How to run the sample code
Just import the Dependency source distribution in bndtools and check the
following samples:
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/background.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/background.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/background.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/background.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,6 +1,6 @@
Title: Dependency Manager - Background
-# Background
+## Background
In an OSGi framework, services are deployed using bundles and these bundles
feature two types of dependencies:
@@ -17,7 +17,7 @@ In real implementations, you are probabl
The Dependency Manager provides you with the right building blocks to
declaratively specify dependencies using a straightforward Java API that is
easy to maintain and refactor.
-# Design Goals
+## Design Goals
The goals that drove the design of the dependency manager are:
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/design-patterns.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/design-patterns.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/design-patterns.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/design-patterns.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,7 +1,5 @@
Title: Dependency Manager - Design Patterns
-# OSGi Design Patterns
-
This section lists a couple of design patterns as they can be applied in an
OSGi context.
## Singleton Service
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/development.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/development.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/development.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/development.mdtext
Wed Mar 11 09:02:04 2015
@@ -2,11 +2,11 @@ Title: Dependency Manager - Development
When downloading or checking out the source code, please also consult
release/resources/src/README.src for up to date instructions on how to build
that particular version.
-# Prerequisites
+## Prerequisites
If you are building a released
`org.apache.felix.dependencymanager-r<n>-src.zip` artifact, then you also have
to extract the `org.apache.felix.dependencymanager-r<n>-deps.zip` in the same
directory where you have extracted the source archive. There is no need to do
this if you have checked out from the Felix trunk in Subversion.
-# Compilation Using gradle:
+## Compilation Using gradle:
- Install Java 7.
@@ -26,7 +26,7 @@ If you are building a released `org.apac
$ ./gradlew check
-# Compilation Using Eclipse:
+## Compilation Using Eclipse:
- Install either Eclipse Kepler SR2 or Eclipse Luna.
- Use the dependency manager folder as the root of your workspace.
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/history.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/history.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/history.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/history.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,12 +1,14 @@
Title: Dependency Manager - History
-# The early years
+Dependency Manager has quite a long history, that starts over ten years ago.
+
+## The early years
The first version of the Dependency Manager was created when Marcel started
working on his first commercial OSGi project back in 2002. At that time, the
OSGi specification was still at R2, and the only solution for managing
dependencies was "service binder" which did not support the dynamics we needed
at that time. Therefore, dependency manager was created, based on a fluent,
declarative Java API.
In 2005, after writing a white paper, dependency manager was presented at the
OSGi DevCon in Paris. At that time, the project had been open sourced, but not
yet at Apache. When the Oscar project finally decided to move to the incubator,
where it became Felix, Dependency Manager was one of the subprojects that
joined.
-# Life at Apache
+## Life at Apache
The move to Apache definitely gave the project a lot more visibility and,
besides a larger user base, also attracted a few very talented developers.
Xander did a lot of work in getting some of the higher level design patterns
implemented, and Pierre added support for annotations and ensured that the code
ran well on really big, multi-core systems.
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-earlier-versions.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-earlier-versions.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-earlier-versions.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/migrating-from-earlier-versions.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,6 +1,8 @@
Title: Apache Felix Dependency Manager - Migrating from earlier versions
-# Migrating from version 3
+Below is a guide to help you migrate from version 3. Whilst older versions
obviously still exist, we don't think people are still actively using them.
+
+## Migrating from version 3
DependencyManager 4.0 has some API changes that need to be taken into account
when migrating from DependencyManager 3.
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/performance-tuning.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/performance-tuning.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/performance-tuning.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/performance-tuning.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,6 +1,8 @@
Title: Dependency Manager - Performance Tuning
-# Filter Indices
+To further tune the performance of an application using Dependency Manager and
a lot of services, we created the concept of filter indices. They work
similarly to the way indices speed up relational database queries and are
explained below.
+
+## Filter Indices
Filter indices allow you to speed up the service resolution process by
skipping the services registry, in favor of a fast index on given service
properties.
@@ -16,11 +18,11 @@ The implementation ships with three kind
- *Aspect indices* work with Dependency Manager Aspect services, and will
provide indexing for the specific filters that they use.
- *Adapter indices* work like Aspect indices, but for Adapter services.
-## Performance
+### Performance
The index isn't free, but reduces the linear (and wasteful) filter-based
lookup to an indexed log(n) lookup. You can expect noticeable speedup if you
have at least several hundred services.
-## Examples
+### Examples
-Dorg.apache.felix.dependencymanager.filterindex=objectClass
Sets an index on `objectClass`, speeding up lookups for any filter that
contains an `objectClass` in its filter (all regular services do).
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/whatsnew.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/whatsnew.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/whatsnew.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/guides/whatsnew.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,8 +1,10 @@
Title: Dependency Manager - What's new in version 4?
-# New thread model
+Even though the focus for this version is to completely redo the internals, we
also added a few new features to the code. The most important one is the new
thread model, described directly below. Apart from that we also added a few
smaller features, enumerated below that.
-DependencyManager 4.0 has been significantly reworked to improve support for
concurrency. The following principles form the basis of the new concurrency
model in DM4.
+## New thread model
+
+DependencyManager 4 has been significantly reworked to improve support for
concurrency. The following principles form the basis of the new concurrency
model in DM4.
* All external events that influence the state of dependencies are recorded
and given to the serial executor of the component. We record whatever data
comes in, so when the actual job is run by the serial executor, we still have
access to the original data without having to access other sources whose state
might have changed since.
* The serial executor of a component will execute a job immediately if it is
being called by the thread that is already executing jobs.
@@ -25,7 +27,7 @@ Here, all components will be handled by
You will find a full description of the new thread model in the
[Reference](../reference/thread-model.html) section.
-# New features
+## New features
In addition, some new features have been implemented in dependency manager:
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-adapter.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-adapter.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-adapter.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-adapter.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,7 +1,5 @@
Title: Dependency Manager - Adapter
-# Adapters
-
Adapters, like [aspects](component-aspect.html), are used to "extend" existing
services, and can publish different services based on the existing one. An
example would be implementing a management interface.
An adapter will be applied to any service that matches the specified interface
and filter. For each matching service an adapter will be created based on the
adapter implementation class. The adapter will be registered with the specified
interface and existing properties from the original service plus any extra
properties you supply here. It will also inherit all dependencies, and if you
declare the original service as a member it will be injected.
@@ -12,7 +10,7 @@ An example:
.setInterface(AdapterService.class, new Hashtable() {{
put("extra", "property"); }})
.setImplementation(AdapterImpl.class);
-# @AdapterService
+## @AdapterService
Adapters, like with *@AspectService*, are used to "extend" existing services,
and can publish different services based on the existing one. When you annotate
an adapter class with the *@AdapterService*
annotation, it will be applied to any service that matches the implemented
@@ -21,7 +19,7 @@ interface and existing properties from t
properties you supply here. If you declare the original service as a member
it will be injected.
-## Annotation attributes:
+### Annotation attributes:
----
**`adapteeService`**
@@ -61,7 +59,7 @@ Sets the filter condition to use with th
Sets the static method used to create the adapter service implementation
instance. By default, the default constructor of the annotated class is used.
-## Usage example
+### Usage example
Here, the AdapterService is registered into the OSGI registry each time an
AdapteeService is found from the registry. The AdapterImpl class adapts the
AdapteeService to the AdapterService. The AdapterService will also have a
service property (param=value), and will also include eventual service
properties found from the AdapteeService:
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-aspect.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-aspect.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-aspect.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-aspect.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,16 +1,14 @@
Title: Dependency Manager - Aspect
-# Aspects
-
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.
Aspects allow you to define an "interceptor", or chain of interceptors for a
service to add features like caching or logging, etc. An aspect will be applied
to any service that matches the specified interface and filter. For each
matching service an aspect will be created based on the aspect implementation
class. The aspect will be registered with the same interface and properties as
the original service, plus any extra properties you supply here. It will also
inherit all dependencies, and if you declare the original service as a member
it will be injected.
-# @AspectService
+## @AspectService
The *@AspectService* annotation allows you to create an aspect service. It
supports the following attributes mentioned below.
-## Annotation attributes
+### Annotation attributes
----
**`ranking`**
@@ -62,7 +60,7 @@ instance. The default constructor of the
The factoryMethod can be used to provide a specific aspect implements,
like a DynamicProxy.
-## Usage example:
+### Usage example:
@AspectService(ranking=10), properties={@Property(name="param",
value="value")})
class AspectService implements InterceptedService {
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-bundle-adapter.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-bundle-adapter.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-bundle-adapter.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-bundle-adapter.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,7 +1,5 @@
Title: Dependency Manager - Bundle Adapter
-# Bundle Adapters
-
Bundle adapters are similar to AdapterService, but instead of adapting a
service, they adapt a bundle with a certain set of states
(STARTED|INSTALLED|...), and provide a service on top of it.
@@ -20,11 +18,11 @@ An example:
.setInterface(AdapterService.class.getName(), new Hashtable()
{{ put("foo", "bar"); }})
.setImplementation(AdapterServiceImpl.class);
-# @BundleAdapterService
+## @BundleAdapterService
The following attributes are supported.
-## Annotation attributes:
+### Annotation attributes:
----
**`filter`**
@@ -73,7 +71,7 @@ exposed service properties.
Sets the static method used to create the BundleAdapterService implementation
instance.
-## Usage Examples
+### Usage Examples
In the following example, a "VideoPlayer" Service is registered into the OSGi
registry each time an active bundle containing a "Video-Path" manifest header
is detected:
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-factory-configuration-adapter.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,7 +1,5 @@
Title: Dependency Manager - Factory Configuration Adapter Service
-# Factory Configuration Adapter Service
-
A factory configuration adapter service creates an adapter for each matching
configuration in Configuration Admin. For each new factory configuration
matching the factoryPid, an adapter will be created based on the adapter
implementation class. The adapter will be registered with the specified
interface and with the specified adapter service properties. Depending on the
propagate parameter, every public factory configuration properties (which don't
start with ".") will be propagated along with the adapter service properties.
It will also inherit all dependencies.
Usage Example:
@@ -10,7 +8,7 @@ Usage Example:
.setInterface(AdapterService.class.getName(), new Hashtable()
{{ put("foo", "bar"); }})
.setImplementation(AdapterServiceImpl.class);
-# @FactoryConfigurationAdapterService
+## @FactoryConfigurationAdapterService
Annotates a class that acts as a Factory Configuration Adapter Service.
For each new Config Admin factory configuration matching the specified
@@ -24,7 +22,7 @@ Like in @ConfigurationDependency, you ca
your configurations for Web Console GUI customization (configuration
heading/descriptions/default values/etc ...).
-## Annotation attributes:
+### Annotation attributes:
----
**`provides`**
@@ -84,7 +82,7 @@ are merged with these.
Sets the static method used to create the adapter instance.
-## Usage Examples
+### Usage Examples
Here, a "Dictionary" service instance is instantiated for each existing
factory configuration instances matching the "DictionaryServiceFactory"
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-resource-adapter.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-resource-adapter.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-resource-adapter.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-resource-adapter.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,7 +1,5 @@
Title: Dependency Manager - Resource Adapter
-# Resource Adapters
-
Resource adapters work just like adapters, but instead of working with
services, they work with resources. Resources, represented as a URL, 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.
A resource adapter will be applied to any resource that matches the specified
filter condition. For each matching resource an adapter will be created based
on the adapter implementation class. The adapter will be registered with the
specified interface and existing properties from the original resource plus any
extra properties you supply here. It will also inherit all dependencies, and if
you declare the original service as a member it will be injected.
@@ -12,7 +10,7 @@ Usage Example:
.setInterface(AdapterService.class.getName(), new Hashtable()
{{ put("foo", "bar"); }})
.setImplementation(AdapterServiceImpl.class);
-# @ResourceAdapterService
+## @ResourceAdapterService
Resource adapters are things that adapt a resource instead of a service, and
provide an adapter service on top of this resource. Resources are an
@@ -31,11 +29,11 @@ properties will be propagated from the r
* *protocol*: the resource URL protocol
* *port*: the resource URL port
-## Annotation attributes
+### Annotation attributes
TBD
-## Usage Examples:
+### Usage Examples:
Here, the "VideoPlayer" service provides a video service on top of any movie
resources, with service properties "host"/"port"/"protocol"/"path" extracted
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-singleton.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-singleton.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-singleton.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/component-singleton.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,7 +1,5 @@
Title: Dependency Manager - Singleton Component
-# Component
-
Components are the main building blocks for OSGi applications. They can
publish themselves as a service, and they can have dependencies. These
dependencies will influence their life cycle as component will only be
activated when all required dependencies are available.
Usage example:
@@ -19,13 +17,13 @@ Usage example:
)
);
-# @Component
+## @Component
This annotation annotates an implementation class that optionally publishes
an OSGi service, and optionally has some dependencies, with a managed
lifecycle.
-## Annotation attributes
+### Annotation attributes
----
**`provides`**
@@ -95,7 +93,7 @@ method, which is called for providing th
factory that instantiated this component. The current Service properties will
be also updated with all public properties (which don't start with a dot).
-Usage example:
+### Usage example:
:::java
/**
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/components.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/components.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/components.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/components.mdtext
Wed Mar 11 09:02:04 2015
@@ -4,7 +4,7 @@ Components are declared by the dependenc
You can either use the Java API or the Java Annotations and this reference
section describes both.
-# Types of Components
+## Types of Components
There are different types of Dependency Manager components:
@@ -15,7 +15,7 @@ There are different types of Dependency
* [*Resource Adapter Service*](component-resource-adapter.html): creates an
OSGi service on top of a specific Resource.
* [*Factory Configuration Adapter
Service*](component-factory-configuration-adapter.html): creates an OSGi
service from ConfigAdmin, using a factoryPid, and a ManagedServiceFactory.
-# Life cycle
+## Life cycle
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 components it manages, can be located inside the
*active* state of the hosting bundle.
@@ -39,14 +39,14 @@ The dependency manager will look for met
If you don't specify anything, the methods with these names will be invoked on
the instance. By using `setCallbacks()` you can however change this behavior:
You can change the names of the methods to look for. Any methods that are set
to ` null ` will not be invoked at all. Another thing you can do is to specify
a different instance to invoke these methods on. If you do that, you will
usually want to use the first signature, which gives you a reference to the `
Component ` whose life cycle method was invoked.
-# Interfaces and properties
+## Interfaces and properties
Components 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.
-# Composition
+## Composition
When implementing more complex components, 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. This has to be a fixed set of instances however.
-# Factories
+## Factories
Out of the box, there already is support for lazy instantiation, meaning that
the dependency manager can create component 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.
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependencies.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependencies.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependencies.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependencies.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,7 +1,5 @@
Title: Dependency Manager - Dependencies
-# Dependencies
-
The dependency manager supports many different types of dependencies, all of
which can be required or optional. A dependency can be added to one or more
components and it is possible to add them dynamically (even from within the
component itself if necessary, which allows for some really dynamic dependency
configuration).
## Injection
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-bundle.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-bundle.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-bundle.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-bundle.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,10 +1,8 @@
Title: Dependency Manager - Bundle Dependency
-# Bundle Dependency
-
A bundle dependency allows you to depend on a bundle in a certain set of
states, as indicated by a state mask. You can also use a filter condition that
is matched against all manifest entries. Finally you can provide a reference to
an existing bundle.
-# @BundleDependency
+## @BundleDependency
A bundle dependency allows you to depend on a bundle in a certain set of
states (INSTALLED\|RESOLVED\|STARTED\|...), as indicated by a state mask. You
can also use a filter condition that is matched against all manifest entries.
When applied on a class field, optional unavailable dependencies are injected
with a NullObject.
@@ -19,7 +17,7 @@ Attributes:
* *name*: The name used when dynamically configuring this dependency from the
init method. Specifying this attribute allows to dynamically configure the
dependency filter and required flag from the Service's init method. All unnamed
dependencies will be injected before the init() method; so from the init()
method, you can then pick up whatever information needed from already injected
(unnamed) dependencies, and configure dynamically your named dependencies,
which will then be calculated once the init() method returns.
Please refer to [Here]({{ refs.dependencymanager-annotations-lifecycle.path
}}).
-Usage Examples
+## Usage Examples
In the following example, the "SCR" Component allows to track all bundles
containing a specific "Service-Component" OSGi header, in order to load and
manage all Declarative Service components specified in the SCR xml documents
referenced by the header:
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-configuration.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-configuration.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-configuration.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-configuration.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,7 +1,5 @@
Title: Dependency Manager - Configuration Dependency
-# Configuration Dependency
-
A configuration dependency is always required, and allows you to depend on the
availability of a valid configuration for your component. Optional
configuration dependencies are not supported because in that case you can just
as well register as a `ManagedService` yourself.
## @ConfigurationDependency
@@ -19,7 +17,7 @@ configuration dependency (the map has to
with the dependency name). Then the dependency will be evaluated after the
component init
method, and will be injected before the start method.
-Usage Examples
+## Usage Examples
In the following example, the "Printer" component depends on a configuration
whose PID name is "org.apache.felix.sample.Printer". This service will
initialize its ip/port number from the provided configuration:
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-resource.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-resource.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-resource.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-resource.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,10 +1,8 @@
Title: Dependency Manager - Resource Dependency
-# Resource Dependency
-
A resource dependency allows you to depend on a resource. A resource is a URL
and you can use a filter condition based on protocol, host, port, path and URL.
-# @ResourceDependency
+## @ResourceDependency
Annotates a method of field as a Resource Dependency. A resource dependency
allows you to depend on a resource. Resources are an abstraction that is
introduced by the dependency manager, represented as a URL. They can be
implemented to serve resources embedded in bundles, somewhere on a file system
or in an http content repository server, or database.
A resource is a URL and you can use a filter condition based on protocol,
host, port, and path.
@@ -19,7 +17,8 @@ Attributes:
* *propagate*: Specifies if the resource URL properties must be propagated. If
set to true, then the URL properties ("protocol"/"host"/"port"/"path") will be
propagated to the service properties of the component which is using this
dependency.
* *name*: The name used when dynamically configuring this dependency from the
init method. Specifying this attribute allows to dynamically configure the
dependency filter and required flag from the Service's init method. All unnamed
dependencies will be injected before the init() method; so from the init()
method, you can then pick up whatever information needed from already injected
(unnamed) dependencies, and configure dynamically your named dependencies,
which will then be calculated once the init() method returns. Please refer to
[Here]({{ refs.dependencymanager-annotations-lifecycle.path }}).
-Usage Examples
+## Usage Examples
+
Here, the "VideoPlayer" component plays any provided MKV video resources
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-service.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-service.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-service.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/dependency-service.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,10 +1,8 @@
Title: Dependency Manager - Service Dependency
-# Service Dependency
-
A service dependency allows you to depend on a service, either by type or by
using an additional filter condition. You can even depend on an existing
service directly by providing a reference to it.
-# @ServiceDependency
+## @ServiceDependency
Annotates a method or a field for injecting a Service Dependency on it. When
applied on a class field, optional unavailable dependencies are injected with a
NullObject.
@@ -19,7 +17,9 @@ Notice that the changed/removed callback
* *name*: The name used when dynamically configuring this dependency from the
init method. Specifying this attribute allows to dynamically configure the
dependency filter and required flag from the Service's init method. All unnamed
dependencies will be injected before the init() method; so from the init()
method, you can then pick up whatever information needed from already injected
(unnamed) dependencies, and configure dynamically your named dependencies,
which will then be calculated once the init() method returns. Please refer to
[Here]({{ refs.dependencymanager-annotations-lifecycle.path }}) for more
informations about named dependencies.
* *propagate*: Returns true if the dependency service properties must be
published along with the service. Any additional service properties specified
directly are merged with these.
-Usage Example: Here, the MyComponent component is injected with a dependency
over a "MyDependency" service.
+## Usage Example:
+
+Here, the MyComponent component is injected with a dependency over a
"MyDependency" service.
:::java
@Component
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/thread-model.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/thread-model.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/thread-model.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/reference/thread-model.mdtext
Wed Mar 11 09:02:04 2015
@@ -2,7 +2,7 @@ Title: Dependency Manager - Thread Model
This section gives a brief overview of the default thread model used by
Dependency Manager, and also explains how to start and handle components
concurrently.
-# Default thread model
+## Default thread model
By default, Dependency Manager uses a lock-free/single thread model:
@@ -23,7 +23,7 @@ The following diagram illustrates the th
<img src="./diagrams/serial-queue.png" alt="Serial Queue" style="width:
600px"/>
-# Enabling parallelism with a *ComponentExecutorFactory*
+## Enabling parallelism with a *ComponentExecutorFactory*
As described above, all the external events that influence the state of a
given component are handed by jobs scheduled in the Serial Queue of the
Component, and the jobs are getting
executed serially by a single "master" thread. So usually, bundles are started
from a single thread, meaning that all Components are then activated
synchronously.
@@ -48,7 +48,7 @@ Notice that if the ComponentExecutorFact
"!" prefix, in order to indicate that those components must not wait for a
ComponentExecutorFactory service (since they are part of the
ComponentExecutorFactory implementation !).
-## Examples usage of the *org.apache.felix.dependencymanager.parallel*
property:
+### Examples usage of the *org.apache.felix.dependencymanager.parallel*
property:
org.apache.felix.dependencymanager.parallel=*
-> means all components must be cached until a
ComponentExecutorFactory comes up.
@@ -63,7 +63,7 @@ Notice that if the ComponentExecutorFact
components whose implementations class names are starting with
"foo.threadpool" prefix).
-## Examples of a ComponentExecutorFactory that provides a shared threadpool:
+### Examples of a ComponentExecutorFactory that provides a shared threadpool:
First, we define the OSGi bundle context system property to enable parallelism
for all DM Components excepts the one which declares the
ComponentExecutorFactory:
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/tutorials/getting-started.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/tutorials/getting-started.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/tutorials/getting-started.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/tutorials/getting-started.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,7 +1,5 @@
Title: Dependency Manager - Getting Started
-## Getting Started
-
When developing an OSGi bundle that has dependencies and possibly registers
services, there are two classes in particular we need to implement:
1. The bundle activator which controls the life-cycle of the bundle.
@@ -13,7 +11,7 @@ The following paragraphs will show vario
To use the dependency manager, you should put the
`org.apache.felix.dependencymanager.jar` in your classpath while compiling and
in your OSGi framework when running.
-### Registering a service
+## Registering a service
The first example is about registering a service. We extend
`DependencyActivatorBase` and in the `init` method we use the reference to the
`DependencyManager` to create and add a component. For this component we
subsequently set its service interface and implementation. In this case the
interface is the `Store` interface, the second parameter, `null`, allows you to
provide properties along with the service registration. For the implementation,
we only mention the `Class` of the implementation, which means the dependency
manager will lazily instantiate it. In this case, there is not much point in
doing that because the component has no dependencies, but if it had, the
instantiation would only happen when those dependencies were resolved.
@@ -55,7 +53,7 @@ And finally the implementation. Again, t
}
-### Depending on a service
+## Depending on a service
Our second example is that of a component that depends on two other services:
our `Store` from the previous example and the standard OSGi `LogService`.
Looking at the code, there is a small but important difference between the two:
`Store` is a required dependency and `LogService` is not. This means that our
component really needs a store to work, but if there is no logging available,
it can work without. Also note that this component has no `setInterface`
method, which simply means it is not itself a service. This is perfectly fine.
@@ -95,7 +93,7 @@ One final note, since we defined our `Lo
}
-### Tracking services with callbacks
+## Tracking services with callbacks
Sometimes, simply injecting services does not give you enough control over a
dependency because you might want to track more than one, or you might want to
execute some code on changes. For all those cases, callbacks are your friends.
Since one of our goals is to not introduce any kind of API in our POJO,
callbacks are declared by specifying their method names instead of through some
interface. In this case, we have a dependency on `Translator` services, and we
define `added` and `removed` as callbacks.
@@ -149,7 +147,7 @@ Finally, here's our implementation. It d
-### Depending on a configuration
+## Depending on a configuration
Not all dependencies are on services. There are several other types of
dependencies that are supported, one of them is the configuration dependency.
In fact, only *required* configuration dependencies are supported, because
optional ones can just be achieved by registering as a `ManagedService`
yourself. When defining the dependency, you must define the persistent ID of
the service. The component will not become active until the configuration you
depend on is available *and* is valid. The latter can be checked by your
implementation as we will see below.
Modified:
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/tutorials/leveraging-the-shell.mdtext
URL:
http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/tutorials/leveraging-the-shell.mdtext?rev=1665812&r1=1665811&r2=1665812&view=diff
==============================================================================
---
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/tutorials/leveraging-the-shell.mdtext
(original)
+++
felix/site/trunk/content/documentation/subprojects/apache-felix-dependency-manager/tutorials/leveraging-the-shell.mdtext
Wed Mar 11 09:02:04 2015
@@ -1,7 +1,5 @@
Title: Dependency Manager - Leveraging the shell
-# Introduction
-
The shell bundle for the dependency manager extends the gogo shell with one
new command called "dm". This command can be used to get insight in the actual
components and services in a running OSGi framework.
Typing help ```help dm``` in the gogo shell gives an overview of the available
command options.
@@ -30,7 +28,7 @@ Typing help ```help dm``` in the gogo sh
parameters:
CommandSession
-# Usage examples
+## Usage examples
Below are some examples for typical usage of the dependency manager shell
commands. The examples are based on a simple component model with a dashboard
which has a required dependency on four probes (temperature, humidity,
radiation, pressure). The radiation probe requires a Sensor service but this
sensor is not available.
__List all dependency manager components__