java bean question

N

Nishi Bhonsle

Hi:

I have to write a bean that triggers an event that removes a given file on the condition of the file system being full. I am new to java beans, can someone please let me know what would be the listener I would implement in this situation?

Thanks.
 
T

Tony Dahlman

Nishi said:
Hi:

I have to write a bean that triggers an event that removes a given file on the condition of the file system being full. I am new to java beans, can someone please let me know what would be the listener I would implement in this situation?

Thanks.

Hi,
This does not sound like an appropriate project for someone "new to
java beans"! You'll need to create your own event and listen for it.
And the event detection will require one or another platform-dependent
methods, such as polling a platform utility method (not good) or
writing a C/C++ program to return the info that tells your code
to fire the event.
Good luck. Regards, Tony Dahlman
 
N

Nishi Bhonsle

Tony said:
Hi,
This does not sound like an appropriate project for someone "new to
java beans"! You'll need to create your own event and listen for it.
And the event detection will require one or another platform-dependent
methods, such as polling a platform utility method (not good) or
writing a C/C++ program to return the info that tells your code
to fire the event.
Good luck. Regards, Tony Dahlman

I created 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?
 
T

Tony Dahlman

Nishi said:
I created 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?

Right, although SystemNearlyFull might be a better approach.
But you are getting away from my area of expertise. Have you
checked ?
How can I execute a C program call through a java program?

Somehow, I have avoided doing this kind of thing for the past 8 years,
but it involves calling System.loadLibrary(...). Check out:


http://tm.wc.ask.com/r?t=an&s=m&uid...&u=http://www.mindprod.com/jgloss/essays.html

or:

http://developer.java.sun.com

Keep in mind that if you do use the Java Native Interface, you will no longer
be writing a true "bean." The code will no longer be something someone can
just take off the shelf and plug into some other project without regard to
the platform where it will run.

Regards, Tony Dahlman
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top