8.5. Configure a Global Valve
Global valves are enabled and configured in the web subsystem. This is done using the JBoss CLI tool.
Procedure 8.2. Configure a Global Valve
Enable the Valve
Use theadd
operation to add a new valve entry./subsystem=web/valve=VALVENAME:add(module="MODULENAME",class-name="CLASSNAME")
You need to specify the following values:VALVENAME
, the name that is used to refer to this valve in application configuration.MODULENAME
, the module that contains the value being configured.CLASSNAME
, the classname of the specific valve in the module.
/subsystem=web/valve=clientlimiter:add(module="clientlimitermodule",class-name="org.jboss.samplevalves.restrictedUserAgentsValve")
Optionally: Specify Parameters
If the valve has configuration parameters, specify these with theadd-param
operation./subsystem=web/valve=testvalve:add-param(param-name="NAME", param-value="VALUE")
/subsystem=web/valve=testvalve:add-param( param-name="restricteduseragents", param-value="^.*MS Web Services Client Protocol.*$" )
The valve is now enabled and configured for all deployed applications.