blob: a0a58dc5593b1f939a6f63e203bef3a7924763f8 [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) on Wed Dec 24 15:58:26 CET 2014 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InstanceBuilder (Apache Felix iPOJO ~ JavaDoc 1.12.1 API)</title>
<meta name="date" content="2014-12-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="InstanceBuilder (Apache Felix iPOJO ~ JavaDoc 1.12.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</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="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/InstanceBuilder.html">Use</a></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>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/felix/ipojo/extender/ExtensionDeclaration.html" title="interface in org.apache.felix.ipojo.extender"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/felix/ipojo/extender/InstanceDeclaration.html" title="interface in org.apache.felix.ipojo.extender"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/felix/ipojo/extender/InstanceBuilder.html" target="_top">Frames</a></li>
<li><a href="InstanceBuilder.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>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.ipojo.extender</div>
<h2 title="Interface InstanceBuilder" class="title">Interface InstanceBuilder</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../../org/apache/felix/ipojo/extender/internal/declaration/service/DefaultInstanceBuilder.html" title="class in org.apache.felix.ipojo.extender.internal.declaration.service">DefaultInstanceBuilder</a></dd>
</dl>
<hr>
<br>
<pre>public interface <a href="../../../../../src-html/org/apache/felix/ipojo/extender/InstanceBuilder.html#line.32">InstanceBuilder</a></pre>
<div class="block">Support class for fluent instance declaration building.
This class can be used to specify instance details like naming, component's type, component's version.
The <code>#context(org.osgi.framework.BundleContext)</code> method can be used to override the default
<a href="http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html?is-external=true" title="class or interface in org.osgi.framework"><code>BundleContext</code></a> used for declaration service registration.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.11.2</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/felix/ipojo/extender/DeclarationHandle.html" title="interface in org.apache.felix.ipojo.extender">DeclarationHandle</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html#build--">build</a></span>()</code>
<div class="block">Build the declaration handle (never contains any configuration).</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/felix/ipojo/extender/ConfigurationBuilder.html" title="interface in org.apache.felix.ipojo.extender">ConfigurationBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html#configure--">configure</a></span>()</code>
<div class="block">Access the dedicated builder for configuration (properties).</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html" title="interface in org.apache.felix.ipojo.extender">InstanceBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html#context-BundleContext-">context</a></span>(BundleContext&nbsp;context)</code>
<div class="block">Override the default BundleContext used for declaration service registration.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html" title="interface in org.apache.felix.ipojo.extender">InstanceBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html#name-java.lang.String-">name</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code>
<div class="block">Specify the instance name.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html" title="interface in org.apache.felix.ipojo.extender">InstanceBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html#type-java.lang.Class-">type</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;&nbsp;type)</code>
<div class="block">Specify the component's type of this instance.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html" title="interface in org.apache.felix.ipojo.extender">InstanceBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html#type-java.lang.String-">type</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;type)</code>
<div class="block">Specify the component's type of this instance.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html" title="interface in org.apache.felix.ipojo.extender">InstanceBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html#version-java.lang.String-">version</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;version)</code>
<div class="block">Specify the component's version of this instance.</div>
</td>
</tr>
</table>
</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="name-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>name</h4>
<pre><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html" title="interface in org.apache.felix.ipojo.extender">InstanceBuilder</a>&nbsp;<a href="../../../../../src-html/org/apache/felix/ipojo/extender/InstanceBuilder.html#line.39">name</a>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
<div class="block">Specify the instance name. Using null will result in an anonymous instance.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - instance name or null</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this builder</dd>
</dl>
</li>
</ul>
<a name="type-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>type</h4>
<pre><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html" title="interface in org.apache.felix.ipojo.extender">InstanceBuilder</a>&nbsp;<a href="../../../../../src-html/org/apache/felix/ipojo/extender/InstanceBuilder.html#line.46">type</a>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;type)</pre>
<div class="block">Specify the component's type of this instance.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - type of the instance (cannot be null).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this builder</dd>
</dl>
</li>
</ul>
<a name="type-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>type</h4>
<pre><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html" title="interface in org.apache.felix.ipojo.extender">InstanceBuilder</a>&nbsp;<a href="../../../../../src-html/org/apache/felix/ipojo/extender/InstanceBuilder.html#line.53">type</a>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;&nbsp;type)</pre>
<div class="block">Specify the component's type of this instance.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - type of the instance (cannot be null).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this builder</dd>
</dl>
</li>
</ul>
<a name="version-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>version</h4>
<pre><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html" title="interface in org.apache.felix.ipojo.extender">InstanceBuilder</a>&nbsp;<a href="../../../../../src-html/org/apache/felix/ipojo/extender/InstanceBuilder.html#line.61">version</a>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;version)</pre>
<div class="block">Specify the component's version of this instance. If null is used,
the factory without any version attribute will be used.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>version</code> - component's version (can be null).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this builder</dd>
</dl>
</li>
</ul>
<a name="context-BundleContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>context</h4>
<pre><a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html" title="interface in org.apache.felix.ipojo.extender">InstanceBuilder</a>&nbsp;<a href="../../../../../src-html/org/apache/felix/ipojo/extender/InstanceBuilder.html#line.71">context</a>(BundleContext&nbsp;context)</pre>
<div class="block">Override the default BundleContext used for declaration service registration.
Use this with <bold>caution</bold>, for example, if the bundle does not import the
<code><a href="../../../../../org/apache/felix/ipojo/extender/package-summary.html"><code>org.apache.felix.ipojo.extender</code></a></code> package, declarations may not be
linked and activated properly.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - new context to be used.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this builder</dd>
</dl>
</li>
</ul>
<a name="configure--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>configure</h4>
<pre><a href="../../../../../org/apache/felix/ipojo/extender/ConfigurationBuilder.html" title="interface in org.apache.felix.ipojo.extender">ConfigurationBuilder</a>&nbsp;<a href="../../../../../src-html/org/apache/felix/ipojo/extender/InstanceBuilder.html#line.96">configure</a>()</pre>
<div class="block">Access the dedicated builder for configuration (properties).
Notice that when this method is used, the called must use <a href="../../../../../org/apache/felix/ipojo/extender/ConfigurationBuilder.html#build--"><code>ConfigurationBuilder.build()</code></a>
to build the instance declaration configured with the right set of properties. Any attempt
to use <a href="../../../../../org/apache/felix/ipojo/extender/InstanceBuilder.html#build--"><code>build()</code></a> will result in a new declaration with no properties associated.
Good usage (produced declaration has the associated properties):
<pre>
DeclarationHandle handle = builder.configure()
.property("hello", "world")
.build();
</pre>
Bad usage (produced declaration does not have the associated properties):
<pre>
builder.configure()
.property("hello", "world");
DeclarationHandle handle = builder.build();
</pre></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the instance configuration builder</dd>
</dl>
</li>
</ul>
<a name="build--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>build</h4>
<pre><a href="../../../../../org/apache/felix/ipojo/extender/DeclarationHandle.html" title="interface in org.apache.felix.ipojo.extender">DeclarationHandle</a>&nbsp;<a href="../../../../../src-html/org/apache/felix/ipojo/extender/InstanceBuilder.html#line.104">build</a>()</pre>
<div class="block">Build the declaration handle (never contains any configuration).
Notice that the declaration is not yet published (no automatic activation).
The client has to do it through <a href="../../../../../org/apache/felix/ipojo/extender/DeclarationHandle.html#publish--"><code>DeclarationHandle.publish()</code></a></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the handle to the declaration</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="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/InstanceBuilder.html">Use</a></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>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/felix/ipojo/extender/ExtensionDeclaration.html" title="interface in org.apache.felix.ipojo.extender"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/felix/ipojo/extender/InstanceDeclaration.html" title="interface in org.apache.felix.ipojo.extender"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/felix/ipojo/extender/InstanceBuilder.html" target="_top">Frames</a></li>
<li><a href="InstanceBuilder.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>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 ======= -->
<p class="legalCopy"><small>Copyright &#169; 2014. All rights reserved.</small></p>
</body>
</html>