Java Doc for Server.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

All known Subclasses:   org.hsqldb.WebServer,
Server
public class Server implements HsqlSocketRequestHandler(Code)
The HSQLDB HSQL protocol network database server.

A Server object acts as a network database server and is one way of using the client-server mode of HSQLDB Database Engine. Instances of this class handle native HSQL protocol connections exclusively, allowing database queries to be performed efficienly across the network. Server's direct descendent, WebServer, handles HTTP protocol connections exclusively, allowing HSQL protocol to be tunneled over HTTP to avoid sandbox and firewall issues, albeit less efficiently.

There are a number of ways to configure and start a Server instance.

When started from the command line or programatically via the main(String[]) method, configuration occurs in three phases, with later phases overriding properties set by previous phases:

  1. Upon construction, a Server object is assigned a set of default properties.

  2. If it exists, properties are loaded from a file named 'server.properties' in the present working directory.

  3. The command line arguments (alternatively, the String[] passed to main()) are parsed and used to further configure the Server's properties.

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      | 9001/544 | 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  |
 | -tls           | true|false  | false    | TLS/SSL (secure) sockets     |
 | -no_system_exit| true|false  | false    | do not issue System.exit()   |
 | -remote_open   | true|false  | false    | can open databases remotely  |
 +----------------+-------------+----------+------------------------------+
 
The database.i and dbname.i options need further explanation:
  • Multiple databases can be served by each instance of the Server. The value of i is currently limited to the range 0..9, allowing up to 10 different databases. Any number is this range can be used.

  • The value assigned to database.i is interpreted using the format '[type]spec', where the optional type component is one of 'file:', 'res:' or 'mem:' and the spec component is interpreted in the context of the type component.

    If omitted, the type component is taken to be 'file:'.

    A full description of how '[type]spec' values are interpreted appears in the overview for org.hsqldb.jdbc.jdbcConnection jdbcConnection .

  • The value assigned to dbname.i is taken to be the key used to look up the desired database instance and thus corresponds to the <alias> component of the HSQLDB HSQL protocol database connection url: 'jdbc:hsqldb:hsql[s]://host[port][/<alias>]'.

  • The value of database.0 is special. If dbname.0 is not specified, then this defaults to an empty string and a connection is made to database.0 path when the <alias> component of an HSQLDB HSQL protocol database connection url is omitted. If a database key/value pair is found in the properties when the main method is called, this pair is supersedes the database.0 setting

    This behaviour allows the previous database connection url format to work with essentially unchanged semantics.

  • When the remote_open property is true, a connection attempt to an unopened database results in the database being opened. The URL for connection should include the property filepath to specify the path. 'jdbc:hsqldb:hsql[s]://host[port]/<alias>;filepath=hsqldb:file:<database path>'. the given alias and filepath value will be associated together. The database user and password to start this connection must be valid. If this form of connection is used again, after the database has been opened, the filepath property is ignored.

  • Once an alias such as "mydb" has been associated with a path, it cannot be reassigned to a different path.

  • If a database is closed with the SHUTDOWN command, its alias is removed. It is then possible to connect to this database again with a different (or the same) alias.

  • If the same database is connected to via two different aliases, and then one of the is closed with the SHUTDOWN command, the other is also closed.

From the 'server.properties' file, options can be set similarly, using a slightly different format.

Here is an example 'server.properties' file:

 server.port=9001
 server.database.0=test
 server.dbname.0=...
 ...
 server.database.n=...
 server.dbname.n=...
 server.silent=true
 
Starting with 1.7.2, Server has been refactored to become a simple JavaBean with non-blocking start() and stop() service methods. It is possible to configure a Server instance through the JavaBean API as well, but this part of the public interface is still under review and will not be finalized or documented fully until the final 1.7.2 release.

Note:

The 'no_system_exit' property is of particular interest.

If a Server instance is to run embedded in, say, an application server, such as when the jdbcDataSource or HsqlServerFactory classes are used, it is typically necessary to avoid calling System.exit() when the Server instance shuts down.

By default, 'no_system_exit' is set:

  1. true when a Server is started directly from the start() method.

  2. false when a Server is started from the main(String[]) method.

