commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: [Jelly] Using Ant <parallel> and <thread> tags
Date Mon, 07 Oct 2002 16:58:50 GMT


> -----Original Message-----
> From: James Strachan [mailto:james_strachan@yahoo.co.uk]
> Sent: 07 October 2002 16:08
> To: Jakarta Commons Developers List
> Subject: Re: [Jelly] Using Ant <parallel> and <thread> tags
> 
> From: "Vincent Massol" <vmassol@octo.com>
> > I am porting the following code Jelly:
> >
> >     <parallel>
> >       <antCall target="cactus:tomcat-4x-start"/>
> >       <sequential>
> >         <waitfor maxwaitunit="millisecond" checkevery="500">
> >           <http
> >
url="http://localhost:${maven.cactus.port}/test/ServletRedirector?Cactus
> > _Service=RUN_TEST"/>
> >         </waitfor>
> >         <antCall name="cactus:tomcat-4x-stop"/>
> >       </sequential>
> >     </parallel>
> >
> > Of course, replacing <antCall> by <attainGoal> will not work (I
think
> > Jelly will execute before Ant, right?).
> 
> If you kept the above as using Ant tasks then it would work fine in
Jelly.

I tried the following (in a Maven plugin.jelly script):

<goal name="cactus:tomcat-4x-run">
  <antcall target="testxxx"/>
</goal>

<target name="testxxx">
  <echo>xxxx</echo>
</target>

However, I get the following error:

[ERROR] BUILD FAILED
[ERROR] File......
E:\Vma\Projets\Encours\ICOM\Icom\environment\tools\maven\plugins\maven-c
actus-plugin-1.0\plugin.jelly
[ERROR] Element... antcall
[ERROR] Line...... 33
[ERROR] Column.... 34
[ERROR] java.io.FileNotFoundException:
E:\Vma\Projets\Encours\junitbook\junitbook\chapter09\build.xml (The
system cannot find the file specified)


> However mixing Maven's <attainGoal> with the Ant tasks probably won't
> work.
> 
> 
> > I imagined using the jelly <core:thread> tag. However, I have to
specify
> > either an org.apache.commons.jelly.XMLOutput object or a file
attribute.
> >
> > I would like to have the output be printed in the console (same as
the
> > other Jelly outputs). How can I do that?
> 
> 
> I've just patched the thread tag to just default to System.out if no
> xmlOutput or File is specified.
> 

ok. Cool. Thanks.

I've tried it with:

<j:thread>
  <attainGoal name="cactus:tomcat-4x-start"/>
</j:thread>
<echo>XXXXXXXXXX</echo>

but it fails with:

[ERROR] org.apache.commons.jelly.JellyException:
java.lang.NullPointerException File: file:/E:/Vma/
rojets/Encours/ICOM/Icom/environment/tools/maven/plugins/maven-cactus-pl
ugin-1.0/scripts/tomcat.4x.jelly At tag <attainGoal>: line: 50 column:
46
[ERROR]         at
org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:5
12)
[ERROR]         at
org.apache.commons.jelly.impl.TagScript.run(TagScript.java:274)
[ERROR]         at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:134)
    [echo] XXXXXXXXXX
    [echo] [ERROR]      at
org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:190)
    [echo] [ERROR]      at
org.apache.commons.jelly.tags.core.ThreadTag$1.run(ThreadTag.java:93)
    [echo] [ERROR]      at java.lang.Thread.run(Thread.java:479)

Any idea? Can I refer to objects in the main jelly context form within
the <thread> tag?

> 
> > BTW, is that the correct approach (to use the jelly <thread> tag)?
> 
> Sure. The missing part that you need is synchronizing things again.
> There's
> no <waitfor> in Jelly, though you should be able to reuse the existing
Ant
> tasks for this if you like.

Yes, that's what I imagine doing.

> 
> There are efforts ongoing to build a BPEL4WS engine using Jelly. One
of
> the
> key features of this is to support parallel execution of 'actions' and
> then
> coordinate them as they complete, either synchronously (via blocking a
> thread) or asynchronously (via receiving some kind of message and
> correlating things together). So there will be better support for this
> kind
> of thing in Jelly soon.

Cool.

> 
> Until then using just the Ant tasks seems the easiest approach; maybe
we
> just need a way of making things like <attainGoal> act like an Ant
task
> when
> used with <parallel> and <sequential> in a Jelly script?

Maybe ... but I don't know enough to know if it's a good idea or not ...
:-)

Thanks James,
-Vincent

> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> __________________________________________________
> 
> Do You Yahoo!?
> 
> Everything you'll ever need on one web page
> 
> from News and Sport to Email and Music Charts
> 
> http://uk.my.yahoo.com
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message