Provides a more convenient and efficient way to implement ContextProvider -
assembles the context map out of a set of Contributors. Provides two
implementations of Contributor, the preferred one composing its portion of
the context from simple arrays of keys/values (FixedContributor) and another
version which allows the application to supply its own map.
Note that the contributions of the various components are not checked for
duplicates (this could be added at 0 cost with assertions if needed) - if
there is duplication, the actual contents of the map are undefined. It is
the responsibility of the implementer to ensure this does not happen.
One caveat to using this class - do not use the string "identity" as
one of the keys for a Contributor's map (defined as ContextProvider.IDENTITY).
ContextProviderSupport reserves the use of this key.
Note that the Maps returned by ContextProviderSupport.getContext() are
immutable - put, clear, etc. will throw an UnsupportedOperationException.
author: Tim Boudreau |