public class Server extends Object implements ServerInterface
Constructor and Description |
---|
Server(Configurator configurator)
Creates an
instance configured
by the provided Configurator . |
Server(Properties props)
Creates an
instance configured
according to the provided properties object. |
Modifier and Type | Method and Description |
---|---|
ProtocolConnection |
getLocalConnection()
Returns local connection to the primary API provider.
|
static void |
main(String[] args)
Program entry point; runs the server using the configuration
specified in the properties file provided as a command-line
argument.
|
void |
run()
Runs the server.
|
void |
stop()
Stops the server.
|
boolean |
waitForShutdown(long timeoutMillis)
Wait for the server shutdown to complete.
|
public Server(Properties props) throws Exception
ApiProvider
instance configured
according to the provided properties object.props
- properties objectException
public Server(Configurator configurator)
ApiProvider
instance configured
by the provided Configurator
.configurator
- configurator instancepublic void stop()
stop
in interface ServerInterface
public boolean waitForShutdown(long timeoutMillis) throws InterruptedException
true
immediately.waitForShutdown
in interface ServerInterface
timeoutMillis
- maximum time to wait for the shutdown to
complete (in milliseconds)InterruptedException
- the wait has been interruptedpublic void run()
run
in interface ServerInterface
run
in interface Runnable
public ProtocolConnection getLocalConnection()
getLocalConnection
in interface ServerInterface
public static void main(String[] args) throws Exception
args
- program arguments; should contain a single entry
specifying the path to the properties file for the
server instance.Exception
- problem with the starting the serverCopyright © 2015. All Rights Reserved.