Differences

This shows you the differences between two versions of the page.

Link to this comparison view

blueprint [2014/04/09 16:16]
blueprint [2021/04/05 11:23] (current)
Line 1: Line 1:
 +====== 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:
 +<sxh>
 +<bean id="service.pool" class="servicePool">
 + <property name="bundleContext" ref="blueprintBundleContext" />
 +</bean>
 +</sxh>
 +
 +===== 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''.
 +
 +<note important>If the bean is defined inside a service element then the scope is ''prototype'' by default.</note>
 +
 +{{tag>osgi}}