Re: Matching algorithm for resources

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 25 Apr 2007 09:01:02 +0200

Jan Algermissen wrote:
>> In our prototype we use the Java annotation processor to auto-
>> magically obtain the set of root classes from the Java source
>> code. Then we generate a Java class in a user-defined package that
>> contains this set of root classes. When creating a web application
>> this package name is used to obtain the generated class and the
>> set of root classes. (We also support the explicit setting of set
>> of the root classes at runtime.)
> Ok. So the handlers are plaugable at runtime, good.

Yes, although i like to say the POJOs are plugable :-) the compile
time thing is some tooling sugar so the developers don't have to re-
declare the root resources.

> Is there also a way to use the same class twice, just hooked to
> different root paths? E.g. can I write a generic RDBMS wraper class
> and have the container dispatch to multiple configurations of it
> (at different root paths)?

Yes, but for different root paths it requires that you extend the
generic RDBMS wraper class and those extended classes have the
UriTemplate annotated on them.

>>> -------
>>> This reminds me: does the API so far include a standard way to
>>> access container configuration (for the handler classes to access
>>> configuration time parameters)?
>> By configuration time parameters do you mean the annotations?
> No, I mean for example database connection parameters that I pass
> in via the configuration (this is surely not compile time
> information).

Ah, i see. We have been looking at such things like Java Persistence
API related classes can be injected (via the Resource annotation).
Such injection type stuff is part of EE 5 and we need to see what we
should support in this respect. We have also been looking out how
injection of Java Persistence API stuff could work for non EE
containers too. This definitely requires further discussion.


| ? + ? = To question
    Paul Sandoz