As preFilter and preMatchFilter share the same signature, I wonder why we
need two different names? This assumes that it shall be possible to write
one filter class that serves both ways. But is this realistic? I think not.
I assume a filter is either pre or post, not both. So I think it would be
more natural to have just one method, that by default is non-pre-match, and
if one wants to make it pre-match, give it an annotation to change the
extension point. In one thinks he actually must serve both ways, he could
just add another extension point. Example:
@When({Before, After})
filter(ctx) {}
That way it looks more like triggers in SQL that also can be timed with
BEFORE and AFTER without changing the common declaration syntax or renaming
them.
Regards
Markus
From: Santiago Pericas-Geertsen [mailto:Santiago.PericasGeertsen_at_oracle.com]
Sent: Dienstag, 8. November 2011 17:52
To: jsr339-experts_at_jax-rs-spec.java.net
Subject: [jsr339-experts] Proposal for Pre-Match Filters
Hello Experts,
A new proposal to support pre-match filters is ready for review [1]. The
wiki includes a couple of other minor changes to simplify the API. Namely,
making @GlobalBinding the default (and dropping it) as well as a new
injectable type ResourceInfo.
-- Santiago
[1]
http://java.net/projects/jax-rs-spec/pages/PreMatchingFilters