Hello,
I am having issues with 1.0.0.RELEASE of Gemini Blueprint in Virgo 3.5.0.
The blueprint specification states that blueprintContainer and blueprintBundleContext are reserved component ids in Blueprint. It mentions you can inject them into a managed bean using a 'ref'.
I've tried this and failed with:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'blueprintBundleContext' is defined
My blueprint is defined as:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="...1.0.0 namespace omitted to avoid spam message..."
xmlns:xsi="...1.0.0 namespace omitted to avoid spam message..."
xsi:schemaLocation="...1.0.0 namespace omitted to avoid spam message...
...1.0.0 namespace omitted to avoid spam message...">
<bean id="referenceManager" class="com.acme.ReferenceManager">
<property name="context" ref="blueprintBundleContext" />
<property name="container" ref="blueprintContainer" />
</bean>
<reference id="acmeService" interface="com.acme.AcmeService" timeout="10000">
<reference-listener ref="referenceManager" bind-method="bind" unbind-method="unbind" />
</reference>
</blueprint>
The reference-listener ('referenceManager') is defined as:
public class ReferenceManager {
private BundleContext ctx;
private BlueprintContainer bc;
public void setContext(BundleContext ctx) {
this.ctx = ctx;
}
public void setContainer(BlueprintContainer bc) {
this.bc = bc;
}
public void bind(ServiceReference ref) {
System.out.println("<<< Binding service reference: " + ref + " >>>");
}
public void unbind(ServiceReference ref) {
System.out.println("<<< Unbinding service reference: " + ref + " >>>");
}
}
When I do not inject the two blueprint beans the reference listener binds/unbinds as expected.
Do I need to define additional beans to use blueprintContainer or blueprintBundleContext?
Thanks!
Anthony Bargnesi