These values are natural to their context because the first case allows the JVM to exit by default on Server shutdown when a Server instance is started from a command line environment, whereas the second case prevents a typically unwanted JVM exit on Server shutdown when a Server intance is started as part of a larger framework.

Replaces original Hypersonic source of the same name.
author:
   fredt@users
version:
   1.8.0
since:
   1.7.2



Field Summary
final protected static  intserverBundleHandle
    
 HashSetserverConnSet
    
protected  ThreadGroupserverConnectionThreadGroup
    
protected  StringserverId
    
 HsqlPropertiesserverProperties
    
protected  intserverProtocol
    
protected  ServerSocketsocket
    
protected  HsqlSocketFactorysocketFactory
    

Constructor Summary
public  Server()
     Creates a new Server instance handling HSQL protocol connections.
protected  Server(int protocol)
     Creates a new Server instance handling the specified connection protocol.

Method Summary
protected  booleanallowConnection(Socket socket)
     Retrieves whether the specified socket should be allowed to make a connection.
public  voidcheckRunning(boolean running)
     Checks if this Server object is or is not running and throws if the current state does not match the specified value.
protected  voidfinalize()
    
public  StringgetAddress()
     Retrieves, in string form, this server's host address.
final synchronized  intgetDBID(String aliasPath)
    
public  StringgetDatabaseName(int index, boolean asconfigured)
     Retrieves the url alias (network name) of the i'th database that this Server hosts.
public  StringgetDatabasePath(int index, boolean asconfigured)
     Retrieves the HSQLDB path descriptor (uri) of the i'th Database that this Server hosts.
public  StringgetDatabaseType(int index)
    
public  StringgetDefaultWebPage()
     Retrieves the name of the web page served when no page is specified.
public  PrintWritergetErrWriter()
     Retrieves the PrintWriter to which server errors are printed.
final  intgetFirstEmptyDatabaseIndex()
    
public  StringgetHelpString()
     Retrieves a String object describing the command line and properties options for this Server.
public  PrintWritergetLogWriter()
     Retrieves the PrintWriter to which server messages are printed.
public  intgetPort()
     Retrieves this server's host port.
public  StringgetProductName()
     Retrieves this server's product name.
public  StringgetProductVersion()
     Retrieves the server's product version, as a String.
public  StringgetProtocol()
     Retrieves a string respresentaion of the network protocol this server offers, typically one of 'HTTP', HTTPS', 'HSQL' or 'HSQLS'.
public  ThrowablegetServerError()
     Retrieves a Throwable indicating the last server error, if any.
public  StringgetServerId()
     Retrieves a String identifying this Server object.
public synchronized  intgetState()
     Retrieves current state of this server in numerically coded form.
public  StringgetStateDescriptor()
     Retrieves a character sequence describing this server's current state, including the message of the last exception, if there is one and it is still in context.
public  StringgetWebRoot()
     Retrieves the root context (directory) from which web content is served.
public  voidhandleConnection(Socket s)
     Assigns the specified socket to a new conection handler and starts the handler in a new Thread.
protected  voidinit(int protocol)
     Initializes this server, setting the accepted connection protocol.
public  booleanisNoSystemExit()
     Retrieves whether this server calls System.exit() when shutdown.
public  booleanisRestartOnShutdown()
     Retrieves whether this server restarts on shutdown.
public  booleanisSilent()
     Retrieves whether silent mode operation was requested in the server properties.
public  booleanisTls()
     Retrieves whether the use of secure sockets was requested in the server properties.
public  booleanisTrace()
     Retrieves whether JDBC trace messages are to go to System.out or the DriverManger PrintStream/PrintWriter, if any.
public static  voidmain(String[] args)
     Creates and starts a new Server.
final  voidnotify(int action, int id)
     This is called from org.hsqldb.DatabaseManager when a database is shutdown.
final  intopenDatabase(String alias, String filepath)
    
final  booleanopenDatabases()
     Opens this server's database instances.
protected synchronized  voidprint(String msg)
     Prints the specified message, s, formatted to identify that the print operation is against this server instance.
