Find a way to call Blueprint Container for prototype bean

141 views Asked by At

I'm moving from a Spring context to a blueprint bean manager on OSGi Karaf, and I cannot find way to call blueprint "context". For example, in Java Spring, I call ApplicationContext with method context.getBean(MyBean.class) and get a prototype instance of MyBean.

Now I have a blueprint.xml with my prototype bean configuration, and can't work with that in Java code. Is there something like that in blueprint?

1

There are 1 answers

0
Matt Pavlovich On BEST ANSWER

You can create a class that accepts the blueprint container as an argument:

    <bean class="com.acme.FooImpl">
      <property name="container" ref="blueprintContainer"/>
    </bean>