[OT] Had a hacky way. Gone, as the valve no longer needs info from the deployer. Actually, it was just the old 4.x code left in place.
The WebMetaData is the correct place in absence of being able to directly configure the valves in a beans.xml descriptor/metadata (which is where we need to get to in terms of jbossweb). Logically a valve should be specified as an aspect with introductions that add the required tomcat interfaces.
The TomcatDeployment which instantiates the valves has access to the WebApplication instance (which contains the deploymentunit /attachments).
This way we can inject the settings from the deployer onto the valve.
Anything wrong with this approach?
The valve settings can be app specific from the context.xml, so it has to be overridable from some app level settings. A default set of valves configured at the deployer level is fine.