protected synchronized  voidprintError(String msg)
     Prints an error message to this Server object's errWriter.
protected static  voidprintHelp(String key)
     Prints message for the specified key, without any special formatting.
protected  voidprintProperties()
     Prints a description of the server properties iff !isSilent().
final  voidprintRequest(int cid, Result r)
     Prints a description of the request encapsulated by the Result argument, r. Printing occurs iff isSilent() is false.
final  voidprintResource(String key)
     Prints value from server's resource bundle, formatted to identify that the print operation is against this server instance.
protected synchronized  voidprintStackTrace(Throwable t)
     Prints the stack trace of the Throwable, t, to this Server object's errWriter.
protected  voidprintWithThread(String msg)
     Prints a message formatted similarly to print(String), additionally identifying the current (calling) thread.
final  voidprintWithTimestamp(String msg)
     Prints the specified message, s, prepended with a timestamp representing the current date and time, formatted to identify that the print operation is against this server instance.
public  booleanputPropertiesFromFile(String path)
     Attempts to put properties from the file with the specified path.
public  voidputPropertiesFromString(String s)
     Puts properties from the supplied string argument.
final synchronized  voidreleaseDatabase(int id)
     This releases the resources used for a database.
public  voidsetAddress(String address)
     Sets the InetAddress with which this server's ServerSocket will be constructed.
public  voidsetDatabaseName(int index, String name)
     Sets the external name (url alias) of the i'th hosted database.
public  voidsetDatabasePath(int index, String path)
     Sets the path of the hosted database.
public  voidsetDefaultWebPage(String file)
     Sets the name of the web page served when no page is specified.
public  voidsetErrWriter(PrintWriter pw)
     Sets the PrintWriter to which server errors are logged.
public  voidsetLogWriter(PrintWriter pw)
     Sets the PrintWriter to which server messages are logged.
public  voidsetNoSystemExit(boolean noExit)
     Sets whether this server calls System.exit() when shutdown.
public  voidsetPort(int port)
     Sets the server listen port.
public  voidsetProperties(HsqlProperties p)
    
public  voidsetRestartOnShutdown(boolean restart)
     Sets whether this server restarts on shutdown.
protected  voidsetServerError(Throwable t)
     Sets this Server's last encountered error state.
public  voidsetSilent(boolean silent)
    
protected synchronized  voidsetState(int state)
     Sets the server state value.
public  voidsetTls(boolean tls)
    
public  voidsetTrace(boolean trace)
     Sets whether trace messages go to System.out or the DriverManger PrintStream/PrintWriter, if any.
public  voidsetWebRoot(String root)
     Sets the path of the root directory from which web content is served.
public  voidshutdown()
     External method to shut down this server.
protected synchronized  voidshutdown(boolean error)
     Shuts down this server.
public synchronized  voidsignalCloseAllServerConnections()
     Closes all connections to this Server.
public  intstart()
     Starts this server synchronously.
public  intstop()
     Stops this server asynchronously.

Field Detail
serverBundleHandle
final protected static int serverBundleHandle(Code)



serverConnSet
HashSet serverConnSet(Code)



serverConnectionThreadGroup
protected ThreadGroup serverConnectionThreadGroup(Code)



serverId
protected String serverId(Code)



serverProperties
HsqlProperties serverProperties(Code)



serverProtocol
protected int serverProtocol(Code)



socket
protected ServerSocket socket(Code)



socketFactory
protected HsqlSocketFactory socketFactory(Code)




Constructor Detail
Server
public Server()(Code)
Creates a new Server instance handling HSQL protocol connections.



Server
protected Server(int protocol)(Code)
Creates a new Server instance handling the specified connection protocol.

For example, the no-args WebServer constructor invokes this constructor with ServerConstants.SC_PROTOCOL_HTTP, while the Server() no args contructor invokes this constructor with ServerConstants.SC_PROTOCOL_HSQL.


Parameters:
  protocol - the ServerConstants code indicating whichconnection protocol to handle





Method Detail
allowConnection
protected boolean allowConnection(Socket socket)(Code)
Retrieves whether the specified socket should be allowed to make a connection. By default, this method always returns true, but it can be overidden to implement hosts allow-deny functionality.
Parameters:
  socket - the socket to test.



