blob: 592fad44a0f1d338308b3960784eacd25ff2bb4b [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 (1.8.0_74) on Wed Feb 24 01:07:22 CET 2016 -->
<title>FactoryConfigurationAdapterService</title>
<meta name="date" content="2016-02-24">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="FactoryConfigurationAdapterService";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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="typeNameLink">Prev&nbsp;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="typeNameLink">Next&nbsp;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&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;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>Field&nbsp;|&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>Field&nbsp;|&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="memberNameLabel">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> If you specify a configuration type, then the fqdn of the configuration interface is used as the factory pid,
else you can specify the factory pid explicitly using the factoryPid attribute.
If no configuration type is used and no factoryPid attribute is specified, then the factory pid will be set to the fqdn of
the class on which this annotation is applied.
<p> (see javadoc from <a href="../../../../../../org/apache/felix/dm/annotation/api/ConfigurationDependency.html" title="annotation in org.apache.felix.dm.annotation.api"><code>ConfigurationDependency</code></a> for more informations about configuration types).
<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&#60;String&#62; words();
}
</pre>
</blockquote>
And here is the factory pid adapter service, which is instantiated for each instance of the "sample.DictionaryConfiguration" factory pid:
<blockquote>
<pre>
import java.util.List;
import aQute.bnd.annotation.metatype.Configurable;
&#64;FactoryConfigurationAdapterService(configType=DictionaryConfiguration.class)
public class DictionaryImpl implements DictionaryService {
protected void updated(DictionaryConfiguration config) {
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="memberSummary" 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.Class&lt;?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#configType--">configType</a></span></code>
<div class="block">Returns the type safe configuration class which will be injected in the updated callback.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#description--">description</a></span></code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</span></div>
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#factoryMethod--">factoryMethod</a></span></code>
<div class="block">Sets the static method used to create the adapter instance.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#factoryPid--">factoryPid</a></span></code>
<div class="block">Returns the factory pid whose configurations will instantiate the annotated service class.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.Class&lt;?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#factoryPidClass--">factoryPidClass</a></span></code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">use <a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#configType--"><code>configType()</code></a> and accept a configuration type parameter from your updated callback. The pid
is then assumed to match the fqdn of the configuration type.</span></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#heading--">heading</a></span></code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</span></div>
</div>
</td>
</tr>
<tr class="altColor">
<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><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#metadata--">metadata</a></span></code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</span></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#propagate--">propagate</a></span></code>
<div class="block">Returns true if the configuration properties must be published along with the service.</div>
</td>
</tr>
<tr class="altColor">
<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><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#properties--">properties</a></span></code>
<div class="block">Adapter Service properties.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Class&lt;?&gt;[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#provides--">provides</a></span></code>
<div class="block">The interface(s) to use when registering adapters.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#updated--">updated</a></span></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><span class="returnLabel">Returns:</span></dt>
<dd>the registered service interfaces</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><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><span class="returnLabel">Returns:</span></dt>
<dd>the adapter service properties</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="configType--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>configType</h4>
<pre>public abstract&nbsp;java.lang.Class&lt;?&gt;&nbsp;configType</pre>
<div class="block">Returns the type safe configuration class which will be injected in the updated callback.
By default, the factory pid is assumed to match the fqdn of the configuration type.
see javadoc from <a href="../../../../../../org/apache/felix/dm/annotation/api/ConfigurationDependency.html" title="annotation in org.apache.felix.dm.annotation.api"><code>ConfigurationDependency</code></a> for more informations about configuration types.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the configuration type to pass in the "updated" callback argument.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../org/apache/felix/dm/annotation/api/ConfigurationDependency.html" title="annotation in org.apache.felix.dm.annotation.api"><code>ConfigurationDependency</code></a></dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>java.lang.Object.class</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><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><span class="returnLabel">Returns:</span></dt>
<dd>the factory pid</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><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"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">use <a href="../../../../../../org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#configType--"><code>configType()</code></a> and accept a configuration type parameter from your updated callback. The pid
is then assumed to match the fqdn of the configuration type.</span></div>
<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><span class="returnLabel">Returns:</span></dt>
<dd>the factory pid class</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>java.lang.Object.class</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><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><span class="returnLabel">Returns:</span></dt>
<dd>the updated callback</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>"updated"</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><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="returnLabel">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>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><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="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</span></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="returnLabel">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>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><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="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</span></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="returnLabel">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>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><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="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">use standard bndtools metatype annotations instead (see http://www.aqute.biz/Bnd/MetaType)</span></div>
<div class="block">The list of properties types used to expose properties in web console.</div>
<dl>
<dt><span class="returnLabel">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>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><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><span class="returnLabel">Returns:</span></dt>
<dd>the factory method</dd>
</dl>
<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>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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="typeNameLink">Prev&nbsp;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="typeNameLink">Next&nbsp;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&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;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>Field&nbsp;|&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>Field&nbsp;|&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>