Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Include Page
apache-felix-ipojo-header
apache-felix-ipojo-header

HTML
Wiki Markup
{html}
<div class="content">
{html}

How to use iPOJO annotations

...

  • specifications: defines the provided interface (optional, default = all implemented interfaces)
  • strategy : the service object creation strategy. Possible values : SINGLETON, SERVICE, METHOD, INSTANCE or the strategy class name. With SINGLETON there is only one POJO per component instance, SERVICE means OSGi Service factory, METHOD delegates the creation to the factory-method of the component, INSTANCE creates one service object per requiring instance. For other strategies, specify the qualified name of the CreationStrategy class. (optional, default = SINGLETON)
  • properties : array containing @StaticServiceProperties defining service properties not attached to fields.

HTML
Wiki Markup
{html}
<div class="box">
	<div class="box-blue-header">
	<div class="box-blue-title">
		<img src="http://people.apache.org/~clement/ipojo/site/information.gif"> <b>OSGi Service Factory</b>
	</div>
	</div>
	<div class="box-blue-content">
The <tt>SERVICE</tt> strategy refers to the OSGi service factory. So, one service object per asking bundle will be created.
	</div>
	<div class="box-blue-footer"></div>
</div>
{html}

HTML
Wiki Markup
{html}
<div class="box">
	<div class="box-blue-header">
	<div class="box-blue-title">
		<img src="http://people.apache.org/~clement/ipojo/site/information.gif"> <b>Changes between the 1.0.0 and the 1.2.0</b>
	</div>
	</div>
	<div class="box-blue-content">
The <tt>factory</tt> attribute became <tt>strategy</tt>. A third policy is now available (<tt>instance</tt>) allowing to create one service object per asking instance. Moreover, it is also possible to indicates the <tt>CreationStrategy</tt> class name. 
	</div>
	<div class="box-blue-footer"></div>
</div>
{html}

@Requires

Goal: Defines a service dependency
Target: Field
Attributes:

...

  • name: property name (optional, default=field name
  • value: property value (optional, default=no value)
  • mandatory : is the property mandatory? (optional, default=false)

HTML
Wiki Markup
{html}
<div class="box">
	<div class="box-blue-header">
	<div class="box-blue-title">
		<img src="http://people.apache.org/~clement/ipojo/site/information.gif"> <b>Mandatory property</b>
	</div>
	</div>
	<div class="box-blue-content">
A mandatory property must receive a value either from the component type description (<tt>value</tt> attribute, or the instance configuration.
	</div>
	<div class="box-blue-footer"></div>
</div>
{html}

@ServiceController

Goal: Control the service exposition
Target: Field (Boolean)
Attributes:

...

  • name: property name (optional, default=field name computed by removing "set" from the method name (for instance setFoo(String ff) will get the Foo name))
  • value: property value (optional, default=no value)
  • mandatory : is the property mandatory? (optional, default=false)

HTML
Wiki Markup
{html}
<div class="box">
	<div class="box-blue-header">
	<div class="box-blue-title">
		<img src="http://people.apache.org/~clement/ipojo/site/information.gif"> <b>Field and Method</b>
	</div>
	</div>
	<div class="box-blue-content">
If another property with the same name is defined the method or the field is added to the existing property.
	</div>
	<div class="box-blue-footer"></div>
</div>
{html}

@Updated

Goal: Defines method called when a reconfiguration is completed.
Target: a method (receiving a dictionary in argument)

...