Hello again,

I'm using this documentation
(http://felix.apache.org/site/configuration-handler.html) to create a
service whose properties are configurable on the Felix Web Console. It
looked simple at first, but now I know that I need an
OSGI-INF/metatype/metatype.xml and also the Metatype Service running. Still,
no luck, my config does not appear on the console (others do, so the
metatype service seems to work fine). Probably a stupid mistake but I can't
spot it. Can you please help?

metadata.xml:

<?xml version="1.0" encoding="UTF-8"?>
<ipojo 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="org.apache.felix.ipojo
http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd"; 
    xmlns="org.apache.felix.ipojo">
        <component classname="com.epam.osgiapache.pricing.PricingService">
                <requires field="vatservice" />
                <provides>
                        <property name="callcount" field="callCount" value="0" 
/>
                </provides>
                <callback transition="validate" method="start" />
                <callback transition="invalidate" method="stop" />
                <properties propagation="true"/>
        </component>
        <instance component="com.epam.osgiapache.pricing.PricingService">
                <property name="callcount" value="0" />
                <property name="managed.service.pid"
value="com.epam.osgiapache.pricing"/>
        </instance>
</ipojo>



metatype.xml:

<?xml version="1.0" encoding="UTF-8"?>
<metatype:MetaData
xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0";>
  <OCD description="Pricing Service" name="com.epam.osgiapache.pricing"
id="com.epam.osgiapache.pricing">
    <AD name="Call Count" id="callcount" required="true"  type="Integer"
default="0"/>
  </OCD>
</metatype:MetaData>


Web Console info about my bundle:

18 PricingService
Symbolic Name   PricingService
Version 0
Bundle Location file:/pricingservice.jar
Last Modification       Thu Mar 11 11:46:41 CET 2010
Start Level     1
Exported Packages       com.epam.osgiapache.pricing,version=0.0.0
Imported Packages       com.epam.osgiapache.interfaces,version=0.0.0 from
Interfaces (1)
org.apache.felix.ipojo,version=1.4.0 from org.apache.felix.ipojo (6)
org.apache.felix.ipojo.architecture,version=1.4.0 from
org.apache.felix.ipojo (6)
org.osgi.service.cm,version=1.3.0 from org.apache.felix.configadmin (5)
org.osgi.service.log,version=1.3.0 from org.apache.felix.ipojo (6)
Service ID 51   Types: org.apache.felix.ipojo.Factory,
org.osgi.service.cm.ManagedServiceFactory
Service PID: com.epam.osgiapache.pricing.PricingService
Service ID 52   Types: org.osgi.service.cm.ManagedService
Service PID: com.epam.osgiapache.pricing
Service ID 54   Types: com.epam.osgiapache.interfaces.PricingServiceInterface
Manifest Headers        Bnd-LastModified: 1268304387320
Bundle-ManifestVersion: 2
Bundle-Name: PricingService
Bundle-SymbolicName: PricingService
Bundle-Version: 0
Created-By: 1.6.0_17 (Sun Microsystems Inc.) & iPOJO 1.4.0
Export-Package: com.epam.osgiapache.pricing;
uses:="com.epam.osgiapache.interfaces"
Import-Package: org.osgi.service.log; version=1.3,
com.epam.osgiapache.interfaces, org.apache.felix.ipojo.architecture;
version= 1.4.0, org.apache.felix.ipojo; version= 1.4.0, org.osgi.service.cm;
version=1.2, com.epam.osgiapache.pricing
Include-Resource: OSGI-INF/metatype/metatype.xml=metatype.xml
iPOJO-Components: component {
$classname="com.epam.osgiapache.pricing.PricingService" callback {
$transition="validate" $method="start" }callback { $transition="invalidate"
$method="stop" }provides { property { $field="callCount" $mandatory="false"
$name="callcount" $value="0" }}properties { $propagation="true"
}manipulation { field { $name="prices" $type="double[]" }field {
$name="vatservice"
$type="com.epam.osgiapache.interfaces.VATServiceInterface" }field {
$name="callCount" $type="int" }method { $name="$init" }method {
$arguments="{int}" $name="calculatePrice" $return="double" }method {
$name="start" }method { $name="stop" }interface {
$name="com.epam.osgiapache.interfaces.PricingServiceInterface" }}requires {
$field="vatservice" }}instance {
$component="com.epam.osgiapache.pricing.PricingService" property {
$name="callcount" $value="0" }property { $name="managed.service.pid"
$value="com.epam.osgiapache.pricing" }}
Manifest-Version: 1.0
Tool: Bnd-0.0.384


Web console output of the individual services in the bundle:

 51     org.apache.felix.ipojo.Factory,
org.osgi.service.cm.ManagedServiceFactory
component.class com.epam.osgiapache.pricing.PricingService
component.description   factory
name="com.epam.osgiapache.pricing.PricingService" state="valid" bundle="18"
implementation-class="com.epam.osgiapache.pricing.PricingService" provides
specification="com.epam.osgiapache.interfaces.PricingServiceInterface"
missinghandlers list="[]" property name="callcount" value="0" type="int"
requiredhandlers list="[org.apache.felix.ipojo:requires,
org.apache.felix.ipojo:properties, org.apache.felix.ipojo:callback,
org.apache.felix.ipojo:provides, org.apache.felix.ipojo:architecture]"
component.properties
org.apache.felix.ipojo.architecture.propertydescript...@12bcd4b
component.providedServiceSpecifications
com.epam.osgiapache.interfaces.PricingServiceInterface
factory.name    com.epam.osgiapache.pricing.PricingService
factory.state   1
Service PID     com.epam.osgiapache.pricing.PricingService

52      org.osgi.service.cm.ManagedService
factory.name    com.epam.osgiapache.pricing.PricingService
instance.name   com.epam.osgiapache.pricing.PricingService-0
Service PID     com.epam.osgiapache.pricing

54      com.epam.osgiapache.interfaces.PricingServiceInterface
callcount       0
component       com.epam.osgiapache.pricing.PricingService
factory.name    com.epam.osgiapache.pricing.PricingService
instance.name   com.epam.osgiapache.pricing.PricingService-0


Thanks in advance, Norbert
-- 
View this message in context: 
http://old.nabble.com/Configuring-an-iPOJO-on-the-web-console-tp27861909p27861909.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to