blob: 162cde269eff933ad5159c6f3b69d0df1f973857 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_67) on Fri Mar 06 23:14:53 CET 2015 -->
<title>BundleAdapterService</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="BundleAdapterService";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/AspectService.html" title="annotation in org.apache.felix.dm.annotation.api"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/BundleDependency.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/BundleAdapterService.html" target="_top">Frames</a></li>
<li><a href="BundleAdapterService.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><a href="#annotation_type_required_element_summary">Required</a>&nbsp;|&nbsp;</li>
<li><a href="#annotation_type_optional_element_summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#annotation_type_element_detail">Element</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.felix.dm.annotation.api</div>
<h2 title="Annotation Type BundleAdapterService" class="title">Annotation Type BundleAdapterService</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">BundleAdapterService</span></pre>
<div class="block">Annotates a bundle adapter service class. Bundle adapters are similar to <a href="../../../../../../org/apache/felix/dm/annotation/api/AdapterService.html" title="annotation in org.apache.felix.dm.annotation.api"><code>AdapterService</code></a>,
but instead of adapting a service, they adapt a bundle with a certain set of states (STARTED|INSTALLED|...),
and provide a service on top of it. <p>
The bundle adapter will be applied to any bundle that matches the specified bundle state mask and
filter conditions, which may match some of the bundle OSGi manifest headers. For each matching
bundle an adapter will be created based on the adapter implementation class. The adapter will be
registered with the specified interface and with service properties found from the original bundle
OSGi manifest headers plus any extra properties you supply here.
If you declare the original bundle as a member it will be injected.
<h3>Usage Examples</h3>
<p> In the following example, a "VideoPlayer" Service is registered into the OSGi registry each time
an active bundle containing a "Video-Path" manifest header is detected:
<p>
<blockquote>
<pre>
&#64;BundleAdapterService(filter = "(Video-Path=*)", stateMask = Bundle.ACTIVE, propagate=true)
public class VideoPlayerImpl implements VideoPlayer {
Bundle bundle; // Injected by reflection
void play() {
URL mpegFile = bundle.getEntry(bundle.getHeaders().get("Video-Path"));
// play the video provided by the bundle ...
}
void stop() {}
}
</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">&nbsp;</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.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/BundleAdapterService.html#filter()">filter</a></strong></code>
<div class="block">The filter used to match a given bundle.</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">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Optional Element and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/BundleAdapterService.html#factoryMethod()">factoryMethod</a></strong></code>
<div class="block">Sets the static method used to create the BundleAdapterService implementation instance.</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/BundleAdapterService.html#propagate()">propagate</a></strong></code>
<div class="block">Specifies if manifest headers from the bundle should be propagated to the service properties.</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/BundleAdapterService.html#properties()">properties</a></strong></code>
<div class="block">Additional properties to use with the service registration</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.Class&lt;?&gt;[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/BundleAdapterService.html#provides()">provides</a></strong></code>
<div class="block">The interface(s) to use when registering adapters.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/felix/dm/annotation/api/BundleAdapterService.html#stateMask()">stateMask</a></strong></code>
<div class="block">the bundle state mask to apply</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="filter()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>filter</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;filter</pre>
<div class="block">The filter used to match a given bundle.</div>
</li>
</ul>
<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, the interface(s) directly implemented
by the annotated class 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&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">Additional properties to use with the service registration</div>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
<a name="stateMask()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stateMask</h4>
<pre>public abstract&nbsp;int&nbsp;stateMask</pre>
<div class="block">the bundle state mask to apply</div>
<dl>
<dt>Default:</dt>
<dd>38</dd>
</dl>
</li>
</ul>
<a name="propagate()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>propagate</h4>
<pre>public abstract&nbsp;boolean&nbsp;propagate</pre>
<div class="block">Specifies if manifest headers from the bundle should be propagated to the service properties.</div>
<dl>
<dt>Default:</dt>
<dd>true</dd>
</dl>
</li>
</ul>
<a name="factoryMethod()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>factoryMethod</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;factoryMethod</pre>
<div class="block">Sets the static method used to create the BundleAdapterService implementation instance.</div>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/AspectService.html" title="annotation in org.apache.felix.dm.annotation.api"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../org/apache/felix/dm/annotation/api/BundleDependency.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/BundleAdapterService.html" target="_top">Frames</a></li>
<li><a href="BundleAdapterService.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><a href="#annotation_type_required_element_summary">Required</a>&nbsp;|&nbsp;</li>
<li><a href="#annotation_type_optional_element_summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#annotation_type_element_detail">Element</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>