Top Description Methods
org.h2.server

public Interface Service

Known Direct Implementers
org.h2.server.TcpServer, org.h2.server.pg.PgServer, org.h2.server.web.WebServer
Imports
java.sql.SQLException

Classes implementing this interface usually provide a TCP/IP listener such as an FTP server. The can be started and stopped, and may or may not allow remote connections.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if remote connections are allowed
getAllowOthers
()

Check if remote connections are allowed.

public String

Returns:

the name
getName
()

Get the human readable name of the service.

public int

Returns:

the port
getPort
()

Gets the port this service is listening on.

public String

Returns:

the type
getType
()

Get the human readable short name of the service.

public String

Returns:

the url
getURL
()

Get the URL of this service in a human readable form

public void
init(String...
the command line options
args
)

Initialize the service from command line options.

public boolean

Returns:

true if a daemon thread should be used
isDaemon
()

Check if a daemon thread should be used.

public boolean

Returns:

if the server is running
isRunning
(boolean
if errors should be written
traceError
)

Check if the service is running.

public void
listen()

Listen for incoming connections.

public void
start()

Start the service.

public void
stop()

Stop the service.

Method Detail

getAllowOthersback to summary
public boolean getAllowOthers()

Check if remote connections are allowed.

Returns:boolean

true if remote connections are allowed

getNameback to summary
public String getName()

Get the human readable name of the service.

Returns:String

the name

getPortback to summary
public int getPort()

Gets the port this service is listening on.

Returns:int

the port

getTypeback to summary
public String getType()

Get the human readable short name of the service.

Returns:String

the type

getURLback to summary
public String getURL()

Get the URL of this service in a human readable form

Returns:String

the url

initback to summary
public void init(String... args) throws Exception

Initialize the service from command line options.

Parameters
args:String[]

the command line options

Exceptions
Exception:
on failure
isDaemonback to summary
public boolean isDaemon()

Check if a daemon thread should be used.

Returns:boolean

true if a daemon thread should be used

isRunningback to summary
public boolean isRunning(boolean traceError)

Check if the service is running.

Parameters
traceError:boolean

if errors should be written

Returns:boolean

if the server is running

listenback to summary
public void listen()

Listen for incoming connections. This method blocks.

startback to summary
public void start() throws SQLException

Start the service. This usually means create the server socket. This method must not block.

Exceptions
SQLException:
on failure
stopback to summary
public void stop()

Stop the service.