Package org.basex
Class BaseXServer
java.lang.Object
org.basex.util.Main
org.basex.core.CLI
org.basex.BaseXServer
- All Implemented Interfaces:
Runnable
This is the starter class for running the database server. It handles
concurrent requests from multiple users.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen, Andreas Weiler
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBaseXServer(String... args) Constructor.BaseXServer(Context ctx, String... args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionheader()Returns a header string for command-line information.static voidMain method, launching the server process.protected voidParses the command-line arguments, specified by the user.static booleanChecks if a server is running.voidremove(ClientListener client) Removes a client listener that is waiting for authentication.voidrun()static voidStarts the database server in a separate process.voidstop()Stops the server.static voidStops the server.usage()Returns a usage string for command-line information.
-
Constructor Details
-
BaseXServer
Constructor.- Parameters:
args- command-line arguments- Throws:
IOException- I/O exception
-
BaseXServer
Constructor.- Parameters:
ctx- database contextargs- command-line arguments- Throws:
IOException- I/O exception
-
-
Method Details
-
main
Main method, launching the server process. Command-line arguments are listed with the-hargument.- Parameters:
args- command-line arguments
-
run
public void run() -
stop
Stops the server.- Throws:
IOException- I/O exception
-
parseArgs
Description copied from class:MainParses the command-line arguments, specified by the user.- Specified by:
parseArgsin classMain- Throws:
IOException- I/O exception
-
header
Description copied from class:MainReturns a header string for command-line information. -
usage
Description copied from class:MainReturns a usage string for command-line information. -
start
Starts the database server in a separate process.- Parameters:
port- server portargs- command-line arguments- Throws:
BaseXException- database exception
-
ping
Checks if a server is running.- Parameters:
host- hostport- server port- Returns:
- boolean success
-
stop
Stops the server.- Parameters:
host- server hostport- server port- Throws:
IOException- I/O exception
-
remove
Removes a client listener that is waiting for authentication.- Parameters:
client- client to be removed
-