|
From: Leif M. <le...@ta...> - 2003-07-09 04:03:50
|
Chris,
Not sure exactly what you are wanting to do. But individual NT
Services are
independent of each other. If you wanted to start a second service when
the first
one was started, your would want to install them both normally. Then
you would
trigger the startup of the second service from within the first using the
java.lang.Runtime.exec methods and the "net" command with "start",
"{service name}" arguments. Have not tested this, but it should work. In
Wrapper v3.0.4, you will also be able to execute Wrapper.exe with a "-t"
parameter to start the service.
If you simply want to launch a second JVM from a Java application
running as
a service, then you can do so by, once again, using the
java.lang.Runtime.exec
method. Only this time, execute Java.exe with all the arguments that
apply. This
second JVM will be a child process of the first so it will be a part of
the original
service. The problem here is that you have to be careful about how you
shutdown
the service to make sure that the child JVM is always killed. Failure
to do so will
result in a zombie process that I believe you will have to reboot to get
rid of.
If you want to execute a copy of the Wrapper from the exec method,
you should
be able to specify any property in the wrapper.conf file from the
command line.
The Wrapper always requires that a wrapper.conf exists. But if
everything is on
the command line, then the conf file can be empty. This would result in
a very long
command line however, so I would only put the parameters that need to be
dynamic on the command line.
Let me know if none of these answers actually answers your question.
Cheers,
Leif
Chris Kelly wrote:
> Is there a way of programmatically invoking a Java service from
> another Java service.
> What I'm looking for is to invoke a Java service without use of
> explicit configuration files. I could supply this as a
> list of properties instead?
>
|