Acme.Serve.Serve Class Reference

List of all members.

Detailed Description

Minimal Java HTTP server class.

Definition at line 85 of file Serve.java.

Public Member Functions

 Serve (Hashtable arguments, PrintStream logStream)
 Constructor.
 Serve ()
void addServlet (String urlPat, String className)
 Register a Servlet by class name. Registration consists of a URL.
void addServlet (String urlPat, String className, Hashtable initParams)
void addServlet (String urlPat, Servlet servlet)
 Register a Servlet. Registration consists of a URL pattern,.
void addServlet (String urlPat, Servlet servlet, Hashtable initParams)
void addDefaultServlets (String cgi)
 Register a standard set of Servlets. These will return.
void addDefaultServlets (String cgi, String throttles) throws IOException
 Register a standard set of Servlets, with throttles.
void serve ()
Servlet getServlet (String name)
 Gets a servlet by name.
Enumeration getServlets ()
 Enumerates the servlets in this context (server). Only servlets that.
Enumeration getServletNames ()
 Enumerates the names of the servlets in this context (server). Only.
void destroyAllServlets ()
 Destroys all currently-loaded servlets.
void setMappingTable (PathTreeDictionary mappingtable)
void setRealms (PathTreeDictionary realms)
void log (String message)
 Write information to the servlet log.
void log (String message, Throwable throwable)
void log (Exception exception, String message)
 Write a stack trace to the servlet log.
String getRealPath (String path)
 Applies alias rules to the specified virtual path and returns the.
String getMimeType (String file)
 Returns the MIME type of the specified file.
String getServerInfo ()
 Returns the name and version of the web server under which the servlet.
Object getAttribute (String name)
 Returns the value of the named attribute of the network service, or.
void removeAttribute (String name)
void setAttribute (String name, Object object)
Enumeration getAttributeNames ()
ServletContext getContext (String uripath)
int getMajorVersion ()
int getMinorVersion ()
java.util.Set getResourcePaths (java.lang.String path)
 Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument.
java.lang.String getServletContextName ()
 Returns the name of this web application correponding to this ServletContext as specified in the deployment descriptor for this web application by the display-name element.
URL getResource (String path) throws MalformedURLException
InputStream getResourceAsStream (String path)
RequestDispatcher getRequestDispatcher (String urlpath)
String getInitParameter (String param)
Enumeration getInitParameterNames ()
RequestDispatcher getNamedDispatcher (String name)
void forward (ServletRequest _request, ServletResponse _response) throws ServletException, java.io.IOException
void include (ServletRequest _request, ServletResponse _response) throws ServletException, java.io.IOException

Static Public Member Functions

static void main (String[] args)
 Main routine, if you want to run this directly as an application.

Static Public Attributes

static final String ARG_PORT = "port"
static final String ARG_THROTTLES = "throttles"
static final String ARG_SERVLETS = "servlets"
static final String ARG_REALMS = "realms"
static final String ARG_ALIASES = "aliases"
static final String ARG_CGI_PATH = "cgi-path"
static final String ARG_SESSION_TIMEOUT = "session-timeout"
static final String ARG_LOG_OPTIONS = "log-options"
static final String ARG_SOCKET_FACTORY = "socketFactory"

Protected Member Functions

ServerSocket createServerSocket () throws IOException

Protected Attributes

PathTreeDictionary registry
PathTreeDictionary realms
Hashtable arguments

Static Protected Attributes

static final int DEF_SESSION_TIMEOUT = 30
static final int DEF_PORT = 9090

Package Functions

void setAccessLogged ()
boolean isAccessLogged ()
boolean isShowReferer ()
boolean isShowUserAgent ()
Object getSession (String id)
HttpSession createSession ()
void removeSession (String id)
synchronized String generateSessionId ()

Package Attributes

int port
String hostName
sun.misc.BASE64Decoder base64Dec = new sun.misc.BASE64Decoder()
int uniqer
HttpSessionContextImpl sessions
boolean running = true

Static Package Attributes

static int expiredIn

Classes

class  Identification
interface  SocketFactory


Member Function Documentation

java.util.Set Acme.Serve.Serve.getResourcePaths ( java.lang.String  path  ) 

Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument.

Paths indicating subdirectory paths end with a '/'. The returned paths are all relative to the root of the web application and have a leading '/'. For example, for a web application containing

/welcome.html
/catalog/index.html
/catalog/products.html
/catalog/offers/books.html
/catalog/offers/music.html
/customer/login.jsp
/WEB-INF/web.xml
/WEB-INF/classes/com.acme.OrderServlet.class,

getResourcePaths("/") returns {"/welcome.html", "/catalog/", "/customer/", "/WEB-INF/"}
getResourcePaths("/catalog/") returns {"/catalog/index.html", "/catalog/products.html", "/catalog/offers/"}.

Parameters:
the - partial path used to match the resources, which must start with a /
Returns:
a Set containing the directory listing, or null if there are no resources in the web application whose path begins with the supplied path.
Since:
Servlet 2.3

Definition at line 882 of file Serve.java.

java.lang.String Acme.Serve.Serve.getServletContextName (  ) 

Returns the name of this web application correponding to this ServletContext as specified in the deployment descriptor for this web application by the display-name element.

Returns:
The name of the web application or null if no name has been declared in the deployment descriptor.
Since:
Servlet 2.3

Definition at line 893 of file Serve.java.


The documentation for this class was generated from the following file:
Generated on Mon Dec 4 11:03:33 2006 for OpenMobileIS by  doxygen 1.5.1-p1