Java Reference
In-Depth Information
Nimble can provision a wide range of stacks—as well as web and Java
EE
containers, it
can handle all the dependency injection frameworks we covered in chapter 6: Blue-
print, Declarative Services, iPojo, Peaberry, and Guice. Nimble can even provision
runtimes for non-Java
JVM
-based languages such as Scala and Groovy. If a require-
ment can be satisfied in more than one way (for example, a web application could be
run using either Tomcat or Jetty), the Nimble resolver can be configured with a policy
for choosing between the two.
WARNING: GETTING REPOSITORY INDEXES RIGHT
Not all versions of Nimble
automatically check for requirements like Blueprint in the indexes. This is
presumably a performance optimization, because finding and parsing Blue-
print files does have a cost. But this can catch you out if you're not careful,
because it's not well documented, and a Blueprint implementation won't be
installed unless Nimble spots bundles that need it. The same goes for
JTA
,
JPA
,
and
JNDI
providers. To ensure enterprise
OSG
i requirements are indexed,
add the
--enable-ee-spotters
flag to your indexing command.
This kind of resolution is more comprehensive than the
OBR
-based resolution of
OSG
i
dependencies we discussed in chapter 7. We definitely didn't cover Scala in chapter 7!
The power of Nimble provisioning demonstrates the flexibility of
OBR
resolution; it
can handle
OSG
i applications, steamed puddings, and Scala. Although the Nimble
resolver is
OBR
-based, Nimble repositories do include extra metadata not found in
most public
OBR
repositories. Nimble can convert a normal
OBR
repository to a Nim-
ble one by re-indexing it. Nimble also hosts handy re-indexed versions of popular
OBR
repositories (see figure 13.13).
Figure 13.13
A repository that contains the Fancy Foods application can be generated by indexing a
built copy of the source tree. If the
--enable-ee-spotters
flag is added, the resulting OBR index
will include extra requirements for enterprise OSGi function. The index can be viewed from within the
Posh shell using the
more
command.