checkRunning
public void checkRunning(boolean running) throws RuntimeException(Code)
Checks if this Server object is or is not running and throws if the current state does not match the specified value.
Parameters:
  running - if true, ensure the server is running, else ensure theserver is not running
throws:
  RuntimeException - if the supplied value does not match thecurrent running status



finalize
protected void finalize() throws Throwable(Code)



getAddress
public String getAddress()(Code)
Retrieves, in string form, this server's host address. this server's host address



getDBID
final synchronized int getDBID(String aliasPath) throws HsqlException(Code)
return database ID



getDatabaseName
public String getDatabaseName(int index, boolean asconfigured)(Code)
Retrieves the url alias (network name) of the i'th database that this Server hosts.
Parameters:
  index - the index of the url alias upon which to report
Parameters:
  asconfigured - if true, report the configured value, elsethe live value the url alias component of the i'th databasethat this Server hosts, or null if no such name exists.



getDatabasePath
public String getDatabasePath(int index, boolean asconfigured)(Code)
Retrieves the HSQLDB path descriptor (uri) of the i'th Database that this Server hosts.
Parameters:
  index - the index of the uri upon which to report
Parameters:
  asconfigured - if true, report the configured value, elsethe live value the HSQLDB database path descriptor of the i'th databasethat this Server hosts, or null if no such path descriptorexists



getDatabaseType
public String getDatabaseType(int index)(Code)



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



getErrWriter
public PrintWriter getErrWriter()(Code)
Retrieves the PrintWriter to which server errors are printed. the PrintWriter to which server errors are printed.



getFirstEmptyDatabaseIndex
final int getFirstEmptyDatabaseIndex()(Code)



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



getLogWriter
public PrintWriter getLogWriter()(Code)
Retrieves the PrintWriter to which server messages are printed. the PrintWriter to which server messages are printed.



getPort
public int getPort()(Code)
Retrieves this server's host port. this server's host port



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




getProductVersion
public String getProductVersion()(Code)
Retrieves the server's product version, as a String.

Typically, this will be something like: "1.x.x" or "2.x.x" and so on. the product version of the 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



getServerError
public Throwable getServerError()(Code)
Retrieves a Throwable indicating the last server error, if any.

a Throwable indicating the last server error




getServerId
public String getServerId()(Code)
Retrieves a String identifying this Server object. a String identifying this Server object



getState
public synchronized int getState()(Code)
Retrieves current state of this server in numerically coded form.

Typically, this will be one of:

  1. ServerProperties.SERVER_STATE_ONLINE (1)
  2. ServerProperties.SERVER_STATE_OPENING (4)
  3. ServerProperties.SERVER_STATE_CLOSING (8)
  4. ServerProperties.SERVER_STATE_SHUTDOWN (16)
this server's state code.



getStateDescriptor
public String getStateDescriptor()(Code)
Retrieves a character sequence describing this server's current state, including the message of the last exception, if there is one and it is still in context. this server's state represented as a character sequence.



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



handleConnection
public void handleConnection(Socket s)(Code)
Assigns the specified socket to a new conection handler and starts the handler in a new Thread.
Parameters:
  s - the socket to connect



init
protected void init(int protocol)(Code)
Initializes this server, setting the accepted connection protocol.
Parameters:
  protocol - typically either SC_PROTOCOL_HTTP or SC_PROTOCOL_HSQL



isNoSystemExit
public boolean isNoSystemExit()(Code)
Retrieves whether this server calls System.exit() when shutdown. true if this server does not call System.exit()



isRestartOnShutdown
public boolean isRestartOnShutdown()(Code)
Retrieves whether this server restarts on shutdown. true this server restarts on shutdown



isSilent
public boolean isSilent()(Code)
Retrieves whether silent mode operation was requested in the server properties. if true, silent mode was requested, else trace messagesare to be printed



isTls
public boolean isTls()(Code)
Retrieves whether the use of secure sockets was requested in the server properties. if true, secure sockets are requested, else not



