GenericUnWrapper with test (GEOS-6578)

GenericUnWrapper implemented with method reflection, preconfigured unwrap method lookup for several JBoss environments.

https://jira.codehaus.org/browse/GEOS-6578
Oracle dialect caches the unwrapper.

Still since the field is no longer public I do not need synchronization protection here. 



> On Aug 1, 2014, at 10:43 PM, Andrea Aime <notifications@github.com> wrote:
> 
> In src/main/src/main/java/org/geoserver/data/jdbc/GenericUnWrapper.java:
> 
> > + * 
> > + * @author Jody Garnett - OpenGeo
> > + */
> > +public class GenericUnWrapper implements UnWrapper {
> > +    private final static Logger LOGGER = Logging
> > +            .getLogger("org.geoserver.data.jdbc.GenericUnWrapper");
> > +
> > +    /**
> > +     * Primary record of known access methods used to unwrap conenctions in exotic deployment
> > +     * environments such as JBoss.
> > +     * <p>
> > +     * This field is package visible to allow local testing.
> > +     */
> > +    public static final Map<Class<?>, Method> CONNECTION_METHODS;
> > +    static {
> > +        CONNECTION_METHODS = Collections.synchronizedMap(new HashMap<Class<?>, Method>());
> Wondering, given that we call unwrap basically for each feature read from the database, and thus we are going to get a fair amount of pressure over this code under concurrent read load, wouldn't it be better to use a concurrent hash map and avoid the synchronizations later in the code?
> 
> —
> Reply to this email directly or view it on GitHub.