Results 1 to 3 of 3
  1. #1
    mo_mughrabi is offline Member
    Join Date
    May 2008
    Posts
    4
    Rep Power
    0

    Default Multi-Threading and process control in Java

    Dear All,
    Am a bit new to Java, recently I developed my first application that runs in a loop and read from a Oracle Database every number of minutes. The process basically, reads from a table the records which contain status "Ready" and retrieve a Shell Command and executes it on the file system.

    So, far its been working fine, but now we want to take this to the next level. I was planning to capture the Unix Process ID when I run any command in order for me to be able to kill it when needed from the application side.

    so, my question is how would I make the thread return the process Id of the OS?

    Thanks in advance,

  2. #2
    mo_mughrabi is offline Member
    Join Date
    May 2008
    Posts
    4
    Rep Power
    0

    Default

    Any one? hmmmm

  3. #3
    dlorde is offline Senior Member
    Join Date
    Jun 2008
    Posts
    339
    Rep Power
    7

    Default

    When you exec a native command using the Runtime class, it returns a Process object that provides access to the standard input and output streams of the native process. You can kill the native process via Process.destroy().

Similar Threads

  1. Replies: 0
    Last Post: 07-22-2008, 04:39 PM
  2. control app width based on certain control
    By thebillybobjr in forum SWT / JFace
    Replies: 0
    Last Post: 05-15-2008, 04:52 PM
  3. Java threading
    By Eranga in forum Advanced Java
    Replies: 2
    Last Post: 03-13-2008, 05:30 AM
  4. question about Multi threading in Java
    By fred in forum Advanced Java
    Replies: 1
    Last Post: 07-24-2007, 01:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •