Java Doc for WebServer.java in  » Database-DBMS » hsql » org » hsqldb » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » hsql » org.hsqldb 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.hsqldb.Server
      org.hsqldb.WebServer

WebServer
public class WebServer extends Server (Code)
The HSQLDB HTTP protocol network database server.

WebServer has two distinct functions:

The primary function is to allow client/server access to HSQLDB databases via the HTTP protocol. This protocol is less efficient than the HSQL protocol used by the Server class and should be used only in situations where sandboxes or firewalls between the client and the server do not allow the use of the HSQL protocol. One example is client/server access by an applet running in browsers on remote hosts and accessing the database engine on the HTTP server from which the applet originated. From version 1.7.2, HTTP database connections are persistent and support transactions. Similar to HSQL connections, they should be explicitly closed to free the server resources.

The secondary function of WebServer is to act as a simple general purpose HTTP server. It is aimed to support the minimum requirements set out by the HTTP/1.0 standard. The HEAD and GET methods can be used to query and retreive static files from the HTTP server.

Both the database server and HTTP server functions of WebServer can be configured with the webserver.properties file. It contains entries for the database server similar to those for the HSQL protocol Server class. In addition, a list mapping different file endings to their mime types may be included in this file. (fredt@users)

From the command line, the options are as follows:

 +----------------+-------------+----------+------------------------------+
 |    OPTION      |    TYPE     | DEFAULT  |         DESCRIPTION          |
 +----------------+-------------+----------+------------------------------|
 | -?             | --          | --       | prints this message          |
 | -address       | name|number | any      | server inet address          |
 | -port          | number      | 80       | port at which server listens |
 | -database.i    | [type]spec  | 0=test   | path of database i           |
 | -dbname.i      | alias       | --       | url alias for database i     |
 | -silent        | true|false  | true     | false => display all queries |
 | -trace         | true|false  | false    | display JDBC trace messages  |
 | -no_system_exit| true|false  | false    | do not issue System.exit()   |
 +----------------+-------------+----------+------------------------------+
 
Example of the webserver.properties file:
 server.port=80
 server.database.0=test
 server.dbname.0=...
 ...
 server.database.n=...
 server.dbname.n=...
 server.silent=true
 .htm=text/html
 .html=text/html
 .txt=text/plain
 .gif=image/gif
 .class=application/octet-stream
 .jpg=image/jpeg
 .jgep=image/jpeg
 .zip=application/x-zip-compressed
 
  • For server.root, use '/' as the separator, even for DOS/Windows.
  • File extensions for mime types must be lowercase and start with '.'
Replaces original Hypersonic class of the same name.
author:
   fredt@users
author:
   boucherb@users
version:
   1.7.2
since:
   1.7.2


Field Summary
static  intwebBundleHandle
     Handle to resource bundle providing i18n for things like HTTP error pages.

Constructor Summary
public  WebServer()
    

Method Summary
public  StringgetDefaultWebPage()
     Retrieves the name of the web page served when no page is specified.
public  StringgetHelpString()
     Retrieves a String object describing the command line and properties options for this Server.
public  StringgetProductName()
     Retrieves this server's product name.
public  StringgetProtocol()
     Retrieves a string respresentaion of the network protocol this server offers, typically one of 'HTTP', HTTPS', 'HSQL' or 'HSQLS'.
public  StringgetWebRoot()
     Retrieves the root context (directory) from which web content is served.
public static  voidmain(String[] args)
     Starts a new WebServer.
Parameters:
  args - the "command line" parameters with which to startthe WebServer.

Field Detail
webBundleHandle
static int webBundleHandle(Code)
Handle to resource bundle providing i18n for things like HTTP error pages.




Constructor Detail
WebServer
public WebServer()(Code)




Method Detail
getDefaultWebPage
public String getDefaultWebPage()(Code)
Retrieves the name of the web page served when no page is specified. This attribute is relevant only when server protocol is HTTP(S). the name of the web page served when no page is specified



getHelpString
public String getHelpString()(Code)
Retrieves a String object describing the command line and properties options for this Server. the command line and properties options help for this Server



getProductName
public String getProductName()(Code)
Retrieves this server's product name.

Typically, this will be something like: "HSQLDB xxx server". the product name of this server




getProtocol
public String getProtocol()(Code)
Retrieves a string respresentaion of the network protocol this server offers, typically one of 'HTTP', HTTPS', 'HSQL' or 'HSQLS'. string respresentation of this server's protocol



getWebRoot
public String getWebRoot()(Code)
Retrieves the root context (directory) from which web content is served. This property is relevant only when the server protocol is HTTP(S). Although unlikely, it may be that in the future other contexts, such as jar urls may be supported, so that pages can be served from the contents of a jar or from the JVM class path. the root context (directory) from which web content is served



