Package org.h2.server
Interface Service
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleangetAllowOthers()Check if remote connections are allowed.java.lang.StringgetName()Get the human readable name of the service.intgetPort()Gets the port this service is listening on.java.lang.StringgetType()Get the human readable short name of the service.java.lang.StringgetURL()Get the URL of this service in a human readable formvoidinit(java.lang.String... args)Initialize the service from command line options.booleanisDaemon()Check if a daemon thread should be used.booleanisRunning(boolean traceError)Check if the service is running.voidlisten()Listen for incoming connections.voidstart()Start the service.voidstop()Stop the service.
-
-
-
Method Detail
-
init
void init(java.lang.String... args) throws java.lang.Exception
Initialize the service from command line options.- Parameters:
args- the command line options- Throws:
java.lang.Exception- on failure
-
getURL
java.lang.String getURL()
Get the URL of this service in a human readable form- Returns:
- the url
-
start
void start() throws java.sql.SQLExceptionStart the service. This usually means create the server socket. This method must not block.- Throws:
java.sql.SQLException- on failure
-
listen
void listen()
Listen for incoming connections. This method blocks.
-
stop
void stop()
Stop the service.
-
isRunning
boolean isRunning(boolean traceError)
Check if the service is running.- Parameters:
traceError- if errors should be written- Returns:
- if the server is running
-
getAllowOthers
boolean getAllowOthers()
Check if remote connections are allowed.- Returns:
- true if remote connections are allowed
-
getName
java.lang.String getName()
Get the human readable name of the service.- Returns:
- the name
-
getType
java.lang.String getType()
Get the human readable short name of the service.- Returns:
- the type
-
getPort
int getPort()
Gets the port this service is listening on.- Returns:
- the port
-
isDaemon
boolean isDaemon()
Check if a daemon thread should be used.- Returns:
- true if a daemon thread should be used
-
-