users@jersey.java.net

singleton resources

From: Zoltan Arnold NAGY <Zoltan.Nagy_at_Sun.COM>
Date: Thu, 29 Oct 2009 00:12:13 +0100

Hi,

if I understand correctly, unless I annotate a resource class with
@Singleton, it's going to
be created on a per-request basis, then discarded. Is that correct?

If it is, doesn't it introduces a performance penalty?

If all of my methods on my resource class are thread-safe, then going
with a singleton
might yield better performance.

Any thoughts? :)

Thanks,
Zoltan