pygmy.handlers
Class DefaultChainHandler
java.lang.Object
pygmy.core.AbstractHandler
pygmy.handlers.DefaultChainHandler
- All Implemented Interfaces:
- Handler
public class DefaultChainHandler
- extends AbstractHandler
- implements Handler
This is the default implementation of a chain of handlers. The .chain parameter defines the names of the
handlers in the chain, and it defines the order in which those handlers will be called. Each handler name is
seperated by either a ' ' (space) or a ',' (comma). This handler will then try to create a handler for each of
the handler names by looking at configuration property {handler-name}.class. This handler also has a .url-prefix
parameter it uses to know when this handler should pass the request to the chain.
url-prefix | The prefix to filter request urls. | None | Yes |
chain | A space or comma seperated list of the names of the handlers within the chain. | None | Yes |
class | For each of the names in the chain property, this is appended the name to find the classname to instatiate. | None | Yes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CHAIN
public static java.lang.String CHAIN
CHAIN_OPTION
public static final ConfigOption CHAIN_OPTION
DefaultChainHandler
public DefaultChainHandler()
initialize
public boolean initialize(java.lang.String handlerName,
Server server)
- Specified by:
initialize
in interface Handler
- Overrides:
initialize
in class AbstractHandler
handle
public boolean handle(Request request,
Response response)
throws java.io.IOException
- Specified by:
handle
in interface Handler
- Overrides:
handle
in class AbstractHandler
- Throws:
java.io.IOException
shutdown
public boolean shutdown(Server server)
- Specified by:
shutdown
in interface Handler
- Overrides:
shutdown
in class AbstractHandler