jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: [jax-rs-spec users] A Feature interface

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Fri, 10 Jun 2011 09:49:57 -0400

On Jun 9, 2011, at 3:49 PM, Bill Burke wrote:

>>
>> What if we change the DynamicBinding interface as follows:
>>
>> public interface DynamicBinding<T extends BaseContext> {
>> public boolean isBound(T ctx);
>> }
>>
>> That'll give access to everything in the context. Incidentally, why did you use AccessibleObject as the return type of getAppliedTarget() in your original proposal?
>>
>
> I was thinking of something more that was a boot/deployment/init time thing.
>
> public interface Feature {
>
> void bind(Client client);
> void bind(Client client, BaseContext ctx);
> void bindServer(BaseContext ctx);
> }
>
> Or have 2 separete interfaces:
>
> public interface ClientFeature {...}
>
> public interface ServerFeature {...}
>
> Maybre that makes more sense and would allow us to separate client and server easier if we ever wanted JAX-RS client to be in JDK.
>
> It would then look like:
>
> clientConfigurate.getClasses().add(MyFeature.class);
>
> or Application.getClasses() would return a MyFeature.class.

 Let's take the server case for the sake of the discussion. The feature is somehow installed at boot/init time, and the bind() method is called at runtime for every resource method invocation? How is this different from a _global_ filter (@GlobalBinding) that implements DynamicBinding?

-- Santiago