| <!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 Tue Mar 24 21:21:23 CET 2015 --> |
| <title>AdapterService</title> |
| <meta name="date" content="2015-03-24"> |
| <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="AdapterService"; |
| } |
| //--> |
| </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>Prev Class</li> |
| <li><a href="../../../../../../org/apache/felix/dm/annotation/api/AspectService.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/AdapterService.html" target="_top">Frames</a></li> |
| <li><a href="AdapterService.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><a href="#annotation_type_required_element_summary">Required</a> | </li> |
| <li><a href="#annotation_type_optional_element_summary">Optional</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </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 AdapterService" class="title">Annotation Type AdapterService</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">AdapterService</span></pre> |
| <div class="block">Annotates an Adapater service. Adapters, like <a href="../../../../../../org/apache/felix/dm/annotation/api/AspectService.html" title="annotation in org.apache.felix.dm.annotation.api"><code>AspectService</code></a>, are used to "extend" |
| existing services, and can publish different services based on the existing one. |
| An example would be implementing a management interface for an existing service, etc .... |
| <p>When you annotate an adapter class with the <code>@AdapterService</code> annotation, it will be applied |
| to any service that matches the implemented interface and filter. The adapter will be registered |
| with the specified interface and existing properties from the original service plus any extra |
| properties you supply here. If you declare the original service as a member it will be injected. |
| |
| <h3>Usage Examples</h3> |
| |
| <p> Here, the AdapterService is registered into the OSGI registry each time an AdapteeService |
| is found from the registry. The AdapterImpl class adapts the AdapteeService to the AdapterService. |
| The AdapterService will also have a service property (param=value), and will also include eventual |
| service properties found from the AdapteeService:<p> |
| <blockquote> |
| <pre> |
| |
| @AdapterService(adapteeService = AdapteeService.class, properties={@Property(name="param", value="value")}) |
| class AdapterImpl implements AdapterService { |
| // The service we are adapting (injected by reflection) |
| protected AdapteeService adaptee; |
| |
| public void doWork() { |
| adaptee.mehod1(); |
| adaptee.method2(); |
| } |
| } |
| </pre> |
| </blockquote></div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="annotation_type_required_element_summary"> |
| <!-- --> |
| </a> |
| <h3>Required Element Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Required Element Summary table, listing required elements, and an explanation"> |
| <caption><span>Required Elements</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Required Element and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>java.lang.Class<?></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/AdapterService.html#adapteeService()">adapteeService</a></strong></code> |
| <div class="block">Sets the adaptee service interface this adapter is applying to.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- =========== 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"> </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/AdapterService.html#adapteeFilter()">adapteeFilter</a></strong></code> |
| <div class="block">Sets the filter condition to use with the adapted service interface.</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/AdapterService.html#added()">added</a></strong></code> |
| <div class="block">The callback method to be invoked when the original service is available.</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/AdapterService.html#changed()">changed</a></strong></code> |
| <div class="block">The callback method to be invoked when the original service properties have changed.</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/AdapterService.html#factoryMethod()">factoryMethod</a></strong></code> |
| <div class="block">Sets the static method used to create the adapter service implementation 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/AdapterService.html#field()">field</a></strong></code> |
| <div class="block">Sets the field name where to inject the original service.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/AdapterService.html#propagate()">propagate</a></strong></code> |
| <div class="block">Specifies if adaptee service properties should be propagated to the adapter 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><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/AdapterService.html#properties()">properties</a></strong></code> |
| <div class="block">Sets some additional properties to use with the adapter service registration.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>java.lang.Class<?>[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/AdapterService.html#provides()">provides</a></strong></code> |
| <div class="block">Sets the adapter service interface(s).</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/AdapterService.html#removed()">removed</a></strong></code> |
| <div class="block">The callback method to invoke when the service is lost.</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/AdapterService.html#swap()">swap</a></strong></code> |
| <div class="block">name of the callback method to invoke on swap.</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="adapteeService()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>adapteeService</h4> |
| <pre>public abstract java.lang.Class<?> adapteeService</pre> |
| <div class="block">Sets the adaptee service interface this adapter is applying to.</div> |
| </li> |
| </ul> |
| <a name="provides()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>provides</h4> |
| <pre>public abstract java.lang.Class<?>[] provides</pre> |
| <div class="block">Sets the adapter service interface(s). By default, the directly implemented interface(s) is (are) used.</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 <a href="../../../../../../org/apache/felix/dm/annotation/api/Property.html" title="annotation in org.apache.felix.dm.annotation.api">Property</a>[] properties</pre> |
| <div class="block">Sets some additional properties to use with the adapter service registration. By default, |
| the adapter will inherit all adaptee service properties.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>{}</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="adapteeFilter()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>adapteeFilter</h4> |
| <pre>public abstract java.lang.String adapteeFilter</pre> |
| <div class="block">Sets the filter condition to use with the adapted service interface.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>""</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="factoryMethod()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>factoryMethod</h4> |
| <pre>public abstract java.lang.String factoryMethod</pre> |
| <div class="block">Sets the static method used to create the adapter service implementation instance. |
| By default, the default constructor of the annotated class is used.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>""</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="field()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>field</h4> |
| <pre>public abstract java.lang.String field</pre> |
| <div class="block">Sets the field name where to inject the original service. By default, the original service is injected |
| in any attributes in the aspect implementation that are of the same type as the aspect interface.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>""</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="added()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>added</h4> |
| <pre>public abstract java.lang.String added</pre> |
| <div class="block">The callback method to be invoked when the original service is available. This attribute can't be mixed with |
| the field attribute.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>""</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="changed()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>changed</h4> |
| <pre>public abstract java.lang.String changed</pre> |
| <div class="block">The callback method to be invoked when the original service properties have changed. When this attribute is used, |
| then the added attribute must also be used.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>""</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="swap()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>swap</h4> |
| <pre>public abstract java.lang.String swap</pre> |
| <div class="block">name of the callback method to invoke on swap.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>""</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="removed()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>removed</h4> |
| <pre>public abstract java.lang.String removed</pre> |
| <div class="block">The callback method to invoke when the service is lost. When this attribute is used, then the added attribute |
| must also be used.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>""</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="propagate()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>propagate</h4> |
| <pre>public abstract boolean propagate</pre> |
| <div class="block">Specifies if adaptee service properties should be propagated to the adapter service.</div> |
| <dl> |
| <dt>Default:</dt> |
| <dd>true</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>Prev Class</li> |
| <li><a href="../../../../../../org/apache/felix/dm/annotation/api/AspectService.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/AdapterService.html" target="_top">Frames</a></li> |
| <li><a href="AdapterService.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><a href="#annotation_type_required_element_summary">Required</a> | </li> |
| <li><a href="#annotation_type_optional_element_summary">Optional</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </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> |