> -----Original Message-----
> From: Huxi LI [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 28 April 2006 5:54 PM
> To: [email protected]
> Subject: Asking for new feature: Self-Discovery of service to 
> make Ant a real extensible system
> 
> **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 principal of self-discovery is possible based on the namespace controls
already in current Ant.  By adding a custom ComponentHelper you can
intercept task loading requests.  For example, the ComponentHelper class
includes the following operation:

    public Object createComponent( String name )
    {
        .... 
    }

In the above method invocation the 'name' parameter is supplied in the form
'namespace':'task'.  If the namespace is a manageable namespace (i.e.
something you can use to resolve the actual resources), then you can auto
load the task.  

An example of this approach is available in the Transit antlib [1].

Cheers, Steve.

[1] http://www.dpml.net/transit/tasks/index.html


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

Reply via email to