Solved

running and monitoring sub process ...

Posted on 2001-07-02
3
281 Views
Last Modified: 2010-04-16
I need to activate a process from my java application,
the process is an exe file that fuction as a server
this server is activating another demon.

my problem is that I need to know when this demon was launched and then continue with my code.

How can I solve this problem ?
how can I get the information on a process running on the OS (in my case NT) that was not been activated directly by me.

0
Comment
Question by:yossim111799
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
Igor Bazarny earned 150 total points
ID: 6245548
Hi,

As far as I know, you can't. Aren't you going to communicate with your daemon? I would just try to connect, wait and retry until connection succeeds

Regards,
Igor Bazarny,
Brainbench MVP for Java 1
www.brainbench.com
0
 
LVL 3

Expert Comment

by:sghosh092199
ID: 6245797
Hi!

The problem has two parts:
1. To activate a process from the Java application:

Process serverProcess = Runtime.getRunTime().exec("c:\\Executables\\Server.exe");

The exec() methods create a native process 'serverProcess' and it is possible to communicate with the process through I/O streams. Since 'serverProcess' is responsible for activating a daemon, it can get the time of activation and pass on to its OutputStream, which the program can read the InputStream.

InputStream in = serverProcess.getInputStream();
OutputStream out = serverProcess.getOutputStream();

2. In order to know about processes on the OS, you can launch the Process Monitor PerfMon.exe as above and check on its output via OutputStream.  

Hope that helps!
0
 
LVL 3

Expert Comment

by:sghosh092199
ID: 6245822
The Process Monitor will be Taskmgr.exe. PerfMon.exe is the Performance Monitor
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
printf performancy 11 86
Selenium docs api java index 3 69
passing enum to a method 4 35
Netbeans and org.apache.commons.lang3 issue 3 28
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question