users@jersey.java.net

RE: [Jersey] Injection into HeaderDelegateProvider

From: Tim Edwards <Edwards.T_at_cambridgeassessment.org.uk>
Date: Tue, 14 Apr 2009 16:03:20 +0100

Thanks Paul. I had suspected that was the case, I was resigned to it
once I noticed CacheControl, MediaType, etc.. have Delegates as static
fields but I thought it was worth asking just in case.
 
I have logged an issue, #270. This may not be the place to ask but when
you mention the fix will be a little work, I assume you mean it would
actually be quite involved instead of a small patch I could plausibly do
myself & contribute back?
 
Thanks,
Tim


________________________________

From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
Sent: 09 April 2009 16:54
To: users_at_jersey.dev.java.net
Subject: Re: [Jersey] Injection into HeaderDelegateProvider


Hi Tim,

Unfortunately this is not currently possible.

The HeaderDelegateProvider instances do not behave like other provider
components.

The reason is because the JAX-RS HeaderDelegate class is exposed via the
RuntimeDelegate which gets instantiated without any contextual
information. And, the header delegate instances are used by some of the
classes in JAX-RS e.g. MediaType as static fields.

I think there are ways we can support what you require, but it will
require a little work. Could you log an issue?

Thanks,
Paul.

On Apr 9, 2009, at 5:24 PM, Tim Edwards wrote:



        Hi,

        Is it possible to inject values into a HeaderDelegateProvider?
Basically I have a HeaderDelegateProvider I wish to provide some
configuration so it is capable of reading/writing the header value, I
can't have the information statically within the class and I don't see
an obvious way to make it available.

        Thanks,
        Tim



        If you are not the intended recipient, employee or agent
responsible for delivering the message to the intended recipient, you
are hereby notified that any dissemination or copying of this
communication and its attachments is strictly prohibited. If you have
received this communication and its attachments in error, please return
the original message and attachments to the sender using the reply
facility on e-mail. Internet communications are not secure and therefore
Cambridge Assessment (the brand name for the University of Cambridge
Local Examinations Syndicate, the constituent elements of which are CIE,
ESOL and OCR [Oxford Cambridge and RSA Examinations is a Company Limited
by Guarantee Registered in England. Registered office: 1 Hills Road,
Cambridge CB1 2EU. Company number: 3484466]) does not accept legal
responsibility for the contents of this message. Any views or opinions
presented are solely those of the author and do not necessarily
represent those of Cambridge Assessment unless otherwise specifically
stated. The information contained in this email may be subject to public
disclosure under the Freedom of Information Act 2000. Unless the
information is legally exempt from disclosure, the confidentiality of
this email and your reply cannot be guaranteed.

        This message has been scanned for viruses by BlackSpider
MailControl <http://www.blackspider.com/>




Click here
<https://www.mailcontrol.com/sr/SjX3N7uIRu7TndxI!oX7Ui7EPDmaMvL6HgUWNEDO
rqXNUhWTUZ+NqnhYXb!skkHxMsbklhvLGBP55a0nEA+RCg==> to report this email
as spam.