Java Reference
In-Depth Information
To b e a b l e t o s h o w a l l o f w h a t d e p l o y m e n t p a c k a g e s
have to offer, let's assume you want to provide a core
version of the program containing the drawing
frame and the shape API bundles. This way, you're
able to deploy the actual shape implementations
separately via an extension pack. The extension
pack contains the square, circle, and triangle bun-
dles. Let's go with this approach and explore the
different ways you can use deployment packages to
make it work.
The general structure of a deployment package
is shown in figure 10.4. This ordering is carefully
designed to allow deployment packages to be streamed in such a way that the contents
can be processed without needing to download the entire JAR file.
The deployment package design has a few other desirable characteristics. First, the
deployment package puts metadata in its manifest, similar to bundles, which allows
you to turn it into a named and versioned set of resources. Second, by taking advan-
tage of the fact that JAR files can be signed, you can use signed JAR files to make your
deployment packages tamperproof.
For this example, you can do either of the following (see figure 10.5):
Manifest
Signature files
Localization files
Resource
order
Bundles
Resources
Figure 10.4 Structure of a
deployment package JAR file
Create a deployment package for the core bundles and one package for all
shape bundles.
Create a deployment package for
the core bundles and individual
deployment packages for each
shape bundle.
Packaged together
triangle-4.0.jar
paint-4.0.jar
circle-4.0.jar
The difference is obviously that in the
first case, you'll deploy either all shapes
or none; and in the second case, you can
extend the core bundle piecemeal. The
important point to understand, though,
is that you can't use both approaches at
the same time: you must choose one.
In terms of the example, you need to
make a decision. In this case, you'll go
with the first approach and create a sin-
gle deployment bundle for all shapes.
But because deployment packages can
be updated, you can gain some flexibility
by starting with only one shape in the
deployment package and then adding
another one in an updated version and
shape-4.0.jar
square-4.0.jar
Packaged seperately
triangle-4.0.jar
circle-4.0.jar
Dependency
Resource
Deployment package
square-4.0.jar
Figure 10.5 Paint program packaging
alternatives
 
Search WWH ::




Custom Search