Java Reference
In-Depth Information
The
rmic
task.
Remote Method Invocation is a distributed computing
technology (Section 5.8). RMI requires the generation of server and stub classes
that provide the networking support for an RMI-enabled class. This is normally
done by the
rmic
compiler, and this is one of the common reasons the Java
programmers turn to build automation tools. The
rmic
tag allows
ant
to build
RMI classes.
9.4.2.5
So far we have ignored a major component of
ant
. In order to introduce it, we
need to give you a (painfully) high-level view of how
ant
works “under
the hood.”
Task tags actually map directly to Java classes that implement the tasks.
Each task class is an instance of the
Task
class (in other words, it is a Java class
that either directly or indirectly extends the
Task
class). This is how you can
write your own tasks—download the
ant
source code and write your classes
that extend the
Task
class.
Tasks are not, however, the only tags that map to Java classes. There is
another category of tags that do so. They are called
datatypes
. These are classes
that directly or indirectly extend the
ant
DataType
class.
Generally speaking, a task may require zero to many datatypes to specify
the data with which the task works. Some such tags include the
manifest
tag
used in our sample
build.xml
file discussed later in this chapter.
We'll mention a couple of the most frequently used datatype tags here and
leave looking up the details as an exercise for you.
Other Tags
The
PatternSet
,
Include
, and
Exclude
datatypes.
As you may have
noticed, the most common tags we have covered allow you to specify the files
to be processed using the tag's attributes. Usually, you nominate a base directo-
ry and let the task tag process everything in that directory.
There are times, however, when you need finer grained control than that.
For example, you might wish to exclude all Java classes whose names end in
“
Test
” (Example 9.3).
Other datatypes.
There are many other datatypes used for various purposes.
One of them,
FilterSet
, is able to modify files before they are copied or
moved. This can be useful, for example, to put build information into a source
file for an
About
dialog.