blob: 8702c7b2a33f0268d755d77b66e0d22572dbd85a [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_67) on Fri Mar 06 23:14:53 CET 2015 -->
<title>FactoryConfigurationAdapterService</title>
<meta name="date" content="2015-03-06">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="FactoryConfigurationAdapterService";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/Destroy.html" title="annotation in org.apache.felix.dm.annotation.api"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/Init.html" title="annotation in org.apache.felix.dm.annotation.api"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html" target="_top">Frames</a></li>
<li><a href="FactoryConfigurationAdapterService.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Required&nbsp;|&nbsp;</li>
<li><a href="#annotation_type_optional_element_summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#annotation_type_element_detail">Element</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.felix.dm.annotation.api</div>
<h2 title="Annotation Type FactoryConfigurationAdapterService" class="title">Annotation Type FactoryConfigurationAdapterService</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>@Retention(value=CLASS)
@Target(value=TYPE)
public @interface <span class="strong">FactoryConfigurationAdapterService</span></pre>
<div class="block">Annotates a class that acts as a Factory Configuration Adapter Service. For each new <code>Config Admin</code>
factory configuration matching the specified factoryPid, an instance of this service will be created.
The adapter will be registered with the specified interface, and with the specified adapter service properties.
Depending on the <code>propagate</code> parameter, every public factory configuration properties
(which don't start with ".") will be propagated along with the adapter service properties. <p>
<h3>Usage Examples</h3>
Here, a "Dictionary" service instance is created for each existing "sample.DictionaryConfiguration" factory pids.
First, we declare our factory configuration metadata using standard bndtools metatatype annotations
(see http://www.aqute.biz/Bnd/MetaType):
<blockquote>
<pre>
package sample;
import java.util.List;
import aQute.bnd.annotation.metatype.Meta.AD;
import aQute.bnd.annotation.metatype.Meta.OCD;
&#64;OCD(factory = true, description = "Declare here some Dictionary instances.")
public interface DictionaryConfiguration {
&#64;AD(description = "Describes the dictionary language.", deflt = "en")
String lang();
&#64;AD(description = "Declare here the list of words supported by this dictionary.")
List<String> words();
}
</pre>
</blockquote>
And here is the Dictionary service:
<blockquote>
<pre>
import java.util.List;
import aQute.bnd.annotation.metatype.Configurable;
&#64;FactoryConfigurationAdapterService(factoryPidClass=DictionaryConfiguration.class)
public class DictionaryImpl implements DictionaryService {
protected void updated(Dictionary&#60;String, ?&#62; props) {
// load configuration from the provided dictionary, or throw an exception of any configuration error.
DictionaryConfiguration cnf = Configurable.createConfigurable(DictionaryConfiguration.class, props);
m_lang = config.lang();
m_words.clear();
for (String word : conf.words()) {
m_words.add(word);
}
}
...
}
</pre>
</blockquote></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation_type_optional_element_summary">
<!-- -->
</a>
<h3>Optional Element Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation">
<caption><span>Optional Elements</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Optional Element and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#description()">description</a></strong></code>
<div class="block"><strong>Deprecated.</strong>&nbsp;
<div class="block"><i>use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#factoryMethod()">factoryMethod</a></strong></code>
<div class="block">Sets the static method used to create the adapter instance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#factoryPid()">factoryPid</a></strong></code>
<div class="block">Returns the factory pid whose configurations will instantiate the annotated service class.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Class&lt;?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#factoryPidClass()">factoryPidClass</a></strong></code>
<div class="block">Returns the factory pid from a class name.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#heading()">heading</a></strong></code>
<div class="block"><strong>Deprecated.</strong>&nbsp;
<div class="block"><i>use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/felix/dm/annotation/api/PropertyMetaData.html" title="annotation in org.apache.felix.dm.annotation.api">PropertyMetaData</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#metadata()">metadata</a></strong></code>
<div class="block"><strong>Deprecated.</strong>&nbsp;
<div class="block"><i>use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</i></div>
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#propagate()">propagate</a></strong></code>
<div class="block">Returns true if the configuration properties must be published along with the service.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/felix/dm/annotation/api/Property.html" title="annotation in org.apache.felix.dm.annotation.api">Property</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#properties()">properties</a></strong></code>
<div class="block">Adapter Service properties.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.Class&lt;?&gt;[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#provides()">provides</a></strong></code>
<div class="block">The interface(s) to use when registering adapters.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#updated()">updated</a></strong></code>
<div class="block">The Update method to invoke (defaulting to "updated"), when a factory configuration is created or updated</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation_type_element_detail">
<!-- -->
</a>
<h3>Element Detail</h3>
<a name="provides()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>provides</h4>
<pre>public abstract&nbsp;java.lang.Class&lt;?&gt;[]&nbsp;provides</pre>
<div class="block">The interface(s) to use when registering adapters. By default, directly implemented
interfaces will be registered in the OSGi registry.</div>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
<a name="properties()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>properties</h4>
<pre>public abstract&nbsp;<a href="../../../../../../org/apache/felix/dm/annotation/api/Property.html" title="annotation in org.apache.felix.dm.annotation.api">Property</a>[]&nbsp;properties</pre>
<div class="block">Adapter Service properties. Notice that public factory configuration is also registered in service properties,
(only if propagate is true). Public factory configuration properties are those which don't starts with a dot (".").</div>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
<a name="factoryPid()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>factoryPid</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;factoryPid</pre>
<div class="block">Returns the factory pid whose configurations will instantiate the annotated service class. (By default, the pid is the
service class name).</div>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
</li>
</ul>
<a name="factoryPidClass()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>factoryPidClass</h4>
<pre>public abstract&nbsp;java.lang.Class&lt;?&gt;&nbsp;factoryPidClass</pre>
<div class="block">Returns the factory pid from a class name. The full class name will be used as the configuration PID.
You can use this method when you use an interface annoted with standard bndtols metatype annotations.
(see http://www.aqute.biz/Bnd/MetaType).</div>
<dl>
<dt>Default:</dt>
<dd>java.lang.Object.class</dd>
</dl>
</li>
</ul>
<a name="updated()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>updated</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;updated</pre>
<div class="block">The Update method to invoke (defaulting to "updated"), when a factory configuration is created or updated</div>
<dl>
<dt>Default:</dt>
<dd>"updated"</dd>
</dl>
</li>
</ul>
<a name="propagate()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>propagate</h4>
<pre>public abstract&nbsp;boolean&nbsp;propagate</pre>
<div class="block">Returns true if the configuration properties must be published along with the service.
Any additional service properties specified directly are merged with these.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>true if configuration must be published along with the service, false if not.</dd></dl>
<dl>
<dt>Default:</dt>
<dd>false</dd>
</dl>
</li>
</ul>
<a name="heading()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>heading</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;heading</pre>
<div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</i></div>
<div class="block">The label used to display the tab name (or section) where the properties are displayed. Example: "Printer Service".</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>The label used to display the tab name where the properties are displayed.</dd></dl>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
</li>
</ul>
<a name="description()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>description</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;description</pre>
<div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</i></div>
<div class="block">A human readable description of the PID this annotation is associated with. Example: "Configuration for the PrinterService bundle".</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>A human readable description of the PID this annotation is associated with.</dd></dl>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
</li>
</ul>
<a name="metadata()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>metadata</h4>
<pre>public abstract&nbsp;<a href="../../../../../../org/apache/felix/dm/annotation/api/PropertyMetaData.html" title="annotation in org.apache.felix.dm.annotation.api">PropertyMetaData</a>[]&nbsp;metadata</pre>
<div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</i></div>
<div class="block">The list of properties types used to expose properties in web console.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>The list of properties types used to expose properties in web console.</dd></dl>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
<a name="factoryMethod()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>factoryMethod</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;factoryMethod</pre>
<div class="block">Sets the static method used to create the adapter instance.</div>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/Destroy.html" title="annotation in org.apache.felix.dm.annotation.api"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/Init.html" title="annotation in org.apache.felix.dm.annotation.api"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html" target="_top">Frames</a></li>
<li><a href="FactoryConfigurationAdapterService.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Required&nbsp;|&nbsp;</li>
<li><a href="#annotation_type_optional_element_summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#annotation_type_element_detail">Element</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>