isTrace
public boolean isTrace()(Code)
Retrieves whether JDBC trace messages are to go to System.out or the DriverManger PrintStream/PrintWriter, if any. true if tracing is on (JDBC trace messages to system out)



main
public static void main(String[] args)(Code)
Creates and starts a new Server.

Allows starting a Server via the command line interface.


Parameters:
  args - the command line arguments for the Server instance




notify
final void notify(int action, int id)(Code)
This is called from org.hsqldb.DatabaseManager when a database is shutdown. This shuts the server down if it is the last database
Parameters:
  action - a code indicating what has happend



openDatabase
final int openDatabase(String alias, String filepath) throws HsqlException(Code)
Open and return database ID



openDatabases
final boolean openDatabases()(Code)
Opens this server's database instances. This method returns true If at least one database goes online, otherwise it returns false. If openning any of the databases is attempted and an exception is thrown, the server error is set to this exception.
throws:
  HsqlException - if a database access error occurs



print
protected synchronized void print(String msg)(Code)
Prints the specified message, s, formatted to identify that the print operation is against this server instance.
Parameters:
  msg - The message to print



printError
protected synchronized void printError(String msg)(Code)
Prints an error message to this Server object's errWriter. The message is formatted similarly to print(String), additionally identifying the current (calling) thread.
Parameters:
  msg - the message to print



printHelp
protected static void printHelp(String key)(Code)
Prints message for the specified key, without any special formatting. The message content comes from the server resource bundle and thus may localized according to the default JVM locale.

Uses System.out directly instead of Trace.printSystemOut() so it always prints, regardless of Trace settings.
Parameters:
  key - for message




printProperties
protected void printProperties()(Code)
Prints a description of the server properties iff !isSilent().



printRequest
final void printRequest(int cid, Result r)(Code)
Prints a description of the request encapsulated by the Result argument, r. Printing occurs iff isSilent() is false.

The message is formatted similarly to print(String), additionally indicating the connection identifier.

For Server instances, cid is typically the value assigned to each ServerConnection object that is unique amongst all such identifiers in each distinct JVM session / class loader context.

For WebServer instances, a single logical connection actually spawns a new physical WebServerConnection object for each request, so the cid is typically the underlying session id, since that does not change for the duration of the logical connection.
Parameters:
  cid - the connection identifier
Parameters:
  r - the request whose description is to be printed




printResource
final void printResource(String key)(Code)
Prints value from server's resource bundle, formatted to identify that the print operation is against this server instance. Value may be localized according to the default JVM locale
Parameters:
  key - the resource key



printStackTrace
protected synchronized void printStackTrace(Throwable t)(Code)
Prints the stack trace of the Throwable, t, to this Server object's errWriter.


Parameters:
  t - the Throwable whose stack trace is to be printed




printWithThread
protected void printWithThread(String msg)(Code)
Prints a message formatted similarly to print(String), additionally identifying the current (calling) thread. Replaces old method trace(String msg).
Parameters:
  msg - the message to print



printWithTimestamp
final void printWithTimestamp(String msg)(Code)
Prints the specified message, s, prepended with a timestamp representing the current date and time, formatted to identify that the print operation is against this server instance.
Parameters:
  msg - the message to print



putPropertiesFromFile
public boolean putPropertiesFromFile(String path)(Code)
Attempts to put properties from the file with the specified path. The file extension '.properties' is implicit and should not be included in the path specification.
Parameters:
  path - the path of the desired properties file, without the'.properties' file extension
throws:
  RuntimeException - if this server is running true if the indicated file was read sucessfully, else false



putPropertiesFromString
public void putPropertiesFromString(String s)(Code)
Puts properties from the supplied string argument. The relevant key value pairs are the same as those for the (web)server.properties file format, except that the 'server.' prefix should not be specified.
Parameters:
  s - semicolon-delimited key=value pair string,e.g. k1=v1;k2=v2;k3=v3...
throws:
  RuntimeException - if this server is running



releaseDatabase
final synchronized void releaseDatabase(int id)(Code)
This releases the resources used for a database. Is called with id 0 multiple times for non-existent databases



