> > 2. But does it use one instance of myHandler, or does it create new instance
> > of myHandler for every request?
> > --> (It creates new instance of myHandler for every request)
>
> No, I believe that only one instance of the class used as a handler is
> instantiated. That is:
>
> server.addHandler("some.name", new MyHandler());
>
> will only create one MyHandler object and keep it around for incoming
> requests, not one seperate instance for each incoming request. (Can
> someone verify this?)
Well, I decided to stop being lazy and created a simple test with
variable in MyHandler (this was NOT a static var). Anyway I had it
increase with every call, and quickly it became obvious that indeed
you are rigth - it uses one instance - it's singleton.
Thanks,
--MB