Blueprint
Inject Bundle Context
Blueprint has some beans with reserved ids. One of those ids is blueprintBundleContext
. The bundle context can be inject by reference with passing the id.
This sets the bundle context to the property bundleContext
on construction:
<bean id="service.pool" class="servicePool"> <property name="bundleContext" ref="blueprintBundleContext" /> </bean>
Scope
The scope of the bean defines if a bean is created as a singleton or if the Blueprint container creates a new instance on every call.
Available scopes are singleton
and prototype
.
If the bean is defined inside a service element then the scope is
prototype
by default.