| <!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:13:13 CET 2015 --> |
| <title>ServiceDependency</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="ServiceDependency"; |
| } |
| //--> |
| </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/ResourceUtil.html" title="class in org.apache.felix.dm"><span class="strong">Prev Class</span></a></li> |
| <li>Next Class</li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/felix/dm/ServiceDependency.html" target="_top">Frames</a></li> |
| <li><a href="ServiceDependency.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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </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 ServiceDependency" class="title">Interface ServiceDependency</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">ServiceDependency</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">Service dependency that can track an OSGi service.</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 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"> </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/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setAutoConfig(boolean)">setAutoConfig</a></strong>(boolean autoConfig)</code> |
| <div class="block">Sets auto configuration for this service.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setAutoConfig(java.lang.String)">setAutoConfig</a></strong>(java.lang.String instanceName)</code> |
| <div class="block">Sets auto configuration for this service.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setCallbacks(java.lang.Object,%20java.lang.String,%20java.lang.String)">setCallbacks</a></strong>(java.lang.Object instance, |
| java.lang.String add, |
| java.lang.String remove)</code> |
| <div class="block">Sets the callbacks for this service.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setCallbacks(java.lang.Object,%20java.lang.String,%20java.lang.String,%20java.lang.String)">setCallbacks</a></strong>(java.lang.Object instance, |
| java.lang.String add, |
| java.lang.String change, |
| java.lang.String remove)</code> |
| <div class="block">Sets the callbacks for this service.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setCallbacks(java.lang.Object,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)">setCallbacks</a></strong>(java.lang.Object instance, |
| java.lang.String added, |
| java.lang.String changed, |
| java.lang.String removed, |
| java.lang.String swapped)</code> |
| <div class="block">Sets the callbacks for this service.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setCallbacks(java.lang.String,%20java.lang.String)">setCallbacks</a></strong>(java.lang.String add, |
| java.lang.String remove)</code> |
| <div class="block">Sets the callbacks for this service.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setCallbacks(java.lang.String,%20java.lang.String,%20java.lang.String)">setCallbacks</a></strong>(java.lang.String add, |
| java.lang.String change, |
| java.lang.String remove)</code> |
| <div class="block">Sets the callbacks for this service.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setCallbacks(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)">setCallbacks</a></strong>(java.lang.String add, |
| java.lang.String change, |
| java.lang.String remove, |
| java.lang.String swap)</code> |
| <div class="block">Sets the callbacks for this service.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setDebug(java.lang.String)">setDebug</a></strong>(java.lang.String debugKey)</code> |
| <div class="block">Enabled debug logging for this dependency instance.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setDefaultImplementation(java.lang.Object)">setDefaultImplementation</a></strong>(java.lang.Object implementation)</code> |
| <div class="block">Sets the default implementation for this service dependency.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setPropagate(boolean)">setPropagate</a></strong>(boolean propagate)</code> |
| <div class="block">Sets propagation of the service dependency properties to the provided service properties.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setPropagate(java.lang.Object,%20java.lang.String)">setPropagate</a></strong>(java.lang.Object instance, |
| java.lang.String method)</code> |
| <div class="block">Sets an Object instance and a callback method used to propagate some properties to the provided service properties.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setRequired(boolean)">setRequired</a></strong>(boolean required)</code> |
| <div class="block">Sets the required flag which determines if this service is required or not.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setService(java.lang.Class)">setService</a></strong>(java.lang.Class<?> serviceName)</code> |
| <div class="block">Sets the name of the service that should be tracked.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setService(java.lang.Class,%20org.osgi.framework.ServiceReference)">setService</a></strong>(java.lang.Class<?> serviceName, |
| org.osgi.framework.ServiceReference serviceReference)</code> |
| <div class="block">Sets the name of the service that should be tracked.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setService(java.lang.Class,%20java.lang.String)">setService</a></strong>(java.lang.Class<?> serviceName, |
| java.lang.String serviceFilter)</code> |
| <div class="block">Sets the name of the service that should be tracked.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setService(java.lang.String)">setService</a></strong>(java.lang.String serviceFilter)</code> |
| <div class="block">Sets the filter for the services that should be tracked.</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 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 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="setCallbacks(java.lang.String, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCallbacks</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setCallbacks(java.lang.String add, |
| java.lang.String remove)</pre> |
| <div class="block">Sets the callbacks for this service. These callbacks can be used as hooks whenever a |
| dependency is added or removed. When you specify callbacks, the auto configuration |
| feature is automatically turned off, because we're assuming you don't need it in this |
| case.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>add</code> - the method to call when a service was added</dd><dd><code>remove</code> - the method to call when a service was removed</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setCallbacks(java.lang.String, java.lang.String, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCallbacks</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setCallbacks(java.lang.String add, |
| java.lang.String change, |
| java.lang.String remove)</pre> |
| <div class="block">Sets the callbacks for this service. These callbacks can be used as hooks whenever a |
| dependency is added, changed or removed. When you specify callbacks, the auto |
| configuration feature is automatically turned off, because we're assuming you don't |
| need it in this case.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>add</code> - the method to call when a service was added</dd><dd><code>change</code> - the method to call when a service was changed</dd><dd><code>remove</code> - the method to call when a service was removed</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setCallbacks(java.lang.String, java.lang.String, java.lang.String, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCallbacks</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setCallbacks(java.lang.String add, |
| java.lang.String change, |
| java.lang.String remove, |
| java.lang.String swap)</pre> |
| <div class="block">Sets the callbacks for this service. These callbacks can be used as hooks whenever a |
| dependency is added, changed or removed. When you specify callbacks, the auto |
| configuration feature is automatically turned off, because we're assuming you don't |
| need it in this case.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>add</code> - the method to call when a service was added</dd><dd><code>change</code> - the method to call when a service was changed</dd><dd><code>remove</code> - the method to call when a service was removed</dd><dd><code>swap</code> - the method to call when the service was swapped due to addition or |
| removal of an aspect</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setCallbacks(java.lang.Object, java.lang.String, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCallbacks</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setCallbacks(java.lang.Object instance, |
| java.lang.String add, |
| java.lang.String remove)</pre> |
| <div class="block">Sets the callbacks for this service. These callbacks can be used as hooks whenever a |
| dependency is added or removed. They are called on the instance you provide. When you |
| specify callbacks, the auto configuration feature is automatically turned off, because |
| we're assuming you don't need it in this case.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>instance</code> - the instance to call the callbacks on</dd><dd><code>add</code> - the method to call when a service was added</dd><dd><code>remove</code> - the method to call when a service was removed</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setCallbacks(java.lang.Object, java.lang.String, java.lang.String, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCallbacks</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setCallbacks(java.lang.Object instance, |
| java.lang.String add, |
| java.lang.String change, |
| java.lang.String remove)</pre> |
| <div class="block">Sets the callbacks for this service. These callbacks can be used as hooks whenever a |
| dependency is added, changed or removed. They are called on the instance you provide. When you |
| specify callbacks, the auto configuration feature is automatically turned off, because |
| we're assuming you don't need it in this case.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>instance</code> - the instance to call the callbacks on</dd><dd><code>add</code> - the method to call when a service was added</dd><dd><code>change</code> - the method to call when a service was changed</dd><dd><code>remove</code> - the method to call when a service was removed</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setCallbacks(java.lang.Object, java.lang.String, java.lang.String, java.lang.String, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCallbacks</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setCallbacks(java.lang.Object instance, |
| java.lang.String added, |
| java.lang.String changed, |
| java.lang.String removed, |
| java.lang.String swapped)</pre> |
| <div class="block">Sets the callbacks for this service. These callbacks can be used as hooks whenever a |
| dependency is added, changed or removed. When you specify callbacks, the auto |
| configuration feature is automatically turned off, because we're assuming you don't |
| need it in this case.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>instance</code> - the instance to call the callbacks on</dd><dd><code>added</code> - the method to call when a service was added</dd><dd><code>changed</code> - the method to call when a service was changed</dd><dd><code>removed</code> - the method to call when a service was removed</dd><dd><code>swapped</code> - the method to call when the service was swapped due to addition or |
| removal of an aspect</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setRequired(boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setRequired</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setRequired(boolean required)</pre> |
| <div class="block">Sets the required flag which determines if this service is required or not. |
| A ServiceDependency is false by default.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>required</code> - the required flag</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setAutoConfig(boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAutoConfig</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setAutoConfig(boolean autoConfig)</pre> |
| <div class="block">Sets auto configuration for this service. Auto configuration allows the |
| dependency to fill in the attribute in the service implementation that |
| has the same type and instance name. Dependency services will be injected |
| in the following kind of fields:<p> |
| <ul> |
| <li> a field having the same type as the dependency. If the field may be accessed by anythread, then |
| the field should be declared volatile, in order to ensure visibility when the field is auto injected concurrently. |
| |
| <li> a field which is assignable to an <code>Iterable<T></code> where T must match the dependency type. |
| In this case, an Iterable will be injected by DependencyManager before the start callback is called. |
| The Iterable field may then be traversed to inspect the currently available dependency services. The Iterable |
| can possibly be set to a final value so you can choose the Iterable implementation of your choice |
| (for example, a CopyOnWrite ArrayList, or a ConcurrentLinkedQueue). |
| |
| <li> a <code>Map<K,V></code> where K must match the dependency type and V must exactly equals <code>Dictionary</code>. |
| In this case, a ConcurrentHashMap will be injected by DependencyManager before the start callback is called. |
| The Map may then be consulted to lookup current available dependency services, including the dependency service |
| properties (the map key holds the dependency service, and the map value holds the dependency service properties). |
| |
| The Map field may be set to a final value so you can choose a Map of your choice (Typically a ConcurrentHashMap). |
| |
| A ConcurrentHashMap is "weakly consistent", meaning that when traversing |
| the elements, you may or may not see any concurrent updates made on the map. So, take care to traverse |
| the map using an iterator on the map entry set, which allows to atomically lookup pairs of Dependency service/Service properties. |
| </ul> |
| |
| <p> Here are some example using an Iterable: |
| <blockquote> |
| |
| <pre> |
| |
| public class SpellChecker { |
| // can be traversed to inspect currently available dependencies |
| final Iterable<DictionaryService> dictionaries = new ConcurrentLinkedQueue<>(); |
| |
| Or |
| |
| // will be injected by DM automatically and can be traversed any time to inspect all currently available dependencies. |
| volatile Iterable<DictionaryService> dictionaries = null; |
| } |
| |
| </pre> |
| </blockquote> |
| |
| Here are some example using a Map: |
| <blockquote> |
| |
| <pre> |
| |
| public class SpellChecker { |
| // can be traversed to inspect currently available dependencies |
| final Map<DictionaryService, Dictionary> dictionaries = new ConcurrentLinkedQueue<>(); |
| |
| or |
| |
| // will be injected by DM automatically and can be traversed to inspect currently available dependencies |
| volatile Map<DictionaryService, Dictionary> dictionaries = null; |
| |
| void iterateOnAvailableServices() { |
| for (Map.Entry<MyService, Dictionary> entry : this.services.entrySet()) { |
| MyService currentService = entry.getKey(); |
| Dictionary currentServiceProperties = entry.getValue(); |
| // ... |
| } |
| } |
| } |
| |
| </pre> |
| </blockquote></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>autoConfig</code> - the name of attribute to auto configure</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setAutoConfig(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAutoConfig</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setAutoConfig(java.lang.String instanceName)</pre> |
| <div class="block">Sets auto configuration for this service. Auto configuration allows the |
| dependency to fill in the attribute in the service implementation that |
| has the same type and instance name.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>instanceName</code> - the name of attribute to auto config</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/felix/dm/ServiceDependency.html#setAutoConfig(boolean)"><code>setAutoConfig(boolean)</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="setService(java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setService</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setService(java.lang.Class<?> serviceName)</pre> |
| <div class="block">Sets the name of the service that should be tracked.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>serviceName</code> - the name of the service</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setService(java.lang.Class, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setService</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setService(java.lang.Class<?> serviceName, |
| java.lang.String serviceFilter)</pre> |
| <div class="block">Sets the name of the service that should be tracked. You can either specify |
| only the name, or the name and a filter. In the latter case, the filter is used |
| to track the service and should only return services of the type that was specified |
| in the name. To make sure of this, the filter is actually extended internally to |
| filter on the correct name.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>serviceName</code> - the name of the service</dd><dd><code>serviceFilter</code> - the filter condition</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setService(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setService</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setService(java.lang.String serviceFilter)</pre> |
| <div class="block">Sets the filter for the services that should be tracked. Any service object |
| matching the filter will be returned, without any additional filter on the |
| class.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>serviceFilter</code> - the filter condition</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setService(java.lang.Class, org.osgi.framework.ServiceReference)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setService</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setService(java.lang.Class<?> serviceName, |
| org.osgi.framework.ServiceReference serviceReference)</pre> |
| <div class="block">Sets the name of the service that should be tracked. You can either specify |
| only the name, or the name and a reference. In the latter case, the service reference |
| is used to track the service and should only return services of the type that was |
| specified in the name.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>serviceName</code> - the name of the service</dd><dd><code>serviceReference</code> - the service reference to track</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setDefaultImplementation(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setDefaultImplementation</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setDefaultImplementation(java.lang.Object implementation)</pre> |
| <div class="block">Sets the default implementation for this service dependency. You can use this to supply |
| your own implementation that will be used instead of a Null Object when the dependency is |
| not available. This is also convenient if the service dependency is not an interface |
| (which would cause the Null Object creation to fail) but a class.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>implementation</code> - the instance to use or the class to instantiate if you want to lazily |
| instantiate this implementation</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency</dd></dl> |
| </li> |
| </ul> |
| <a name="setPropagate(boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setPropagate</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setPropagate(boolean propagate)</pre> |
| <div class="block">Sets propagation of the service dependency properties to the provided service properties. Any additional |
| service properties specified directly are merged with these.</div> |
| </li> |
| </ul> |
| <a name="setPropagate(java.lang.Object, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setPropagate</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setPropagate(java.lang.Object instance, |
| java.lang.String method)</pre> |
| <div class="block">Sets an Object instance and a callback method used to propagate some properties to the provided service properties. |
| The method will be invoked on the specified object instance and must have one of the following signatures:<p> |
| <ul><li>Dictionary callback(ServiceReference, Object service) |
| <li>Dictionary callback(ServiceReference) |
| </ul></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>instance</code> - the Object instance which is used to retrieve propagated service properties</dd><dd><code>method</code> - the method to invoke for retrieving the properties to be propagated to the service properties.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency.</dd></dl> |
| </li> |
| </ul> |
| <a name="setDebug(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>setDebug</h4> |
| <pre><a href="../../../../org/apache/felix/dm/ServiceDependency.html" title="interface in org.apache.felix.dm">ServiceDependency</a> setDebug(java.lang.String debugKey)</pre> |
| <div class="block">Enabled debug logging for this dependency instance. The logging is prefixed with the given identifier.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>debugKey</code> - a prefix log identifier</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this service dependency.</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="../../../../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/ResourceUtil.html" title="class in org.apache.felix.dm"><span class="strong">Prev Class</span></a></li> |
| <li>Next Class</li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/felix/dm/ServiceDependency.html" target="_top">Frames</a></li> |
| <li><a href="ServiceDependency.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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |