The problem is the creation of the new Thread will happen, and two threads
will be running. Restart again, and now I have 3 threads running. I have
played around with different ways to get it to run more efficiently, but I
still have no way of knowing when to stop(or destroy) the other threads.
James Birchfield
Ironmax
a better way to buy, sell and rent construction equipment
5 Corporate Center
9960 Corporate Campus Drive,
Suite 2000
Louisville, KY 40223
|--------+------------------------------------>
| | Robert Krueger |
| | <[EMAIL PROTECTED]> |
| | Sent by: |
| | owner-orion-interest@orion|
| | server.com |
| | |
| | |
| | 11/13/00 10:42 AM |
| | Please respond to |
| | Orion-Interest |
| | |
|--------+------------------------------------>
>-------------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: Orion-Interest <[EMAIL PROTECTED]>
|
| cc:
|
| Subject: Re: UserManager shutdown hook?
|
>-------------------------------------------------------------------------------------------------------------------------------------|
At 08:41 13.11.00 , you wrote:
>We have implemented our own usermanager, and it all works great. But we
>would like to know when the server is restarted at least, if not shutdown.
>We start up a 'raper' thread, which is responsible for cleaning up expired
>user references. When the orion is restarted, it creates a new instance
of
>the usermanager, and there is know way to kill the spawned thread, so
after
>several restart(in development mode), these threads get crazy. I would
>love to see a shutdown hook added to the AbstractUserManager class.
Anyone
>else have a need for this? Anyone else have an idea how to get around it?
you could put the code that inititates a cleanup thread in a method of the
usermanager that checks when the last cleanup has been invoked. this will
be more robust and won't give you a noticable performance penalty. It's not
that nice (sort of a heuristic approach because it relies on the fact that
getUser() is probably called often enough to ensure that your cleanup works
reliably).
pseudo code:
getUser(String userName){
if(lastCleanupWasTooLongAgo()){
doCleanUpActionAsyncronouslyAndSetTimestamp();
}
return getCustomUser(userName);
}
>Thanks!
>
>James Birchfield
>
>Ironmax
>a better way to buy, sell and rent construction equipment
>5 Corporate Center
>9960 Corporate Campus Drive,
>Suite 2000
>Louisville, KY 40223
>
(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de