Java Reference
In-Depth Information
this chapter that it's possible to have different component frameworks collaborate in
a single application.
Let's get started with the Blueprint component framework.
12.1
Blueprint Container
One of the popular component frameworks in Java today is Spring Beans. The Blue-
print Container specification (Blueprint for short) from the OSG i R4.2 Enterprise
specification is based heavily on the Spring/ OSG i integration work done in Spring
Dynamic Modules. One benefit of standardizing this work is that it has resulted in sev-
eral implementations of this specification from other vendors, including the Apache
Aries and Eclipse Gemini projects.
One to rule them all?
It may seem confusing that the OSGi Alliance has defined two “standard” component
frameworks: Declarative Services and Blueprint. There's a method to this apparent
madness. Both specifications are interoperable at execution time (see section 12.3)
via services, so either can be used to implement a given service interface without im-
pacting clients. Additionally, each specification caters to different use cases:
Declarative Services focuses on building lightweight components with quick
startup times.
Blueprint focuses on building highly configurable enterprise-oriented applications.
As usual, one size doesn't fit all. We see this throughout computing: often there are
numerous ways to accomplish similar, but not quite identical, tasks. From the OSGi
Alliance's perspective, it makes sense to have different communities standardizing
their approaches around OSGi technology, rather than trying to dictate a single ap-
proach for everyone.
Let's look into the Blueprint architecture, after which we'll discuss how you can build
the paint program using Blueprint.
12.1.1
Blueprint architecture
Blueprint defines a component in terms of a number of elements, each of which has
an underlying manager in the Blueprint component container. Each Blueprint com-
ponent definition can contain zero or more of the managers listed in table 12.1.
Table 12.1
Blueprint component container managers
Manager
Description
Bean
Provides components with the same basic semantics as Spring beans:
Construction via reflective construction or static factory methods
Support for singletons or prototype instances
Injection of properties or constructor arguments
Lifecycle callbacks for activation and deactivation
Reference
Gets a single service from the OSGi service registry for the component based on the
service interface and an optional filter over the service properties
 
Search WWH ::




Custom Search