beans and C code in java prog.

  • Follow


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.

0
Reply nishi.bhonsle (39) 1/6/2004 6:37:38 PM

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

0
Reply bbarclay (147) 1/6/2004 7:50:39 PM


1 Replies
26 Views

(page loaded in 0.061 seconds)


Reply: