users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Configuration interface too complex

From: Bill Burke <bburke_at_redhat.com>
Date: Tue, 13 Dec 2011 13:24:21 -0500

I think you missed this in my previous note, but the Configuration
interface is too complex to have to implement for an application
developer as there is a lot of logic that would be needed to implement
disable/enable/update. Either this needs to be turned into a class, or
Configuration needs to be greatly simplified.

What I would prefer is that Configuration becomes very simple and
disable/enable/update/property methods are moved to the Client interface:

interface Configuration {
      Set<Class<?>> getProviderClasses();
      Set<Object> getProviderInstances();
      Map<String, Object> getProperties();
}

and move register(), disable() et. al. to the Client interface and not
expose Configuration there:

interface Client {

    setProperty(...);
    register(...);
}

There's really 2 reasons why I want it this way.
* I want the container to have full control over how
disable/register/update etc. are implemented. I don't want the user to
be able to override these methods. I don't want the spec to implement
them either.

* Configuration becomes more akin to Application. A simple interface
for specifying what is bound.


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com