Blueprint is similar to spring. In fact, the source of these two specifications is one.
Blueprint is a configuration specification that implements osgi specifications and is injecting dependent on containers.
The role of blueprint for ServiceMix is like the role of spring for the web development framework:
1. blueprint implements osgi specifications. Karaf is an osgi container instance, and ServiceMix implements package release functions based on Karaf. Karaf is part of ServiceMix and is a tool;
2. Spring implements spring specifications. Spring is part of the web development framework and a tool.
The so-called blueprint implements osgi specifications, which refer to the element names, child element names, and element attributes defined in blueprint,
All are content specified in osgi specifications. For example, osgi requires bundle to be registered, bind, and start,
Correspondingly, in blueprint, there are service elements, reference elements, bean elements, which represent services, service references, and service implementation beans,
The three can be registered, bind, and start respectively.
For bundle, there are three important states: 1, registered/unregistered 2, bind/unbind 3, init/destroy
In blueprint, if it is Bean, it has init/destroy;
In blueprint, if it is a service reference (reference or reference list), it has bind/unbind
In blueprint, if it is a service, it has registered/unregistered
These statuses are standardized as Callback functions by blueprint, such,
The bean element can specify init-method = "XXX" Destroy-method = "yyy"
The reference element can specify <reference-listener bind-method = "xxx" unbind-method = "YYY">
The service element can specify <registration-listener regiener-method = "register" unregistration-method = "unregister">
[Original] how to understand blueprint