felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrei Pozolotin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-2961) SCR & ConfigurationAdmin : service.pid resolution
Date Mon, 23 May 2011 21:13:47 GMT

    [ https://issues.apache.org/jira/browse/FELIX-2961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038233#comment-13038233
] 

Andrei Pozolotin commented on FELIX-2961:
-----------------------------------------

the osgi oracle spoke: (posted with his permission):

################################################

I am afraid I agree with Felix Meschberger. Any properties registered in the XML should not
be interpreted. Setting the service.pid has no meaning (unless you provide the Managed Service
(Factory)) interface. SCR does not use MS(F)s, it uses Configuration Listener.

So PID == component name.

If you still disagree, please file a bug on the public OSGi Bugzilla, it will then be discussed
in CPEG.

Kind regards,

	Peter Kriens

On 23 mei 2011, at 16:59, Andrei Pozolotin wrote:
> >    *Peter, hello;*
> > 
> >    Do you think you could shed some light here:
> >    https://issues.apache.org/jira/browse/FELIX-2961
> >    SCR & ConfigurationAdmin : service.pid resolution
> > 
> >    Please  :-) 
> > 
> >    Thank you,
> > 
> >    Andrei
> > 
> > 
################################################

> SCR & ConfigurationAdmin : service.pid resolution
> -------------------------------------------------
>
>                 Key: FELIX-2961
>                 URL: https://issues.apache.org/jira/browse/FELIX-2961
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions:  scr-1.6.0
>            Reporter: Andrei Pozolotin
>
> hello!
> when I use config admin to control instaniation of scr component services, I use this
pattern:
> // 1) in config source bundle:
> 			Configuration config = configAdmin.getConfiguration("ZZZ", null);
> 			Dictionary<String, String> props = config.getProperties();
> 			config.update(props);
> //  2) in config target bundle:
> @Service
> @Component(name = "AAA", policy = ConfigurationPolicy.REQUIRE, immediate = true)
> public class BucketPlugin implements PluginSpaceService {
> 	@Property(name = "service.pid")
> 	protected static final String PID = "ZZZ";
> // 3) despite the fact service.pid "looks good" in xml for the tagret compenent:
>     <scr:component enabled="true" immediate="true" name="AAA" configuration-policy="require">
>         <implementation class="com.ddfplus.core.space.BucketPlugin"/>
>         <service servicefactory="false">
>             <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
>         </service>
>         <property name="service.pid" type="String" value="ZZZ"/>
> // 4) the scr fails to initialize the component; intitialzation works only when 
> (scr.component.name == config.service.pid) and NOT when (config.service.pid == scr.component.property.pid)
> // 5) if I look on the the config target in console (when I do manage to inititialize
it),
> it shows that again, actual service.pid comes from scr.component.name and not from scr.component.property.service.pid
> thank you.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message