|
Tynamo™-TINI v1.0.4 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.qindesign.tini.http.HttpServer
com.qindesign.tini.http.ServletHttpServer
public class ServletHttpServer
Implements a servlet container. This implements the Runnable
interface, so it can be started in a new thread.
| Field Summary |
|---|
| Fields inherited from class com.qindesign.tini.http.HttpServer |
|---|
logger |
| Constructor Summary | |
|---|---|
ServletHttpServer(Properties props)
Convenience method that calls ServletHttpServer(Properties, Properties)
with a value of null for the second parameter. |
|
ServletHttpServer(Properties props,
Properties servletProps)
Creates a new servlet server. |
|
| Method Summary | |
|---|---|
Object |
getAttribute(String name)
|
Enumeration |
getAttributeNames()
|
ServletContext |
getContext(String uripath)
Returns this. |
String |
getInitParameter(String name)
|
Enumeration |
getInitParameterNames()
|
int |
getMajorVersion()
Returns 2. |
String |
getMimeType(String file)
|
int |
getMinorVersion()
Returns 2. |
RequestDispatcher |
getNamedDispatcher(String name)
This can return null if there was an error initializing an
unloaded servlet. |
String |
getRealPath(String path)
Returns the path if the file is a normal file. |
RequestDispatcher |
getRequestDispatcher(String path)
Returns null if the path does not start with a '/'. |
URL |
getResource(String path)
Currently only returns a "file:" URL. |
InputStream |
getResourceAsStream(String path)
|
Servlet |
getServlet(String name)
Deprecated. |
Enumeration |
getServletNames()
Deprecated. |
Enumeration |
getServlets()
Deprecated. |
void |
log(Exception exception,
String message)
Deprecated. |
void |
log(String msg)
Logs a message. |
void |
log(String msg,
Throwable th)
Logs a string plus a Throwable object. |
protected void |
performGC()
Perform some cleanup. |
protected void |
performShutdown()
Performs shutdown cleanup. |
void |
removeAttribute(String name)
|
protected void |
service(com.qindesign.tini.http.HttpRequest req,
com.qindesign.tini.http.HttpResponse resp)
Services an HTTP request. |
void |
setAttribute(String name,
Object object)
|
| Methods inherited from class com.qindesign.tini.http.HttpServer |
|---|
currentTimeMillis, getContentTypeFor, getIntProperty, getProperty, getServerInfo, kill, run, shutdown |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.ServletContext |
|---|
getServerInfo |
| Constructor Detail |
|---|
public ServletHttpServer(Properties props)
ServletHttpServer(Properties, Properties)
with a value of null for the second parameter.
props - server initialization propertiesServletHttpServer(Properties, Properties)
public ServletHttpServer(Properties props,
Properties servletProps)
Runnable
interface, so it can be run from a new thread.
If servletProps is null, then the servlet
properties will be loaded from the file specified in the server
properties as usual. Otherwise, the file is ignored and the properties
from this parameter will be used instead.
props - server initialization propertiesservletProps - servlet initialization properties, can be
null| Method Detail |
|---|
public void log(String msg)
log in interface ServletContext
public void log(String msg,
Throwable th)
Throwable object.
log in interface ServletContext
protected void service(com.qindesign.tini.http.HttpRequest req,
com.qindesign.tini.http.HttpResponse resp)
throws IOException
com.qindesign.tini.http.HttpServer
service in class com.qindesign.tini.http.HttpServerIOExceptionprotected void performGC()
performGC in class com.qindesign.tini.http.HttpServerprotected void performShutdown()
performShutdown in class com.qindesign.tini.http.HttpServerpublic ServletContext getContext(String uripath)
this.
getContext in interface ServletContextpublic int getMajorVersion()
2.
getMajorVersion in interface ServletContextpublic int getMinorVersion()
2.
getMinorVersion in interface ServletContextpublic String getMimeType(String file)
getMimeType in interface ServletContext
public URL getResource(String path)
throws MalformedURLException
getResource in interface ServletContextMalformedURLExceptionpublic InputStream getResourceAsStream(String path)
getResourceAsStream in interface ServletContextpublic RequestDispatcher getRequestDispatcher(String path)
null if the path does not start with a '/'.
getRequestDispatcher in interface ServletContextpublic RequestDispatcher getNamedDispatcher(String name)
null if there was an error initializing an
unloaded servlet.
getNamedDispatcher in interface ServletContextpublic String getRealPath(String path)
getRealPath in interface ServletContextpublic Object getAttribute(String name)
getAttribute in interface ServletContextpublic Enumeration getAttributeNames()
getAttributeNames in interface ServletContext
public void setAttribute(String name,
Object object)
setAttribute in interface ServletContextpublic void removeAttribute(String name)
removeAttribute in interface ServletContextpublic String getInitParameter(String name)
getInitParameter in interface ServletContextpublic Enumeration getInitParameterNames()
getInitParameterNames in interface ServletContext
public Servlet getServlet(String name)
throws ServletException
getServlet in interface ServletContextServletExceptionpublic Enumeration getServletNames()
getServletNames in interface ServletContextpublic Enumeration getServlets()
getServlets in interface ServletContext
public void log(Exception exception,
String message)
log in interface ServletContext
|
Tynamo™-TINI v1.0.4 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||