[
https://issues.apache.org/jira/browse/ARIES-1267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14507249#comment-14507249
]
Christian Schneider commented on ARIES-1267:
--------------------------------------------
In the newer version 1.3.0 of the blueprint cm namespace factory-component is
replaced by factory-ref.
There is also a test for this case in
/org.apache.aries.blueprint.itests/src/test/resources/ManagedServiceFactoryTest.xml
and
org.apache.aries.blueprint.itests.cm.ManagedServiceFactoryTest.testFactoryCreation
<cm1_3:managed-service-factory id="managed-service-factory5"
factory-pid="blueprint-sample-managed-service-factory5"
interface="org.apache.aries.blueprint.itests.cm.service.Foo">
<service-properties>
<entry key="key" value="foo5" />
<cm:cm-properties persistent-id="" />
</service-properties>
<cm1_3:managed-component factory-ref="fooFactory"
factory-method="create">
<cm:managed-properties persistent-id="" />
<property name="a" value="1" />
<property name="b" value="default" />
</cm1_3:managed-component>
</cm1_3:managed-service-factory>
Is that new syntax ok for you or should I try to also support the old one?
> factory-ref is not supported by managed-component within
> managed-service-factory element, and the factory-component decorator is not
> implemented
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ARIES-1267
> URL: https://issues.apache.org/jira/browse/ARIES-1267
> Project: Aries
> Issue Type: Bug
> Components: Blueprint
> Reporter: Edward Ost
> Assignee: Christian Schneider
> Priority: Minor
>
> I would like to use a factory bean with a managed service factory. The
> intellisense tells me that a factory-component attribute is supported. But
> when I try it I get the error
> org.apache.aries.blueprint.core - 1.1.0 | Unable to start blueprint container
> for bundle jdbc_example
> org.osgi.service.blueprint.container.ComponentDefinitionException: Bean class
> or factory-ref must be specified
> If I then try factory-ref it tells me
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute
> 'factory-ref' is not allowed to appear in element 'cm:managed-component'.
> This is to be expected since looking at the schema
> http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd only
> factory-component is listed.
> Sample blueprint config showing the intent.
> <cm:managed-service-factory id="msf.managedBean"
> factory-pid="msf.ManagedBean"
> interface="net.eost.example.osgi.jdbc.ManagedBean">
> <service-properties>
> </service-properties>
> <cm:managed-component factory-component="mbf" factory-method="create"
> destroy-method="destroy">
> <cm:managed-properties persistent-id=""
> update-strategy="container-managed"/>
> </cm:managed-component>
> </cm:managed-service-factory>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)