org.locomotive.loco.handler
Class HandlerRoutingTable
java.lang.Object
|
+--org.locomotive.server.ServiceRoutingTable
|
+--org.locomotive.loco.handler.HandlerRoutingTable
- public class HandlerRoutingTable
- extends ServiceRoutingTable
Used to choose which handler classes get invoked. Used by the
RequestManager. Has some preset defaults- see putInDefaults
Constructor Summary |
HandlerRoutingTable(java.lang.String path,
Log log,
java.util.Vector classpath,
boolean auto_reload)
creates a new (but uninitialized) HanderManager |
Method Summary |
protected ServiceRoutingTable.ServiceEntry |
createServiceEntry(java.lang.String pattern,
java.lang.String classname,
java.lang.String config_path)
Adds the a HandlerEntry to the service_hash. |
protected void |
putInDefaults()
Overrides the superclass to put in the default handlers. |
void |
routeRequest(int request_id,
java.net.Socket sock,
java.io.InputStream is,
java.io.OutputStream os,
java.util.Hashtable cgi_envars,
java.util.Hashtable form_hash,
java.util.Hashtable steam_vars,
java.lang.String[] url_tokens,
java.lang.String request_uri,
long bstamp_id,
Response resp,
java.sql.Connection conn,
Session session,
java.util.Hashtable attributes)
This gets called on every request by the loco, once it
determines it has a handler in its hands. |
Methods inherited from class org.locomotive.server.ServiceRoutingTable |
addService,
containsService,
getProperties,
getService,
initialize,
log,
markServiceForReloading,
reloadService,
routeToClass,
routeToService,
routeToServiceEntry,
shutdown,
throwException |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
server_log
protected Log server_log
HandlerRoutingTable
public HandlerRoutingTable(java.lang.String path,
Log log,
java.util.Vector classpath,
boolean auto_reload)
- creates a new (but uninitialized) HanderManager
- Parameters:
path
- the path to the table filelog
- a server log
createServiceEntry
protected ServiceRoutingTable.ServiceEntry createServiceEntry(java.lang.String pattern,
java.lang.String classname,
java.lang.String config_path)
- Adds the a HandlerEntry to the service_hash.
- Overrides:
- createServiceEntry in class ServiceRoutingTable
putInDefaults
protected void putInDefaults()
throws InitializationException
- Overrides the superclass to put in the default handlers.
here's what we put in:
default org.locomotive.loco.handler.DefaultHandler
unknown org.locomotive.loco.handler.UnknownHandler
srv org.locomotive.loco.ServerHandler
- Overrides:
- putInDefaults in class ServiceRoutingTable
routeRequest
public void routeRequest(int request_id,
java.net.Socket sock,
java.io.InputStream is,
java.io.OutputStream os,
java.util.Hashtable cgi_envars,
java.util.Hashtable form_hash,
java.util.Hashtable steam_vars,
java.lang.String[] url_tokens,
java.lang.String request_uri,
long bstamp_id,
Response resp,
java.sql.Connection conn,
Session session,
java.util.Hashtable attributes)
- This gets called on every request by the loco, once it
determines it has a handler in its hands. It sets up everything
the handler needs, then sends it on its way.
- Overrides:
- routeRequest in class ServiceRoutingTable
- Parameters:
request_id
- the unique id for this requestsock
- the socket this request connected onis
- the inputstream from that socketos
- the outputstream from that socketreply_protocol
- the protocol type we received the request fromcgi_envars
- the CGI variables passed in with the requestform_hash
- the form data, if there was anyurl_tokens
- a tokenized form of the urlrequest_uri
- the unparsed url tokensbstamp_id
- the browser stamp id that came in from the
bstamp cookie for this requestconn
- the Database connection for this requestsession
- the Session object for this requestuser
- the user for this request