On 06/17/2011 12:14 AM, Christopher Schultz wrote:

On 6/16/2011 5:03 PM, Francis GALIEGUE wrote:

I was actually wondering about these. I think I have my answer now :/
Solutions in C or other languages are many to achieve that, Java has
none.

Correct: native code has to be written. tc-native notwithstanding, the
Tomcat team doesn't like to work with native code too much, and I can
understand why: it's a total minefield. Different OS versions, different
architectures, different c-library discrepancies, etc.


There ARE tomcat developers that are quite fun of C code and
regularly participate in various "native" projects, so this
has nothing to do with that.


Even if someone wrote something like this in native code, the result
would be essentially a fork() call which would clone your JVM, which
isn't going to be a fast process at that late stage of the game (in JVM
time, that is).


Exactly, and the fork() doesn't work with JVM. fork() only forks the
single thread, so all your monitor, GC, memory threads are not there.
For JVM, fork() is only valid if followed by execv which is basically
what Runtime.exec does.
Also there is a question of portability. Windows doesn't have fork().

However I don't see a reason why a separate Listener can't be made
that would monitor the app deployment, and act accordingly to some
rule(s). Tomcat currently tries its best to start, meaning that it
will start regardless of anything. Even if its config is totally
bogus it will throw pile of exceptions but start no mater what.
Does that make sense? For embedded usage yes, for standalone I doubt.

Eg. If port 80 is in use, httpd will log and refuse to start. Tomcat will
throw exceptions and just continue, meaning you have to inspect
your log files every time you start the Tomcat.



Regards
--
^TM

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to