|
From: Chris K. <chr...@en...> - 2003-07-10 08:56:35
|
Thanks for the response. The problem I'm trying to solve is to launch a Java program remotely. I have an invoker that runs as a service but invokes other programs but would be neat if I could invoke these programs as services also so that I gain the recoverability functionality gained by using the Java Service Wrapper. So the two main questions I have is - Can I make one service spark off another service? - Can I do this programmatically without having to rely on configuration files? Thanks for any guidance in advance. -----Original Message----- From: wra...@li... [mailto:wra...@li...] On Behalf Of wra...@li... Sent: 10 July 2003 04:30 To: wra...@li... Subject: Wrapper-user digest, Vol 1 #132 - 4 msgs Send Wrapper-user mailing list submissions to wra...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/wrapper-user Message: 1 Date: Wed, 09 Jul 2003 13:03:33 +0900 From: Leif Mortenson <le...@ta...> To: wra...@li... Subject: Re: [Wrapper-user] Invoking another Java service from another Java service wrapper Reply-To: wra...@li... This is a multi-part message in MIME format. --------------060200040702020606050204 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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? > This email is confidential and may be protected by legal privilege. If you are not the intended recipient, please do not copy or disclose its content but delete the email and contact the sender immediately. Whilst we run antivirus software on all internet emails we are not liable for any loss or damage. The recipient is advised to run their own antivirus software. |