users@jersey.java.net

Re: [Jersey] AbstractResources

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 02 Oct 2009 16:19:09 +0200

On Oct 2, 2009, at 3:34 PM, António Mota wrote:

> Hmm, I don't even know what you're talking about with "validate the
> model" :o
>

It validates the JAX-RS artifacts (annotations/methods) on a resource
class so you can obtain fatal and non-fatal errors.

Paul.

> That is probably due to the fact that, as I said elsewhere, I'm not
> using the full stack of Jersey but only some bits and pieces (a lot
> of those, actually) That is due to the fact that Jersey is tightly
> coupled with HTTP and our infrastructure has lot's of other
> connectors.
>
> But that is a issue that interest me, I can get in more detail on
> this when I have some time...
>
> Paul Sandoz wrote:
>>
>> On Oct 2, 2009, at 2:59 PM, António Mota wrote:
>>
>>> Hmm, that is strange, because I'm actually using *a lot* of the
>>> AbstractResource capabilities, accessing it by using
>>>
>>> this.abstractResource =
>>> IntrospectionModeller.createResource(this.componentInterface);
>>>
>>
>> IntrospectionModeller is not currently part of the public API. You
>> can use it but there is a risk it might not work in later releases.
>> Note that this does not validate the model. To do that you need to
>> do:
>>
>> BasicValidator validator = new BasicValidator();
>> validator.validate(ar);
>>
>> and then iterate through the issues:
>>
>> for (ResourceModelIssue issue : validator.getIssueList()) {
>> }
>>
>> Paul.
>>
>>
>>> ("this" is my ResourceImpl)
>>>
>>> I must even say that practically all our work with Jersey is based
>>> on this...
>>>
>>>
>>>
>>> Paul Sandoz wrote:
>>>> Hi Cameron,
>>>>
>>>> Can you describe a bit about what you would like to do?
>>>>
>>>> On Oct 2, 2009, at 12:19 PM, Cameron Jones wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I'm not very familiar with annotations processing or the jersey
>>>>> implementation, is there an easy way to access a resource's
>>>>> annotations?
>>>>>
>>>>> The AbstractResource class has the kind of methods i am looking
>>>>> for but is it accessible to resources?
>>>>>
>>>>
>>>> There is currently no publicly available functionality to obtain
>>>> the AbstractResource from a resource class. Such functionality
>>>> would be very easy to expose. But it would help if i can
>>>> understand what you use-case is.
>>>>
>>>> Paul.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>