Solved

running and monitoring sub process ...

Posted on 2001-07-02
3
277 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
  • 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Safari, Firefox, IE, Java, Plugin, Java Security error 13 40
word0 challenge 3 58
pairs challenge 5 44
github account with ecipse 1 16
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now