Hi, 

Thank you for your response, BJ, Richard, and Clement.

What I intended to realize ( in other words, what we need to realize)
includes the following case:

-----------
Case1. Set service properties when a service "com.acme.serviceA" is
registered either in the Component XML or in other ways.

 Equivalent to the following code:

        ServiceA obj = new ServiceAImpl();
        Dictionary prop = new Dictionary();
        prop.put(key1,value1);
        prop.put(key2,value2);
        
        serviceRegistration=bundleContext.registerService("ServiceA",obj,prop);

Case2. Modify service properties of the registered service, 
 either in the Component XML or in other ways.

 Equivalent to the following code:
        Dictionary newProp = new Dictionary();
        newProp.put(key,value);
        serviceRegistration.setProperties();

----------

Based on BJ's comment, I tried to implement some bundles using
Declarative service (Equinox Impl.). In the result, I found that 
- Writing properties and property elements in a component XML enables to
realize Case 1 internaly.

- In addition, ConfigurationAdmin can be used to modify service
properties after registration (that realizes Case2) externally.

# As written in 112.6 Componant Properties.

I have not used iPOJO yet, but I hope I'll try in near future.

I appreciate your help !

---------------------
NTT Cyber Solutions Laboratories

     Ikuo YAMASAKI
        E-mail: [EMAIL PROTECTED]
TEL +81-46-859-8537  FAX +81-46-855-1282 


On Sun, 15 Jun 2008 20:17:10 +0200
"Clement Escoffier" <[EMAIL PROTECTED]> wrote:

Clement> Hi,
Clement> 
Clement> About iPOJO, you can specify the service properties that you want to 
publish
Clement> in the <provides> element
Clement> (http://felix.apache.org/site/providing-osgi-services.html). 
Clement> In addition, iPOJO allows you to update "transparently" property 
values from
Clement> the code itself.
Clement> 
Clement> For example, an instance of a component type with the following 
metadata
Clement> will publish a service (published interfaces are computed 
automatically),
Clement> and will publish the "your.props" property. 
Clement> <provides>
Clement>        <property field="yourfield" name="your.props"/>
Clement> </provides>
Clement> This property is attached to the "yourfield" member. So, when you 
assign a
Clement> new value to this field, the service registration will be updated
Clement> automatically.
Clement> 
Clement> 
Clement> Clement
Clement> 
Clement> > -----Message d'origine-----
Clement> > De?: [EMAIL PROTECTED] [mailto:osgi-dev-
Clement> > [EMAIL PROTECTED] De la part de Richard S. Hall
Clement> > Envoy鬆: jeudi 12 juin 2008 11:28
Clement> > タ?: OSGi Developer Mail List
Clement> > Objet?: Re: [osgi-dev] Setting Service Properties in DS and iPOJO
Clement> > 
Clement> > Ikuo Yamasaki wrote:
Clement> > > Hi, OSGi Experts
Clement> > >
Clement> > > It seems to me that, in OSGi, it would  be important to decouple a
Clement> > > service object and the service properties when registering a 
service
Clement> > in
Clement> > > order to increasie re-usability of components by adopting some
Clement> > > declarative ways.
Clement> > >
Clement> > > I wonder if it is possible to set service properties when 
registering
Clement> > a
Clement> > > service using Declarative Service (and to filter a service using
Clement> > service
Clement> > > properties LDAP fiter when getting a service). As far as I read the
Clement> > spec,
Clement> > > it is not possible.
Clement> > >
Clement> > > How about in the case using iPOJO ?
Clement> > >
Clement> > 
Clement> > I am not sure if I totally understand the question, do you want the
Clement> > component to set the properties or for them to be set externally. For
Clement> > the external case, as BJ said, the component properties can be used 
to
Clement> > set them externally, which is true for DS or iPOJO. For the internal
Clement> > case, you can do this in iPOJO too, with service properties.
Clement> > 
Clement> > -> richard
Clement> > 
Clement> > > Best regards,
Clement> > >
Clement> > > ---------------------
Clement> > > NTT Cyber Solutions Laboratories
Clement> > >
Clement> > >      Ikuo YAMASAKI
Clement> > >         E-mail: [EMAIL PROTECTED]
Clement> > > TEL +81-46-859-8537  FAX +81-46-855-1282
Clement> > >
Clement> > >
Clement> > > _______________________________________________
Clement> > > OSGi Developer Mail List
Clement> > > [email protected]
Clement> > > https://mail.osgi.org/mailman/listinfo/osgi-dev
Clement> > >
Clement> > _______________________________________________
Clement> > OSGi Developer Mail List
Clement> > [email protected]
Clement> > https://mail.osgi.org/mailman/listinfo/osgi-dev
Clement> 
Clement> 
Clement> _______________________________________________
Clement> OSGi Developer Mail List
Clement> [email protected]
Clement> https://mail.osgi.org/mailman/listinfo/osgi-dev
Clement> 



_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to