hazelcast/hazelcast — pull request #164 by Nugs (2012-05-14 13:23:27+00:00)
Title: Allow externalizing of Filter configuration.

This allows the filter to be configured via dependency injection (eg Spring's DelegatingFilterProxy) and therefore the externalization of configuration outside of the built application.

Whilst being able to specify a config-location is fine as the code is at the moment, we need to be able to generically configure that location on an environment by environment basis. This is already possible via Spring with regards to hibernate l2 cache definition and the definition within the hazelcast namespace (as both are Spring managed and the property values can be externalized), but for the filter we need to be able to specify this outside of the web.xml (init-parameters are hard-coded in the deployment and can't be specified elsewhere) - this can be accomplished by wiring the Filter as a DelegatingFilterProxy *if* we have a means of specifying the equivalent of the init-parameters outside the FilterConfig - hence the modifications to WebFilter to support a properties file injection.

The Spring definition then becomes eg:

${location.reference}
true
...

and in web.xml:

filter
org.springframework.web.filter.DelegatingFilterProxy

targetFilterLifecycle
true

This change simply allows the external configuration and doesn't modify any of the existing functionality.