public class TcpServer extends Object implements Service
| 构造器和说明 |
|---|
TcpServer() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
checkKeyAndGetDatabaseName(String db)
If no key is set, return the original database name.
|
boolean |
getAllowOthers()
Check if remote connections are allowed.
|
static String |
getManagementDbName(int port)
Get the database name of the management database.
|
String |
getName()
Get the human readable name of the service.
|
int |
getPort()
Gets the port this service is listening on.
|
String |
getType()
Get the human readable short name of the service.
|
String |
getURL()
Get the URL of this service in a human readable form
|
void |
init(String... args)
Initialize the service from command line options.
|
boolean |
isDaemon()
Check if a daemon thread should be used.
|
boolean |
isRunning(boolean traceError)
Check if the service is running.
|
void |
listen()
Listen for incoming connections.
|
void |
setShutdownHandler(ShutdownHandler shutdownHandler) |
static void |
shutdown(String url,
String password,
boolean force,
boolean all)
Stop the TCP server with the given URL.
|
void |
start()
Start the service.
|
void |
stop()
Stop the service.
|
static void |
stopServer(int port,
String password,
int shutdownMode)
Stop a running server.
|
public static String getManagementDbName(int port)
port - the TCP server portpublic void setShutdownHandler(ShutdownHandler shutdownHandler)
public void init(String... args)
Servicepublic String getURL()
Servicepublic int getPort()
Servicepublic void start()
throws SQLException
Servicestart 在接口中 ServiceSQLExceptionpublic void listen()
Servicepublic boolean isRunning(boolean traceError)
Servicepublic static void stopServer(int port,
String password,
int shutdownMode)
port - the port where the server runs, or 0 for all running serverspassword - the password (or null)shutdownMode - the shutdown mode, SHUTDOWN_NORMAL or SHUTDOWN_FORCE.public boolean getAllowOthers()
ServicegetAllowOthers 在接口中 Servicepublic static void shutdown(String url, String password, boolean force, boolean all) throws SQLException
url - the database URLpassword - the passwordforce - if the server should be stopped immediatelyall - whether all TCP servers that are running in the JVM should be
stoppedSQLExceptionpublic String checkKeyAndGetDatabaseName(String db)
db - the key to test (or database name if no key is used)DbException - if a key is set but doesn't matchCopyright © 2017. All rights reserved.