[jira] [Commented] (FELIX-5356) Component Factory and CM factory Configurations behave badly
[ https://issues.apache.org/jira/browse/FELIX-5356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15513228#comment-15513228 ] Thomas Watson commented on FELIX-5356: -- Yes, that is the approach I was going to use. Basically just ignore factory configurations for factory components, otherwise the rest of the code/behavior with respect to singleton configuration stays the same. > Component Factory and CM factory Configurations behave badly > > > Key: FELIX-5356 > URL: https://issues.apache.org/jira/browse/FELIX-5356 > Project: Felix > Issue Type: Bug > Components: Declarative Services (SCR) >Affects Versions: scr-2.0.6 > Environment: All >Reporter: Thomas Watson >Priority: Minor > > This is a corner case and a minor issue in my opinion. The specification > really only mentions the following with respect to what should happen with > factory components and CM factory configurations: > {quote} > A factory configuration must not be used if the component is a factory > component. This is because SCR is not free to create component configurations > as necessary to support multiple Configurations. When SCR detects this > condition, it must log an error message with the Log Service, > if present, and ignore the component description. > {quote} > At face value it seems to suggest that any CM factory configurations must be > ignored when they match the factory component PID. But the last sentence > also makes a strong assertion that the component description must be ignored > if matching factory configurations are detected while discovering a factory > component description. This seems overkill to me. Why not just ignore the > factory configurations? Why must the factory component description be > ignored altogether? > The other issue is that if a matching factory configuration is created later, > after a ComponentFactory has been registered and a ComponentInstance has been > created (with newInstance) then felix SCR will dispose of the > ComponentInstance. In this case the component instance did not specify an > update method. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FELIX-5356) Component Factory and CM factory Configurations behave badly
[ https://issues.apache.org/jira/browse/FELIX-5356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15512090#comment-15512090 ] David Jencks commented on FELIX-5356: - On further consideration, setting the policy definitely won't work since a factory component can be configured by any number of singleton configurations. A better approach might be to look at the configuration merging code in ConfigurableComponentHolder and prevent dealing with a matching factory configurations if the component is a factory component. If the literal spec behavior is correct, that might be a place to implement it as well. > Component Factory and CM factory Configurations behave badly > > > Key: FELIX-5356 > URL: https://issues.apache.org/jira/browse/FELIX-5356 > Project: Felix > Issue Type: Bug > Components: Declarative Services (SCR) >Affects Versions: scr-2.0.6 > Environment: All >Reporter: Thomas Watson >Priority: Minor > > This is a corner case and a minor issue in my opinion. The specification > really only mentions the following with respect to what should happen with > factory components and CM factory configurations: > {quote} > A factory configuration must not be used if the component is a factory > component. This is because SCR is not free to create component configurations > as necessary to support multiple Configurations. When SCR detects this > condition, it must log an error message with the Log Service, > if present, and ignore the component description. > {quote} > At face value it seems to suggest that any CM factory configurations must be > ignored when they match the factory component PID. But the last sentence > also makes a strong assertion that the component description must be ignored > if matching factory configurations are detected while discovering a factory > component description. This seems overkill to me. Why not just ignore the > factory configurations? Why must the factory component description be > ignored altogether? > The other issue is that if a matching factory configuration is created later, > after a ComponentFactory has been registered and a ComponentInstance has been > created (with newInstance) then felix SCR will dispose of the > ComponentInstance. In this case the component instance did not specify an > update method. -- This message was sent by Atlassian JIRA (v6.3.4#6332)