ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Question about loop in Ant
Date Wed, 21 Mar 2007 08:26:00 GMT
I would write a custom task which stores the listener-adresses as property.
Inside your code you could reuse the Ant classes if you need ...
(oata.taskdefs, oata.util)


Jan


<getOracleListener property="ora.port"/>
<target name="doSomething" if="ora.port">
    ...
</target>


class GetOracleListenerTask extends Task {
    String property; // setter
    public execute() {
        List<URL> urls = getPossibleListenerUrls();
        for(URL url : urls) {
            if (isReachable(url)) {
                getProject.setNewProperty(property, url);
                return;
            }
        }
    }
    // return a list of possible oracle listeners
    // maybe from a file
    private List<URL> getPossibleListenerUrls() {}
    
    // checks if that given url is ok
    private boolean isReachable(URL url) {}
}    

 

>-----Ursprüngliche Nachricht-----
>Von: cknell@onebox.com [mailto:cknell@onebox.com] 
>Gesendet: Dienstag, 20. März 2007 23:37
>An: user@ant.apache.org
>Betreff: RE: Question about loop in Ant
>
>http://www.cenqua.com/fisheye/demo/browse/~raw,r=1.4/ant/docs/m
>anual/CoreTasks/sequential.html
>-- 
>Charles Knell
>cknell@onebox.com - email
>
>
>
>-----Original Message-----
>From:     Farid Izem <farid.izem@gmail.com>
>Sent:     Tue, 20 Mar 2007 22:32:12 +0100
>To:       user@ant.apache.org
>Subject:  Question about loop in Ant
>
>Hi All,
>
>I have write a ant script which check the availibility of 
>Oracle listener
>based on tcp reachibility (waitfor task) and jdbc connection 
>(sql task).
>
>I'd like to make somehing like that :
>
><while>
> <condition is false>
>   <antCall target="MyTarget" />
> </condition>
></while>
>
>Is there something i can do easily or do i need to write my 
>own ant task ?
>
>Kind Regards,
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message