Hello !
I have the following task to startup jboss from ant:

    <target name="jboss">
       <path id="jboss.class.path">
          <fileset dir="${ejbenv.JAVA_HOME}/lib">
             <include name="tools.jar" />
          </fileset>
          <fileset dir="${ejbenv.J2EE_HOME}/bin">
             <include name="run.jar" />
          </fileset>
        </path>
        <java classname="org.jboss.Main" fork="true">
         <classpath refid="jboss.class.path" />
        <!-- todo: use maxmemory tag -->
        <jvmarg line="-Xmx256M" />
        <arg line="-c ems" />
        </java>
      </target>

the pb I have is that when I do a Ctrl+C on 'ant jboss' it looks to me
as if ant directly kills the forked jvm instead of transfering the
Ctrl+C "signal" to the new jvm. usually jboss asks 'Shutdown ?' and u
have to type 'yes/no' and if yes, it undeploys jar files, cleans up
session resources (jms for instance), bref, calls all the shutdown
hooks. here the application server is killed without beeing shut down.

if jboss can catch the Ctrl+C on WIN32 and UNIX, I guess there is
JNI/native code around and so there must be an equivalent way for ANT to
forward as well the "signal" to the spawned process.

I don't know how it is done in ant currently to spawn the new thread,
but one way would be from the ant thread to create the new java Thread,
set its classlaoder to the correct values, keep a pointer to this new
thread, and when the ant thread receives a Ctrl+C then  call the
interrupt method instead of the destroy one.

let me know wat can be done.

thanx.

seb.


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

Reply via email to