blob: b6e13fb77db9ee9baada68a7ebf056ef99e437c6 [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_75) on Tue Jun 09 23:29:44 CEST 2015 -->
<title>ConfigurationDependency</title>
<meta name="date" content="2015-06-09">
<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="ConfigurationDependency";
}
//-->
</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="../../../../overview-summary.html">Overview</a></li>
<li><a href="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/ComponentStateListener.html" title="interface in org.apache.felix.dm"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/felix/dm/Dependency.html" title="interface in org.apache.felix.dm"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/felix/dm/ConfigurationDependency.html" target="_top">Frames</a></li>
<li><a href="ConfigurationDependency.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>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</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</div>
<h2 title="Interface ConfigurationDependency" class="title">Interface ConfigurationDependency</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html" title="interface in org.apache.felix.dm">ComponentDependencyDeclaration</a>, <a href="../../../../org/apache/felix/dm/Dependency.html" title="interface in org.apache.felix.dm">Dependency</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="strong">ConfigurationDependency</span>
extends <a href="../../../../org/apache/felix/dm/Dependency.html" title="interface in org.apache.felix.dm">Dependency</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html" title="interface in org.apache.felix.dm">ComponentDependencyDeclaration</a></pre>
<div class="block">Configuration dependency that can track the availability of a (valid) configuration. To use
it, specify a PID for the configuration. The dependency is always required, because if it is
not, it does not make sense to use the dependency manager. In that scenario, simply register
your component as a <code>ManagedService(Factory)</code> and handle everything yourself. Also,
only managed services are supported, not factories. If you need support for factories, then
you can use
<a href="../../../../org/apache/felix/dm/DependencyManager.html#createFactoryConfigurationAdapterService(java.lang.String,%20java.lang.String,%20boolean)"><code>DependencyManager.createFactoryConfigurationAdapterService(String, String, boolean)</code></a>.
There are a couple of things you need to be aware of when implementing the
<code>updated(Dictionary)</code> method:
<ul>
<li>Make sure it throws a <code>ConfigurationException</code> or any other exception when you
get a configuration that is invalid. In this case, the dependency will not change:
if it was not available, it will still not be. If it was available, it will remain available
and implicitly assume you keep working with your old configuration.</li>
<li>This method will be called before all required dependencies are available. Make sure you
do not depend on these to parse your settings.</li>
<li>unlike all other DM dependency callbacks, the update method is called from the CM configuration
update thread, and is not serialized with the internal queue maintained by the DM component.
So, take care to concurrent calls between updated callback and your other lifecycle callbacks.
<li>When the configuration is lost, updated callback is invoked with a null dictionary parameter,
and then the component stop lifecycle callback is invoked.
<li>When the DM component is stopped, then updated(null) is not invoked.
</ul>
The callback invoked when a configuration dependency is updated can supports the following signatures:<p>
<ul><li> updated(Dictionary)
<li> updated(Component, Dictionary)
</ul></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.felix.dm.ComponentDependencyDeclaration">
<!-- -->
</a>
<h3>Fields inherited from interface&nbsp;org.apache.felix.dm.<a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html" title="interface in org.apache.felix.dm">ComponentDependencyDeclaration</a></h3>
<code><a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#STATE_AVAILABLE_OPTIONAL">STATE_AVAILABLE_OPTIONAL</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#STATE_AVAILABLE_REQUIRED">STATE_AVAILABLE_REQUIRED</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#STATE_NAMES">STATE_NAMES</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#STATE_OPTIONAL">STATE_OPTIONAL</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#STATE_REQUIRED">STATE_REQUIRED</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#STATE_UNAVAILABLE_OPTIONAL">STATE_UNAVAILABLE_OPTIONAL</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#STATE_UNAVAILABLE_REQUIRED">STATE_UNAVAILABLE_REQUIRED</a></code></li>
</ul>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html#add(org.apache.felix.dm.PropertyMetaData)">add</a></strong>(<a href="../../../../org/apache/felix/dm/PropertyMetaData.html" title="interface in org.apache.felix.dm">PropertyMetaData</a>&nbsp;properties)</code>
<div class="block">Adds a MetaData regarding a given configuration property.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html#setCallback(java.lang.Object,%20java.lang.String)">setCallback</a></strong>(java.lang.Object&nbsp;instance,
java.lang.String&nbsp;callback)</code>
<div class="block">Sets the name of the callback method that should be invoked when a configuration
is available.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html#setCallback(java.lang.String)">setCallback</a></strong>(java.lang.String&nbsp;callback)</code>
<div class="block">Sets the name of the callback method that should be invoked when a configuration
is available.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html#setDescription(java.lang.String)">setDescription</a></strong>(java.lang.String&nbsp;description)</code>
<div class="block">A human readable description of the PID this configuration is associated
with.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html#setHeading(java.lang.String)">setHeading</a></strong>(java.lang.String&nbsp;heading)</code>
<div class="block">The label used to display the tab name (or section) where the properties
are displayed.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html#setLocalization(java.lang.String)">setLocalization</a></strong>(java.lang.String&nbsp;path)</code>
<div class="block">Points to the basename of the Properties file that can localize the Meta
Type informations.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html#setPid(java.lang.String)">setPid</a></strong>(java.lang.String&nbsp;pid)</code>
<div class="block">Sets the <code>service.pid</code> of the configuration you are depending
on.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html#setPropagate(boolean)">setPropagate</a></strong>(boolean&nbsp;propagate)</code>
<div class="block">Sets propagation of the configuration properties to the service
properties.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.felix.dm.Dependency">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.felix.dm.<a href="../../../../org/apache/felix/dm/Dependency.html" title="interface in org.apache.felix.dm">Dependency</a></h3>
<code><a href="../../../../org/apache/felix/dm/Dependency.html#getAutoConfigName()">getAutoConfigName</a>, <a href="../../../../org/apache/felix/dm/Dependency.html#getProperties()">getProperties</a>, <a href="../../../../org/apache/felix/dm/Dependency.html#isAutoConfig()">isAutoConfig</a>, <a href="../../../../org/apache/felix/dm/Dependency.html#isAvailable()">isAvailable</a>, <a href="../../../../org/apache/felix/dm/Dependency.html#isPropagated()">isPropagated</a>, <a href="../../../../org/apache/felix/dm/Dependency.html#isRequired()">isRequired</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.felix.dm.ComponentDependencyDeclaration">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.felix.dm.<a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html" title="interface in org.apache.felix.dm">ComponentDependencyDeclaration</a></h3>
<code><a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#getFilter()">getFilter</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#getName()">getName</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#getSimpleName()">getSimpleName</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#getState()">getState</a>, <a href="../../../../org/apache/felix/dm/ComponentDependencyDeclaration.html#getType()">getType</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setCallback(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCallback</h4>
<pre><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a>&nbsp;setCallback(java.lang.String&nbsp;callback)</pre>
<div class="block">Sets the name of the callback method that should be invoked when a configuration
is available. The contract for this method is identical to that of
<code>ManagedService.updated(Dictionary) throws ConfigurationException</code>.
By default, if this method is not called, the callback name is "updated".</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>callback</code> - the name of the callback method</dd></dl>
</li>
</ul>
<a name="setCallback(java.lang.Object, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCallback</h4>
<pre><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a>&nbsp;setCallback(java.lang.Object&nbsp;instance,
java.lang.String&nbsp;callback)</pre>
<div class="block">Sets the name of the callback method that should be invoked when a configuration
is available. The contract for this method is identical to that of
<code>ManagedService.updated(Dictionary) throws ConfigurationException</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>instance</code> - the instance to call the callbacks on</dd><dd><code>callback</code> - the name of the callback method</dd></dl>
</li>
</ul>
<a name="setPid(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPid</h4>
<pre><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a>&nbsp;setPid(java.lang.String&nbsp;pid)</pre>
<div class="block">Sets the <code>service.pid</code> of the configuration you are depending
on.</div>
</li>
</ul>
<a name="setPropagate(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPropagate</h4>
<pre><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a>&nbsp;setPropagate(boolean&nbsp;propagate)</pre>
<div class="block">Sets propagation of the configuration properties to the service
properties. Any additional service properties specified directly are
merged with these.</div>
</li>
</ul>
<a name="setHeading(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setHeading</h4>
<pre><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a>&nbsp;setHeading(java.lang.String&nbsp;heading)</pre>
<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 (may be localized)</dd></dl>
</li>
</ul>
<a name="setDescription(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDescription</h4>
<pre><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a>&nbsp;setDescription(java.lang.String&nbsp;description)</pre>
<div class="block">A human readable description of the PID this configuration 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 configuration is
associated with (may be localized)</dd></dl>
</li>
</ul>
<a name="setLocalization(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setLocalization</h4>
<pre><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a>&nbsp;setLocalization(java.lang.String&nbsp;path)</pre>
<div class="block">Points to the basename of the Properties file that can localize the Meta
Type informations. The default localization base name for the properties
is OSGI-INF/l10n/bundle, but can be overridden by the manifest
Bundle-Localization header (see core specification, in section
Localization on page 68). You can specify a specific localization
basename file using this method (e.g.
<code>setLocalization("person")</code> will match person_du_NL.properties
in the root bundle directory.</div>
</li>
</ul>
<a name="add(org.apache.felix.dm.PropertyMetaData)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>add</h4>
<pre><a href="../../../../org/apache/felix/dm/ConfigurationDependency.html" title="interface in org.apache.felix.dm">ConfigurationDependency</a>&nbsp;add(<a href="../../../../org/apache/felix/dm/PropertyMetaData.html" title="interface in org.apache.felix.dm">PropertyMetaData</a>&nbsp;properties)</pre>
<div class="block">Adds a MetaData regarding a given configuration property.</div>
</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="../../../../overview-summary.html">Overview</a></li>
<li><a href="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/ComponentStateListener.html" title="interface in org.apache.felix.dm"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/felix/dm/Dependency.html" title="interface in org.apache.felix.dm"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/felix/dm/ConfigurationDependency.html" target="_top">Frames</a></li>
<li><a href="ConfigurationDependency.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>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>