Modifier and Type | Field and Description |
---|---|
protected boolean |
context
Will be set to true if the valve is associated with a context.
|
protected java.lang.ThreadLocal<java.lang.Boolean> |
invoked
If rewriting occurs, the whole request will be processed again.
|
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component.
|
protected java.util.Map<java.lang.String,RewriteMap> |
maps
Maps to be used by the rules.
|
protected java.lang.String |
resourcePath
Relative path to the configuration file.
|
protected RewriteRule[] |
rules
The rewrite rules that the valve will use.
|
container, controller, domain, info, mserver, next, oname, sm
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
Constructor and Description |
---|
RewriteValve() |
Modifier and Type | Method and Description |
---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component.
|
LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle.
|
protected java.io.File |
getConfigBase()
Get config base.
|
java.lang.String |
getConfiguration() |
protected java.lang.String |
getHostConfigPath(java.lang.String resourceName)
Find the configuration path where the rewrite configuration file
will be stored.
|
protected static boolean |
hasScheme(java.lang.StringBuffer uri)
Determine if a URI string has a
scheme component. |
void |
invoke(Request request,
Response response)
The implementation-specific logic represented by this Valve.
|
protected void |
parse(java.io.BufferedReader reader) |
static java.lang.Object |
parse(java.lang.String line)
This factory method will parse a line formed like:
Example:
RewriteCond %{REMOTE_HOST} ^host1.* [OR]
|
protected static void |
parseCondFlag(java.lang.String line,
RewriteCond condition,
java.lang.String flag)
Parser for RewriteCond flags.
|
protected static void |
parseRuleFlag(java.lang.String line,
RewriteRule rule,
java.lang.String flag)
Parser for ReweriteRule flags.
|
void |
removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.
|
void |
setConfiguration(java.lang.String configuration) |
void |
start()
Prepare for the beginning of active use of the public methods of this
component.
|
void |
stop()
Gracefully terminate the active use of the public methods of this
component.
|
backgroundProcess, createObjectName, event, getContainer, getContainerName, getController, getDomain, getInfo, getNext, getObjectName, getParentName, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setNext, setObjectName, toString
protected LifecycleSupport lifecycle
protected RewriteRule[] rules
protected java.lang.ThreadLocal<java.lang.Boolean> invoked
protected java.lang.String resourcePath
protected boolean context
protected java.util.Map<java.lang.String,RewriteMap> maps
public void addLifecycleListener(LifecycleListener listener)
Lifecycle
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic LifecycleListener[] findLifecycleListeners()
Lifecycle
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
Lifecycle
removeLifecycleListener
in interface Lifecycle
listener
- The listener to removepublic void start() throws LifecycleException
Lifecycle
start
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void setConfiguration(java.lang.String configuration) throws java.lang.Exception
java.lang.Exception
public java.lang.String getConfiguration()
protected void parse(java.io.BufferedReader reader) throws LifecycleException
LifecycleException
public void stop() throws LifecycleException
Lifecycle
stop
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that needs to be reportedpublic void invoke(Request request, Response response) throws java.io.IOException, ServletException
ValveBase
This method MUST be provided by a subclass.
protected java.io.File getConfigBase()
protected java.lang.String getHostConfigPath(java.lang.String resourceName)
resourceName
- public static java.lang.Object parse(java.lang.String line)
line
- protected static void parseCondFlag(java.lang.String line, RewriteCond condition, java.lang.String flag)
condition
- flag
- protected static void parseRuleFlag(java.lang.String line, RewriteRule rule, java.lang.String flag)
rule
- flag
- protected static boolean hasScheme(java.lang.StringBuffer uri)
scheme
component.