setAddress
public void setAddress(String address) throws RuntimeException(Code)
Sets the InetAddress with which this server's ServerSocket will be constructed. A null or empty string or the special value "0.0.0.0" can be used to bypass explicit selection, causing the ServerSocket to be constructed without specifying an InetAddress.
Parameters:
  address - A string representing the desired InetAddress as wouldbe retrieved by InetAddres.getByName(), or a null or empty stringor "0.0.0.0" to signify that the server socket should be constructedusing the signature that does not specify the InetAddress.
throws:
  RuntimeException - if this server is running



setDatabaseName
public void setDatabaseName(int index, String name) throws RuntimeException(Code)
Sets the external name (url alias) of the i'th hosted database.
Parameters:
  name - external name (url alias) of the i'th HSQLDB databaseinstance this server is to host.
throws:
  RuntimeException - if this server is running



setDatabasePath
public void setDatabasePath(int index, String path) throws RuntimeException(Code)
Sets the path of the hosted database.
Parameters:
  path - The path of the i'th HSQLDB database instance this serveris to host.



setDefaultWebPage
public void setDefaultWebPage(String file)(Code)
Sets the name of the web page served when no page is specified.
Parameters:
  file - the name of the web page served when no page is specified



setErrWriter
public void setErrWriter(PrintWriter pw)(Code)
Sets the PrintWriter to which server errors are logged.

Setting this attribute to null disables server error logging
Parameters:
  pw - the PrintWriter to which server messages are logged




setLogWriter
public void setLogWriter(PrintWriter pw)(Code)
Sets the PrintWriter to which server messages are logged.

Setting this attribute to null disables server message logging
Parameters:
  pw - the PrintWriter to which server messages are logged




setNoSystemExit
public void setNoSystemExit(boolean noExit)(Code)
Sets whether this server calls System.exit() when shutdown.
Parameters:
  noExit - if true, System.exit() will not be called.



setPort
public void setPort(int port) throws RuntimeException(Code)
Sets the server listen port.
Parameters:
  port - the port at which this server listens



setProperties
public void setProperties(HsqlProperties p)(Code)
Sets server properties using the specified properties object
Parameters:
  p - The object containing properties to set



setRestartOnShutdown
public void setRestartOnShutdown(boolean restart)(Code)
Sets whether this server restarts on shutdown.
Parameters:
  restart - if true, this server restarts on shutdown



setServerError
protected void setServerError(Throwable t)(Code)
Sets this Server's last encountered error state.
Parameters:
  t - The new value for the server error



setSilent
public void setSilent(boolean silent)(Code)
Sets silent mode operation
Parameters:
  silent - if true, then silent mode, else trace messagesare to be printed



setState
protected synchronized void setState(int state)(Code)
Sets the server state value.
Parameters:
  state - the new value



setTls
public void setTls(boolean tls)(Code)
Sets whether to use secure sockets
Parameters:
  tls - true for secure sockets, else false
throws:
  RuntimeException - if this server is running



setTrace
public void setTrace(boolean trace)(Code)
Sets whether trace messages go to System.out or the DriverManger PrintStream/PrintWriter, if any.
Parameters:
  trace - if true, route JDBC trace messages to System.out



setWebRoot
public void setWebRoot(String root)(Code)
Sets the path of the root directory from which web content is served.
Parameters:
  root - the root (context) directory from which web contentis served



shutdown
public void shutdown()(Code)
External method to shut down this server.



shutdown
protected synchronized void shutdown(boolean error)(Code)
Shuts down this server.
Parameters:
  error - true if shutdown is in response to an errorstate, else false



signalCloseAllServerConnections
public synchronized void signalCloseAllServerConnections()(Code)
Closes all connections to this Server.



start
public int start()(Code)
Starts this server synchronously.

This method waits for current state to change from SERVER_STATE_OPENNING. In order to discover the success or failure of this operation, server state must be polled or a subclass of Server must be used that overrides the setState method to provide state change notification. the server state noted at entry to this method




stop
public int stop()(Code)
Stops this server asynchronously.

This method returns immediately, regardless of current state. In order to discover the success or failure of this operation, server state must be polled or a subclass of Server must be used that overrides the setState method to provide state change notification. the server state noted at entry to this method




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.