|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.locomotive.server.ServiceRoutingTable
|
+--org.locomotive.loco.servlet.ServletRoutingTable
This class controls servlet activity for a particular servlet routing table. An instance should be created at startup and maintained throughout the life of the server. The send a servlet on it's way, use the routeRequest method.
| Inner Class Summary | |
class |
ServletRoutingTable.ServletEntry
|
| Inner classes inherited from class org.locomotive.server.ServiceRoutingTable |
ServiceRoutingTable.ServiceEntry |
| Field Summary | |
static java.lang.Class |
single_thread_model_class
|
static javax.servlet.Servlet |
unavailable_servlet
|
| Fields inherited from class org.locomotive.server.ServiceRoutingTable |
AVAILABLE,
PERMANENTLY_UNAVAILABLE,
server_log,
service_configs,
service_extensions_hash,
service_tokens_hash,
SHUTDOWN,
UNAVAILABLE_AND_WAITING |
| Constructor Summary | |
ServletRoutingTable(java.lang.String path,
Log server_log,
java.util.Vector classpath,
boolean auto_reload)
Initializes the servletRoutingTable and loads the servlets. |
|
| Method Summary | |
protected ServiceRoutingTable.ServiceEntry |
createServiceEntry(java.lang.String pattern,
java.lang.String classname,
java.lang.String config_path)
Adds the a ServletEntry to the service_tokens_hash or the service_extensions_hash. |
java.util.Enumeration |
getIds()
Deprecated. for security reasons |
LocoServletRequest |
getLocoServletRequest()
This method returns the LocoServletRequest for the current Thread |
javax.servlet.http.HttpSession |
getSession(java.lang.String sessionId)
Deprecated. for security reasons |
javax.servlet.http.HttpSessionContext |
getSessionContext()
Returns the session context object for this server. |
void |
initialize()
This method overrides ServiceRoutingTable::initialize(). |
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 response,
java.sql.Connection conn,
Session session,
java.util.Hashtable attrib)
This gets called on every request by the loco, once it determines it has a servlet in its hands. |
java.lang.Object |
routeToService(LocoConfig config,
java.lang.String request_uri,
java.lang.String first_token)
Finds and returns the service Object associated with the specified request uri. |
static void |
sendErrorMsg(int status_code,
java.lang.String error_msg,
javax.servlet.ServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Displays and error page with Standard insertions, plus the error string for the class. |
| Methods inherited from class org.locomotive.server.ServiceRoutingTable |
addService,
containsService,
getProperties,
getService,
log,
markServiceForReloading,
reloadService,
routeToClass,
routeToServiceEntry,
shutdown,
throwException |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static java.lang.Class single_thread_model_class
public static javax.servlet.Servlet unavailable_servlet
| Constructor Detail |
public ServletRoutingTable(java.lang.String path,
Log server_log,
java.util.Vector classpath,
boolean auto_reload)
throws InitializationException
| Method Detail |
public void initialize()
throws InitializationException
protected ServiceRoutingTable.ServiceEntry createServiceEntry(java.lang.String pattern,
java.lang.String classname,
java.lang.String config_path)
protected void putInDefaults()
throws InitializationException
default SimpleServlet unknown SimpleServlet srv ServerServlet
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 response,
java.sql.Connection conn,
Session session,
java.util.Hashtable attrib)
request_id - the unique id for this requestsock - the socket this request connected onis - the inputstream from that socketos - the outputstream from that socketcgi_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 requestresponse - the response for this requestconn - the Database connection for this requestsession - the Session object for this requestattrib - attributes for this request
public java.lang.Object routeToService(LocoConfig config,
java.lang.String request_uri,
java.lang.String first_token)
config - a reference to the LocoConfig objectrequest_uri - the URI of the requestfirst_token - the first URL token of the request. It is
used to find the correct service to map the request to.ServiceRoutingTable.routeToService(org.locomotive.loco.LocoConfig, java.lang.String, java.lang.String)public javax.servlet.http.HttpSessionContext getSessionContext()
public LocoServletRequest getLocoServletRequest()
public static void sendErrorMsg(int status_code,
java.lang.String error_msg,
javax.servlet.ServletRequest req,
javax.servlet.http.HttpServletResponse resp)
status_code - one of the status codes defined in
HttpServletResponse.error_msg - The message to display. If left blank or null,
then the following will message will be displayed: Your request could not be processed due to an
internal servlet error.req - the request object for this requestresp - the response object for this requestpublic java.util.Enumeration getIds()
public javax.servlet.http.HttpSession getSession(java.lang.String sessionId)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||