Hi,

I need to create a thread that periodically synchronizes a user database
with an LDAP server. The code I used (shown below) works great, except
that no NetD page ever comes up. All I get is the Netscape meteor shower
which runs indefinitely ( I actually let it run overnight once).


// my project classs - not a page class
public class standards extends CSpProject{

 public static Hashtable storage = new Hashtable(1); // class var


 //[[SPIDER_EVENT<this_onBeforeInitEvent>
 public int this_onBeforeInitEvent(CSpInitEvent event)
 {
  try
  {
   CSpLog.send(this,CSpLog.CRITICAL,"Initializing standards.");
   DirectorySynch dirSynch = new DirectorySynch();

   // keep reference
   storage.put(SYNCHTHREAD,dirSynch);
   dirSynch.run(); // threads do not get garbage collected?
  }
  catch(Exception e)
  {
   String msg = "ERROR: Directory synchronization caused an exception. "
+ e.toString();
   Util.log(e,msg,e);
  }
  return (PROCEED);
 }
 //]]SPIDER_EVENT<this_onBeforeInitEvent>

 //[[SPIDER_EVENT<this_onBeforeTerminateEvent>
 public int this_onBeforeTerminateEvent(CSpTerminateEvent event)
 {
  CSpLog.send(this,CSpLog.CRITICAL,"NOTICE: Shutting down standards
application.");
  DirectorySynch dirSynch = (DirectorySynch)
storage.remove(SYNCHTHREAD);
  dirSynch.stop();
  return (PROCEED);
 }
 //]]SPIDER_EVENT<this_onBeforeTerminateEvent>

------------

Thanks for any help,
Paul


_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to