> From: Vincent Massol [mailto:[EMAIL PROTECTED] > > I'm using the Ant Java task to start J2EE containers. However, in order to > know if they are started I'd like to read the stdout produced by these > containers. Now there are 2 solutions I know of: > > - using java.setOutputProperty(). The problem is that the property is only > set when the execute() command returns which doesn't work for several > containers that do not return (Orion for example). > > - using java.setOutput(File). However this goes to a file and I'd rather > not > use it for 2 reasons: I'd rather not have to output to a file as I may not > always have a handy location for that file (I'd rather not use tmp dir > either) + I'd like to make the file output optional, decided by the user. > > My question: Is there a way I can use to monitor the stdout content > resulting from the execution of execute() without going through a file?
Seems like you are doing this in code, rather than in XML, but in either case there is a third solution that uses <record> or its underlying mechanism, BuildListerners. With <record>, you'd be forced to go thru a file still, but by implementing your own listener like Record does, and installing it prior to Java.execute(), you can monitor the messages and do what you asked about it would seem. You can then uninstall the listener when you've detected the message you expected, or after Java.execute complete (or throws) in case the startup of the J2EE server failed. Not sure if this applies to what you had in mind without more details, but hopefully that helps. A+, --DD --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]