|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.locomotive.router.Router
The router provides a mechanism for handling HTTP requests from clients and dispatching them to a locomotive, thereby eliminating the need for a web server to be able to run the locomotive.
The router listens for HTTP connections from clients, parses the headers and then either forwardis them to a locomotive or to a real web server, depending on the URL. The locomotive or web server are both optional, and can be run on either the same machine as the router or a different one.
Still to do: use the bean directory for configuration
Method Summary | |
int |
getBacklog()
Returns the maximum length of the queue of clients waiting at any given time. |
int |
getMaxPooledThreads()
Returns the maximum number of threads used by the router. |
int |
getMinPooledThreads()
Returns the minimum number of threads used by the router. |
int |
getPort()
Returns the port this router uses. |
boolean |
isRunning()
Return true if this service is running, false otherwise. |
static void |
main(java.lang.String[] args)
Startup method to use the router as a standalone application. |
void |
setBacklog(int backlog)
Sets the maximum length of the queue of clients waiting at any given time. |
void |
setLocomotive(java.lang.String url,
int port)
Sets the address of the locomotive. |
void |
setMaxPooledThreads(int max)
Sets the maximum number of threads used by the router. |
void |
setMinPooledThreads(int min)
Sets the minimum number of threads used by the router. |
void |
setPort(int port)
Sets the port this router will use. |
void |
setWebServer(java.lang.String url,
int port)
Sets the address of the web server. |
void |
startService()
Start the service. |
void |
stopService()
Stop the service. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public void startService() throws ServiceException
public void stopService() throws ServiceException
public boolean isRunning()
public int getPort()
setPort(int)
public void setPort(int port)
getPort()
public int getBacklog()
setBacklog(int)
public void setBacklog(int backlog)
getBacklog()
public int getMinPooledThreads()
setMinPooledThreads(int)
,
getMaxPooledThreads()
,
setMaxPooledThreads(int)
public void setMinPooledThreads(int min)
getMinPooledThreads()
,
getMaxPooledThreads()
,
setMaxPooledThreads(int)
public int getMaxPooledThreads()
getMinPooledThreads()
,
setMinPooledThreads(int)
,
setMaxPooledThreads(int)
public void setMaxPooledThreads(int max)
getMinPooledThreads()
,
setMinPooledThreads(int)
,
getMaxPooledThreads()
public void setLocomotive(java.lang.String url, int port)
url
- the url as accessed from the router's machineport
- the portpublic void setWebServer(java.lang.String url, int port)
url
- the url as accessed from the router's machineport
- the portpublic static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |