opensubscriber
   Find in this group all groups
 
Unknown more information…

x : xmlrpc-user@ws.apache.org 21 February 2005 • 5:20PM -0500

Re: jetty with XML-RPC
by Massive Boisson

REPLY TO AUTHOR
 
REPLY TO GROUP




> > 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

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.