Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 4454 invoked from network); 19 Sep 2003 22:06:04 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 19 Sep 2003 22:06:04 -0000 Received: (qmail 94973 invoked by uid 500); 19 Sep 2003 22:05:28 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 94928 invoked by uid 500); 19 Sep 2003 22:05:28 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 94834 invoked from network); 19 Sep 2003 22:05:27 -0000 Received: from unknown (HELO mail.kaptechwest.com) (65.115.95.60) by daedalus.apache.org with SMTP; 19 Sep 2003 22:05:27 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: can I subclass Condition to create my own conditions for "waitfor" task? Date: Fri, 19 Sep 2003 15:06:54 -0700 Message-ID: <1E0EF0D249F6504FAB1B26EA699E3C1D1CA4E3@mail.kaptechwest.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: can I subclass Condition to create my own conditions for "waitfor" task? thread-index: AcN++lWfb67T4TjuQ5CcEhtVu5Bd1w== From: "Alan Bram" To: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, I've written an Ant task that I will use in running unit tests (under = CruiseControl). The task waits for my JBoss server to complete its = start-up process. It works via access to the JBoss JMX MBean for the = Main Deployer, so that I know it's really ready before I start my tests. I've patterned my code after the Ant "waitfor" task, in terms of = allowing the user to specify frequency and time limit, both value and = units independently, because I think that's pretty cool. (I hate having = to guess whether a time was specified in milliseconds, or seconds, or = whatever.) However, I suddenly realized that instead of making my code *like* Ant's = "waitfor" task, it would be really cool if I could actually re-use it. = It seemed like I almost could, if only I could make up my own Condition = (i.e., org.apache.tools.ant.taskdefs.condition.Condition). The = ConditionBase class (which is the base class of WaitFor) knows about = only a fixed set of types of Condition's. It seemed like I could almost = add my own if I subclassed WaitFor, by adding my own addMyCondition() = method. But it looks like that won't quite work, because ConditionBase = keeps its "conditions" field private. Does anyone see a good way to make this work? I suppose maybe I could just override the getConditions() method to = ignore all other Condition's and just return my Condition. But that = seems a bit ugly? I thank you in advance for any thoughts on this matter. Sincerely, - Alan Bram --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org