blob: 3c737b805143541017e9eb9ca76a54a30f4b9f28 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE- 2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<title>Apache Felix - iPOJO-Arch-Command</title>
<link rel="icon" href="/res/favicon.ico">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="The most powerful component model for OSGi">
<link href="/ipojo/web/bootstrap/css/bootstrap-cerulean.css" rel="stylesheet">
<link href="/ipojo/web/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<link href="/ipojo/web/bootstrap/css/font-awesome.min.css" rel="stylesheet">
<link href="/ipojo/web/style.css" rel="stylesheet">
<!-- Overide alert's colors -->
<link href="/ipojo/web/bootstrap/css/alert.css" rel="stylesheet">
<link rel="stylesheet" href="/ipojo/web/github.css" type="text/css" media="all">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="/ipojo/web/bootstrap/js/bootstrap.min.js"></script>
</head>
<body data-spy="scroll" data-target=".subnav">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="/documentation/subprojects/apache-felix-ipojo.html">Apache Felix iPOJO</a>
<div class="nav-collapse" id="main-menu">
<ul class="nav" id="main-menu-left">
<li><a href="/documentation/subprojects/apache-felix-ipojo/ipojo-news.html">News</a></li>
<li><a href="http://felix.apache.org/downloads.cgi">Downloads</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Tutorials <b class="caret"></b></a>
<ul class="dropdown-menu" id="tutorials-menu">
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-why-choose-ipojo.html">Why choose iPOJO</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-successstories.html">Success stories</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-feature-overview.html">Features</a></li>
<li class="divider"></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-in-10-minutes.html">iPOJO in 10 minutes</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/how-to-use-ipojo-annotations.html">Using Annotations</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-hello-word-maven-based-tutorial.html">Maven tutorial</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-advanced-tutorial.html">Advanced tutorial</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/apache-felix-ipojo-dosgi.html">Using Distributed OSGi</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-composition-tutorial.html">Application Composition</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Documentation <b class="caret"></b></a>
<ul class="dropdown-menu" id="user-guide-menu">
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/service-requirement-handler.html">Requiring a service</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/providing-osgi-services.html">Providing a service</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/lifecycle-callback-handler.html">Lifecycle management</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/configuration-handler.html">Configuration</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/architecture-handler.html">Introspection</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/controller-lifecycle-handler.html">Impacting the lifecycle</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/injecting-bundle-context.html">Accessing the Bundle Context</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/apache-felix-ipojo-instances.html">Creating instances</a></li>
<li class="divider"></li>
<li class="dropdown-submenu">
<a tabindex="-1" href="#">External <em>handlers</em></a>
<ul class="dropdown-menu">
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/event-admin-handlers.html">Asynchronous communication</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/ipojo-jmx-handler.html">JMX management</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/extender-pattern-handler.html">Extender pattern</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/white-board-pattern-handler.html">Whiteboard pattern</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/temporal-service-dependency.html">Temporal dependencies</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" href="#">Configuration Admin &amp; Factories</a>
<ul class="dropdown-menu">
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics/combining-ipojo-and-configuration-admin.html">iPOJO and config admin</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics/ipojo-factory-service.html">Using the iPOJO Factory service</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics/how-to-use-ipojo-factories.html">Factories and Instances</a></li>
</ul>
</li>
<li class="divider"></li>
<li class="dropdown-submenu">
<a tabindex="-1" href="#">Advanced topics</a>
<ul class="dropdown-menu">
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/instance-vs-service-controller.html">Instance vs. Service Controllers</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics/service-binding-interceptors.html">Service Binding Interceptors</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/using-xml-schemas.html">XML Schemas</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/apache-felix-ipojo-api.html">Using the iPOJO API</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics/constructing-pojo-objects-with-factory-methods.html">Constructing service objects with factory methods</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics/using-ipojo-introspection-api.html">Using the introspection API</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-testing-components.html">Testing components</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics/using-stereotypes.html">Using @Stereotypes</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-eclipse-integration.html">Eclipse Integration</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics/ipojo-extender-configuration.html">Configuring iPOJO's Extender</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-faq.html">FAQ</a></li>
<li class="divider"></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-devguide/how-to-write-your-own-handler.html">Handler development</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-devguide/how-to-use-ipojo-manipulation-metadata.html">Manipulation Metadata </a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-devguide/dive-into-the-ipojo-manipulation-depths.html">Dive into the iPOJO Manipulation depths</a></li>
<li><a href="http://felix.apache.org/ipojo/api/1.12.1">Javadoc</a></li>
</ul>
</li>
</ul>
</li>
<li class="dropdown" id="tools-menu">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Tools <b class="caret"></b></a>
<ul class="dropdown-menu" id="swatch-menu">
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-tools/ipojo-ant-task.html">Ant Task</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-tools/ipojo-maven-plug-in.html">Maven Plugin</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-tools/ipojo-arch-command.html">Architecture commands</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-tools/apache-felix-ipojo-online-manipulator.html">Online Manipulator</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-tools/ipojo-webconsole-plugin.html">Webconsole plugin</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-tools/ipojo-karaf-feature.html">Apache Karaf Features</a></li>
</ul>
</li>
<li class="dropdown" id="community-menu">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Community <b class="caret"></b></a>
<ul class="dropdown-menu" id="swatch-menu">
<li><a href="/documentation/subprojects/apache-felix-ipojo/ipojo-support.html">Support</a></li>
<li><a href="http://www.apache.org/">ASF</a></li>
<li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
<li><a href="http://www.apache.org/foundation/thanks.html">Sponsors</a></li>
</ul>
</li>
<li class="dropdown" id="misc-menu">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Misc <b class="caret"></b></a>
<ul class="dropdown-menu" id="swatch-menu">
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-supportedvms.html">Supported JVMs</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-supportedosgi.html">Supported OSGi Implementations</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/articles-and-presentations.html">Article & Presentations</a></li>
<li><a href="/documentation/subprojects/apache-felix-ipojo/developing-camel-mediators-with-ipojo.html">Developping Camel mediators with iPOJO</a></li>
</ul>
</li>
</ul>
<ul class="nav pull-right" id="main-menu-right">
<li><a rel="tooltip" target="_blank" href="http://felix.apache.org">Apache Felix <i class="icon-share-alt"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="content">
<style type="text/css">
/* The following code is added by mdx_elementid.py
It was originally lifted from http://subversion.apache.org/style/site.css */
/*
* Hide class="elementid-permalink", except when an enclosing heading
* has the :hover property.
*/
.headerlink, .elementid-permalink {
visibility: hidden;
}
h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
<h1 id="ipojo-architecture-commands">iPOJO architecture commands<a class="headerlink" href="#ipojo-architecture-commands" title="Permanent link">&para;</a></h1>
<p><em>Architecture introspection is required when the system doesn't work as expected. In this case, having a quick access to instances states and interconnection is a stringent requirement. The architecture commands allows getting these data from the Felix Shell, from the Equinox shell and Gogo.</em></p>
<div class="toc">
<ul>
<li><a href="#ipojo-architecture-commands">iPOJO architecture commands</a><ul>
<li><a href="#installation">Installation</a></li>
<li><a href="#gogo">Gogo</a></li>
<li><a href="#equinox-and-felix-shells">Equinox and Felix Shells</a><ul>
<li><a href="#examples">Examples</a></li>
</ul>
</li>
<li><a href="#reading-instance-architecture">Reading instance architecture:</a></li>
<li><a href="#list-available-factories">List available factories</a></li>
<li><a href="#list-available-handlers">List available handlers</a></li>
</ul>
</li>
</ul>
</div>
<h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link">&para;</a></h2>
<p>According to your shell, download the adequate bundles from <a href="http://felix.apache.org/downloads.cgi">the Felix download page</a></p>
<h2 id="gogo">Gogo<a class="headerlink" href="#gogo" title="Permanent link">&para;</a></h2>
<p>The Gogo commands are the following:</p>
<ul>
<li><code>ipojo:instances</code> (or just <code>instances</code>) lists the instances and state</li>
<li><code>ipojo:instance $instance_name</code> (or just <code>instance $instance_name</code>) displays the complete information about the specified $instance_name</li>
<li><code>ipojo:factories</code> (or just <code>factories</code>) lists the available public factories</li>
<li><code>ipojo:factory $factory_name</code> (or just <code>factory $factory_name</code>) displays complete information about the factory $factory_name</li>
<li><code>ipojo:handlers</code> (or just <code>handlers</code> lists available handlers</li>
</ul>
<p>For example:</p>
<div class="codehilite"><pre><span class="nv">$ </span>instances
Instance ArchCommand -&gt; valid
Instance spell.english.EnglishDictionary-0 -&gt; valid
Instance spell.checker.SpellCheck-0 -&gt; valid
Instance spell.gui.SpellCheckerGui-0 -&gt; valid
<span class="nv">$ </span>instance spell.checker.SpellCheck-0
instance component.type<span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">bundle</span><span class="o">=</span><span class="s2">&quot;8&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck-0&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.dependency.DependencyHandler&quot;</span>
requires <span class="nv">optional</span><span class="o">=</span><span class="s2">&quot;false&quot;</span> <span class="nv">aggregate</span><span class="o">=</span><span class="s2">&quot;false&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;resolved&quot;</span> binding-policy<span class="o">=</span><span class="s2">&quot;dynamic&quot;</span> <span class="nv">specification</span><span class="o">=</span><span class="s2">&quot;spell.services.DictionaryService&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler&quot;</span>
provides service.id<span class="o">=</span><span class="s2">&quot;36&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;registered&quot;</span> <span class="nv">specifications</span><span class="o">=</span><span class="s2">&quot;[spell.services.SpellChecker]&quot;</span>
property <span class="nv">value</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;factory.name&quot;</span>
property <span class="nv">value</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck-0&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;instance.name&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.architecture.ArchitectureHandler&quot;</span>
</pre></div>
<h2 id="equinox-and-felix-shells">Equinox and Felix Shells<a class="headerlink" href="#equinox-and-felix-shells" title="Permanent link">&para;</a></h2>
<p>On Equinox and Felix (old) shell, the command is named <em>arch</em>:</p>
<ul>
<li>arch =&gt; displays instances name &amp; state (equivalent to arch -instances)</li>
<li>arch -instance $instance<em>name =&gt; displays complete information about the instance $instance</em>name</li>
<li>arch -factories =&gt; display the list of available factories</li>
<li>arch -factory $factory<em>name =&gt; display complete information about the factory $factory</em>name</li>
<li>arch -handlers =&gt; list available handlers</li>
</ul>
<h3 id="examples">Examples<a class="headerlink" href="#examples" title="Permanent link">&para;</a></h3>
<div class="codehilite"><pre>-&gt; arch
Instance ArchCommand -&gt; valid
Instance spell.english.EnglishDictionary-0 -&gt; valid
Instance spell.checker.SpellCheck-0 -&gt; valid
Instance spell.gui.SpellCheckerGui-0 -&gt; valid
-&gt; arch -instance spell.checker.SpellCheck-0
instance component.type<span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">bundle</span><span class="o">=</span><span class="s2">&quot;8&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck-0&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.dependency.DependencyHandler&quot;</span>
requires <span class="nv">optional</span><span class="o">=</span><span class="s2">&quot;false&quot;</span> <span class="nv">aggregate</span><span class="o">=</span><span class="s2">&quot;false&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;resolved&quot;</span> binding-policy<span class="o">=</span><span class="s2">&quot;dynamic&quot;</span> <span class="nv">specification</span><span class="o">=</span><span class="s2">&quot;spell.services.DictionaryService&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler&quot;</span>
provides service.id<span class="o">=</span><span class="s2">&quot;36&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;registered&quot;</span> <span class="nv">specifications</span><span class="o">=</span><span class="s2">&quot;[spell.services.SpellChecker]&quot;</span>
property <span class="nv">value</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;factory.name&quot;</span>
property <span class="nv">value</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck-0&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;instance.name&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.architecture.ArchitectureHandler&quot;</span>
</pre></div>
<h2 id="reading-instance-architecture">Reading instance architecture:<a class="headerlink" href="#reading-instance-architecture" title="Permanent link">&para;</a></h2>
<p>Instance architecture is organized as follows:</p>
<ul>
<li>On the first line, are displayed the component type (i.e. factory), the instance state (<code>valid</code> or <code>invalid</code>), the bundle from which the instance is created, and the instance name.</li>
<li>Then, the information is organized handler by handler (a piece of container). For each handler plugged on the instance can participate to the instance architecture. For each handler its name (such as <code>org.apache.felix.ipojo.handlers.dependency.DependencyHandler</code> for iPOJO service dependencies, <code>org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler</code> for iPOJO service providing...) and the state (either <code>valid</code> or <code>invalid</code> are displayed. Remember that an instance is valid only and only if all plugged handlers are valid. </li>
<li>The <code>org.apache.felix.ipojo.handlers.dependency.DependencyHandler</code> provides data on service dependencies and more precisely on the state of service dependencies. In the previous example, the dependency on <code>spell.services.DictionaryService</code> was resolved. On the following example, the same dependency is no more resolved.</li>
</ul>
<p>As an example, the following snippet dumps the architecture of an instance:</p>
<div class="codehilite"><pre>instance component.type<span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;invalid&quot;</span> <span class="nv">bundle</span><span class="o">=</span><span class="s2">&quot;8&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck-0&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;invalid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.dependency.DependencyHandler&quot;</span>
requires <span class="nv">optional</span><span class="o">=</span><span class="s2">&quot;false&quot;</span> <span class="nv">aggregate</span><span class="o">=</span><span class="s2">&quot;false&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;unresolved&quot;</span> binding-policy<span class="o">=</span><span class="s2">&quot;dynamic&quot;</span> <span class="nv">specification</span><span class="o">=</span><span class="s2">&quot;spell.services.DictionaryService&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler&quot;</span>
provides <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;unregistered&quot;</span> <span class="nv">specifications</span><span class="o">=</span><span class="s2">&quot;[spell.services.SpellChecker]&quot;</span>
property <span class="nv">value</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;factory.name&quot;</span>
property <span class="nv">value</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck-0&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;instance.name&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.architecture.ArchitectureHandler&quot;</span>
</pre></div>
<p>Notes that, the instance also becomes invalid and that the provided service is unregistered.
If the provider comes back, the dependency becomes <code>resolved</code> and the instance becomes <code>valid</code>
If an instance begins to use a service, the bound providers are described in the instance architecture:</p>
<div class="codehilite"><pre>instance component.type<span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">bundle</span><span class="o">=</span><span class="s2">&quot;8&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck-0&quot;</span>
object <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck@e222eb&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.dependency.DependencyHandler&quot;</span>
requires <span class="nv">optional</span><span class="o">=</span><span class="s2">&quot;false&quot;</span> <span class="nv">aggregate</span><span class="o">=</span><span class="s2">&quot;false&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;resolved&quot;</span> binding-policy<span class="o">=</span><span class="s2">&quot;dynamic&quot;</span> <span class="nv">specification</span><span class="o">=</span><span class="s2">&quot;spell.services.DictionaryService&quot;</span>
uses service.id<span class="o">=</span><span class="s2">&quot;41&quot;</span> instance.name<span class="o">=</span><span class="s2">&quot;spell.english.EnglishDictionary-0&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler&quot;</span>
provides service.id<span class="o">=</span><span class="s2">&quot;42&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;registered&quot;</span> <span class="nv">specifications</span><span class="o">=</span><span class="s2">&quot;[spell.services.SpellChecker]&quot;</span>
property <span class="nv">value</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;factory.name&quot;</span>
property <span class="nv">value</span><span class="o">=</span><span class="s2">&quot;spell.checker.SpellCheck-0&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;instance.name&quot;</span>
handler <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;org.apache.felix.ipojo.handlers.architecture.ArchitectureHandler&quot;</span>
</pre></div>
<p>In the previous case, the dependency on <code>spell.services.DictionaryService</code> use the service 41 from the iPOJO instance named <code>spell.english.EnglishDictionary-0</code>
You can also check created POJO objects (implementation class objet). Here, only one object was created (<code>spell.checker.SpellCheck@e222eb</code>).</p>
<h2 id="list-available-factories">List available factories<a class="headerlink" href="#list-available-factories" title="Permanent link">&para;</a></h2>
<p>You can access factory list using the <code>factories</code> gogo command or the <code>arch -factories</code> on Felix's shell. For every available (public) factories,the name and the state are displayed. A factory is valid if and only if all required handlers are available.</p>
<div class="codehilite"><pre>-&gt; arch -factories
Factory spell.checker.SpellCheck <span class="o">(</span>VALID<span class="o">)</span>
Factory spell.gui.SpellCheckerGui <span class="o">(</span>VALID<span class="o">)</span>
Factory spell.english.EnglishDictionary <span class="o">(</span>VALID<span class="o">)</span>
-&gt; arch -factory spell.english.EnglishDictionary
factory implementation-class<span class="o">=</span><span class="s2">&quot;spell.english.EnglishDictionary&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">bundle</span><span class="o">=</span><span class="s2">&quot;7&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;spell.english.EnglishDictionary&quot;</span>
provides <span class="nv">specification</span><span class="o">=</span><span class="s2">&quot;spell.services.DictionaryService&quot;</span>
missinghandlers <span class="nv">list</span><span class="o">=</span><span class="s2">&quot;[]&quot;</span>
requiredhandlers <span class="nv">list</span><span class="o">=</span><span class="s2">&quot;[org.apache.felix.ipojo:provides, org.apache.felix.ipojo:architecture]&quot;</span>
</pre></div>
<p>On Gogo:</p>
<div class="codehilite"><pre><span class="nv">$factories</span>
Factory spell.checker.SpellCheck <span class="o">(</span>VALID<span class="o">)</span>
Factory spell.gui.SpellCheckerGui <span class="o">(</span>VALID<span class="o">)</span>
Factory spell.english.EnglishDictionary <span class="o">(</span>VALID<span class="o">)</span>
<span class="nv">$factory</span> spell.english.EnglishDictionary
factory implementation-class<span class="o">=</span><span class="s2">&quot;spell.english.EnglishDictionary&quot;</span> <span class="nv">state</span><span class="o">=</span><span class="s2">&quot;valid&quot;</span> <span class="nv">bundle</span><span class="o">=</span><span class="s2">&quot;7&quot;</span> <span class="nv">name</span><span class="o">=</span><span class="s2">&quot;spell.english.EnglishDictionary&quot;</span>
provides <span class="nv">specification</span><span class="o">=</span><span class="s2">&quot;spell.services.DictionaryService&quot;</span>
missinghandlers <span class="nv">list</span><span class="o">=</span><span class="s2">&quot;[]&quot;</span>
requiredhandlers <span class="nv">list</span><span class="o">=</span><span class="s2">&quot;[org.apache.felix.ipojo:provides, org.apache.felix.ipojo:architecture]&quot;</span>
</pre></div>
<p>On the first line, you get the implementation class of the type, the state of the factory, the bundle declaring the type and the name of the type. You also get the list of required and missing handlers.</p>
<h2 id="list-available-handlers">List available handlers<a class="headerlink" href="#list-available-handlers" title="Permanent link">&para;</a></h2>
<p>Like listing factories, you can get the list of handlers.</p>
<div class="codehilite"><pre>-&gt; arch -handlers
Handler org.apache.felix.ipojo:controller <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo:callback <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo:requires <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo:provides <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo:properties <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo:architecture <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo.handler.whiteboard:wbp <span class="o">(</span>VALID<span class="o">)</span>
</pre></div>
<p>On Gogo:</p>
<div class="codehilite"><pre><span class="nv">$handlers</span>
Handler org.apache.felix.ipojo:controller <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo:callback <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo:requires <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo:provides <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo:properties <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo:architecture <span class="o">(</span>VALID<span class="o">)</span>
Handler org.apache.felix.ipojo.handler.whiteboard:wbp <span class="o">(</span>VALID<span class="o">)</span>
</pre></div>
<p>Handlers with the <code>org.apache.felix.ipojo</code> namespace (section before <code>:</code>) are core handlers (provided by the iPOJO core bundles). Others are external handlers (provided by others bundles).</p>
</div>
</div>
<hr/>
<div class="container">
<footer id="footer">
<div class="row">
<div class="trademarkFooter span7">
Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
logo are trademarks of The Apache Software Foundation. All other marks mentioned
may be trademarks or registered trademarks of their respective owners.
</div>
<div class="timestamp span3 offset2">
Rev. 1700393 by cziegeler on Tue, 1 Sep 2015 06:04:06 +0000
</div>
</div>
</footer>
</div>
</body>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-1518442-4");
pageTracker._trackPageview();
} catch(err) {}
</script>
</html>