beans and C code in java prog.

Discussion in 'Java' started by Nishi Bhonsle, Jan 6, 2004.

  1. I have to write a bean that triggers an event that removes a given file on the condition of the file system being full.
    Since I am new to java beans, can you someone please let me know if I could do the follow the below approach-->

    Create 3 classes --
    FileSystemFullListener--interface extending EventListener
    FileSystemFullBean--source bean that fires the systemFull event
    FileSystemFullEvent
    I will write a C program to detect the systemFull event. I should be including the systemFull call in the FileSystemFullEvent class, right?
    How can I execute a C program call through a java program?


    Thanks.
    Nishi Bhonsle, Jan 6, 2004
    #1
    1. Advertising

  2. Nishi Bhonsle

    Brad BARCLAY Guest

    Nishi Bhonsle wrote:

    > I will write a C program to detect the systemFull event. I should be including the systemFull call in the FileSystemFullEvent class, right?
    > How can I execute a C program call through a java program?


    You have two options: if the C program is indeed a stand-alone
    executable application, you can use one of the java.lang.Runtime.exec()
    methods.

    If, instead the C code you want to call is part of a library, you're
    going to have to use JNI, the Java Native Interface.

    HTH!

    Brad BARCLAY

    --
    =-=-=-=-=-=-=-=-=
    From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
    The jSyncManager Project: http://www.jsyncmanager.org
    
    Brad BARCLAY, Jan 6, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sakthi
    Replies:
    0
    Views:
    353
    Sakthi
    Sep 15, 2004
  2. Sakthi
    Replies:
    0
    Views:
    414
    Sakthi
    Sep 15, 2004
  3. Torsten Schmeissel
    Replies:
    0
    Views:
    407
    Torsten Schmeissel
    Apr 29, 2005
  4. -intl.com
    Replies:
    1
    Views:
    358
    Martin Gregorie
    Oct 22, 2006
  5. NANY(kshore)
    Replies:
    2
    Views:
    316
Loading...

Share This Page