Selective Parsing?
Rod Widdowson
rdw at steadingsoftware.com
Fri Mar 7 10:21:27 EST 2014
> Just looking for side channels.
For the record, although you cannot use Bean Definition Profiles in exactly
the way they are meant to be used, this does represent a useful side channel
we can use. For some reason I had missed this when I looked last time. I
was probably too appalled by the way that the profile handling actual works
inside the parsing.
When we set up the Application context we set up the profile as one might
expect
context.getEnvironment().setActiveProfiles("whatever");
and in the parse code one can detect this
if
(parserContext.getDelegate().getEnvironment().acceptsProfiles("whatever "))
{
On the assumption that it is during initialization that the metadata is
actually downloaded, parsed and unmarshalled, it is probably easiest in our
case to use this to just not enable automatic initialization of the
MetadataProviders when we are parsing the relying party and profile
configurations.
I'll note also that if we do this, it becomes essential that we do *NOT*
have any attributes in any elements in out custom schemas with the name
"profile", because as soon as we turn on profiles then these elements will
start to be dropped on the floor by the Spring parsing code before our
custom parsers are even consulted.
/R
More information about the dev
mailing list