public abstract class AbstractProxyCommand extends Object implements org.apache.commons.chain.Command
Abstract Command
base class encapsulating a unit of
reverse proxy processing work to be performed, whose purpose is
to support life cycle management with initialize()
and
destroy()
methods, and to examine and/or modify the state of a
reverse proxy transaction that is represented by a ProxyContext
.
Individual AbstractProxyCommand
s can be assembled into a ProxyProcessingChain
,
which allows them to either complete the required processing or delegate further
processing to the next AbstractProxyCommand
in the AbstractProxyCommand
.
Note: AbstractProxyCommand
implementations should be designed in a thread-safe
manner, suitable for inclusion in multiple ProxyProcessingChain
s that might be
processed by different threads simultaneously.
Command}
Constructor and Description |
---|
AbstractProxyCommand() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Invokes this method to give this proxy command a chance to dispose any resource
used in reverse proxy processing.
|
boolean |
execute(org.apache.commons.chain.Context context) |
protected abstract boolean |
executeInternal(ProxyContext context)
Execute a unit of processing work to be performed.
|
void |
initialize()
Initializes the proxy command before using in a proxy processing chain.
|
public void initialize()
public final boolean execute(org.apache.commons.chain.Context context) throws ReverseProxyException, IOException
Note: This method simply casts the Context
argument
to ProxyContext
and delegates the call to executeInternal(ProxyContext)
which must be implemented by a concrete command class.
execute
in interface org.apache.commons.chain.Command
ReverseProxyException
IOException
protected abstract boolean executeInternal(ProxyContext context) throws ReverseProxyException, IOException
Execute a unit of processing work to be performed. This
AbstractProxyCommand
may either complete the required processing
and return true
, or delegate remaining processing
to the next AbstractProxyCommand
in a ProxyProcessingChain
containing this
AbstractProxyCommand
by returning false
.
context
- ReverseProxyException
IOException
public void destroy()
Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.