Huxi LI wrote:
**Hi everyone,

I would like to launch a discussion about implementation of self-discovery
feature in Ant.
The idea is that when users drop a jar in share directory, all custiom tasks
and datatypes
should be discovered automatically by Ant. The same is true when jars are
removed
from the share directory.

The advantage is that users do not need any more use Taskdef to declare
custom
tasks. This makes Ant a highly extensible "plug-and-play" system.

Modern systems are becoming more
and more intelligent. I think Ant maybe do better.  The concept of
"plug-and-play" is not
any more a vocaburary reserved for hardware components; software is also
advancing in this direction. An
extensible system should be able to "dynamically" discover available
services and have conflict detection and resolution
capability.



Which is precisely why it is in Ant1.6. You add a new JAR to the system, all datatypes and tasks will be exported in a namespace of your choosing via an xmlns:mytasks="antlib:org.example.package" declaration.

http://ant.apache.org/manual/index.html

We deal with conflicts and resolution by requiring antlib libraries to be imported into separate namespaces, thus the act of declaring the namespace not only forces the loading of the new tasks, it gives you the separation

> A simple example of self-discovery is the "hot deployment" service available
> in most J2EE
> application servers. The complexity of implementation such a mechanism
> depends on many factors. Sometimes it
> is not the complexity to implement self-discovery service; it is often
> simple ignored by developers. For the
> Ant build system, it is fairly easy to implement self-discovery feature.

J2EE hot deploy is a very different beast, and, if you use it a lot, you will soon see why cold restart works better. The app servers are trying to reload stuff in existing classloaders and it is very easy for old state to be retained.

-Steve



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to