RE: [Aglets-users] facilitator concept
Status: Beta
Brought to you by:
cat4hire
From: Robert B. <rbergstrom@iSolutionsCorp.com> - 2000-12-20 14:01:51
|
Waleed: So far, the best method I've found for doing scheduling within the Aglet framework is to create a separate thread to do the timing. This practice is prevalent enough in Java that in JDK 1.3, the classes are included for you i.e. java.util.Timer and java.util.TimerTask. However, you can write the classes with any JDK. If you use messageWait() or Thread.sleep(), or even deactivate(), the aglet is unresponsive during the delay -- including dispose requests. One key point when writting your timing thread is to make sure you can stop it and shut down properly. I'd suggest a "Timer" class which creates and controls the thread and a "TimerTask" which implements "Runnable". (Hmm, where did I get that from? <g>) Cheers, // RAB -----Original Message----- From: agl...@li... [mailto:agl...@li...]On Behalf Of waleed Hosny I m new to aglets. I m trying to set up a server daemon aglet that check periodically (every 3 minutes)for new requests (the requests are saved in Oracle database). and if the requests are found the daemon aglet will construct a mobile aglet and dispatche it to another site where the mobile aglet will search for information in remote site and send a message back to the daemon aglet if the information is found. what happenes now is that the server daemon can not receive the msg ( probably because it have an infinite loop within it's run method that keeps looking for new requests) |