users@jersey.java.net

[Jersey] Creating ThreadLocalSingletonProviders

From: Barada (Personal) <"Barada>
Date: Thu, 18 Jul 2013 18:53:46 +0530

Hi,

I want to create a ThreadLocalSingletonProvider for injecting `user account` related information onto ResourceFilters using the @Context annotation.

I see a com.sun.jersey.core.impl.provider.xml.ThreadLocalSingletonContextProvider.

I am extending the ThreadLocalSingletonContextProvider but my @Context annotated objects are not being resolved by this provider.
The documentation around this class is pretty sparse. Can I extend this class to serve my custom instances as ThreadLocals?

I was hoping that Jersey would provide a means of wrapping an instance to be resolved using a deferred manner by (Filters, FilterFactories) using pre-existing ThreadLocal Providers.

Or do I need to create a custom ThreadLocal wrapper around my instance to resolve the account information from the request?

~ Barada