Method from org.apache.tomcat.util.handler.TcHandler Detail: |
public void destroy() throws IOException {
}
Clean up and stop the handler. Override if needed. |
public Object getAttribute(String name) {
return attributes.get(name) ;
}
Get an attribute. Override to allow runtime query ( attribute can be
anything, including statistics, etc ) |
public int getId() {
return id;
}
|
public String getName() {
return name;
}
|
public void init() throws IOException {
}
Should register the request types it can handle,
same style as apache2. |
abstract public int invoke(TcHandlerCtx tcCtx) throws IOException
The 'hook' method. If a 'next' was set, invoke should call it ( recursive behavior,
similar with valve ).
The application using the handler can also iterate, using the same semantics with
Interceptor or APR hooks. |
public void setAttribute(String name,
Object value) {
attributes.put( name, value );
}
Base implementation will just save all attributes.
It is higly desirable to override this and allow runtime reconfiguration.
XXX Should I make it abstract and force everyone to override ? |
public void setId(int id) {
this.id=id;
}
Set the id of the worker. It can be used for faster dispatch.
Must be unique, managed by whoever creates the handlers. |
public void setName(String s) {
name=s;
}
Set the name of the handler. Will allways be called by
worker env after creating the worker. |
public void setNext(TcHandler h) {
next=h;
}
Catalina-style "recursive" invocation. A handler is required to call
the next handler if set. |
public void start() throws IOException {
}
|
public void stop() throws IOException {
}
|