main
public static void main(String[] args)(Code)
Starts a new WebServer.
Parameters:
  args - the "command line" parameters with which to startthe WebServer. "-?" will cause the command line argumentshelp to be printed to the standard output



Fields inherited from org.hsqldb.Server
final protected static int serverBundleHandle(Code)(Java Doc)
HashSet serverConnSet(Code)(Java Doc)
protected ThreadGroup serverConnectionThreadGroup(Code)(Java Doc)
protected String serverId(Code)(Java Doc)
HsqlProperties serverProperties(Code)(Java Doc)
protected int serverProtocol(Code)(Java Doc)
protected ServerSocket socket(Code)(Java Doc)
protected HsqlSocketFactory socketFactory(Code)(Java Doc)

Methods inherited from org.hsqldb.Server
protected boolean allowConnection(Socket socket)(Code)(Java Doc)
public void checkRunning(boolean running) throws RuntimeException(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
public String getAddress()(Code)(Java Doc)
final synchronized int getDBID(String aliasPath) throws HsqlException(Code)(Java Doc)
public String getDatabaseName(int index, boolean asconfigured)(Code)(Java Doc)
public String getDatabasePath(int index, boolean asconfigured)(Code)(Java Doc)
public String getDatabaseType(int index)(Code)(Java Doc)
public String getDefaultWebPage()(Code)(Java Doc)
public PrintWriter getErrWriter()(Code)(Java Doc)
final int getFirstEmptyDatabaseIndex()(Code)(Java Doc)
public String getHelpString()(Code)(Java Doc)
public PrintWriter getLogWriter()(Code)(Java Doc)
public int getPort()(Code)(Java Doc)
public String getProductName()(Code)(Java Doc)
public String getProductVersion()(Code)(Java Doc)
public String getProtocol()(Code)(Java Doc)
public Throwable getServerError()(Code)(Java Doc)
public String getServerId()(Code)(Java Doc)
public synchronized int getState()(Code)(Java Doc)
public String getStateDescriptor()(Code)(Java Doc)
public String getWebRoot()(Code)(Java Doc)
public void handleConnection(Socket s)(Code)(Java Doc)
protected void init(int protocol)(Code)(Java Doc)
public boolean isNoSystemExit()(Code)(Java Doc)
public boolean isRestartOnShutdown()(Code)(Java Doc)
public boolean isSilent()(Code)(Java Doc)
public boolean isTls()(Code)(Java Doc)
public boolean isTrace()(Code)(Java Doc)
public static void main(String[] args)(Code)(Java Doc)
final void notify(int action, int id)(Code)(Java Doc)
final int openDatabase(String alias, String filepath) throws HsqlException(Code)(Java Doc)
final boolean openDatabases()(Code)(Java Doc)
protected synchronized void print(String msg)(Code)(Java Doc)
protected synchronized void printError(String msg)(Code)(Java Doc)
protected static void printHelp(String key)(Code)(Java Doc)
protected void printProperties()(Code)(Java Doc)
final void printRequest(int cid, Result r)(Code)(Java Doc)
final void printResource(String key)(Code)(Java Doc)
protected synchronized void printStackTrace(Throwable t)(Code)(Java Doc)
protected void printWithThread(String msg)(Code)(Java Doc)
final void printWithTimestamp(String msg)(Code)(Java Doc)
public boolean putPropertiesFromFile(String path)(Code)(Java Doc)
public void putPropertiesFromString(String s)(Code)(Java Doc)
final synchronized void releaseDatabase(int id)(Code)(Java Doc)
public void setAddress(String address) throws RuntimeException(Code)(Java Doc)
public void setDatabaseName(int index, String name) throws RuntimeException(Code)(Java Doc)
public void setDatabasePath(int index, String path) throws RuntimeException(Code)(Java Doc)
public void setDefaultWebPage(String file)(Code)(Java Doc)
public void setErrWriter(PrintWriter pw)(Code)(Java Doc)
public void setLogWriter(PrintWriter pw)(Code)(Java Doc)
public void setNoSystemExit(boolean noExit)(Code)(Java Doc)
public void setPort(int port) throws RuntimeException(Code)(Java Doc)
public void setProperties(HsqlProperties p)(Code)(Java Doc)
public void setRestartOnShutdown(boolean restart)(Code)(Java Doc)
protected void setServerError(Throwable t)(Code)(Java Doc)
public void setSilent(boolean silent)(Code)(Java Doc)
protected synchronized void setState(int state)(Code)(Java Doc)
public void setTls(boolean tls)(Code)(Java Doc)
public void setTrace(boolean trace)(Code)(Java Doc)
public void setWebRoot(String root)(Code)(Java Doc)
public void shutdown()(Code)(Java Doc)
protected synchronized void shutdown(boolean error)(Code)(Java Doc)
public synchronized void signalCloseAllServerConnections()(Code)(Java Doc)
public int start()(Code)(Java Doc)
public int stop()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.