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 objectExceptionpublic Server(Configurator configurator)
ApiProvider instance configured
by the provided Configurator.configurator - configurator instancepublic void stop()
stop in interface ServerInterfacepublic boolean waitForShutdown(long timeoutMillis)
throws InterruptedException
true immediately.waitForShutdown in interface ServerInterfacetimeoutMillis - maximum time to wait for the shutdown to
complete (in milliseconds)InterruptedException - the wait has been interruptedpublic void run()
run in interface ServerInterfacerun in interface Runnablepublic ProtocolConnection getLocalConnection()
getLocalConnection in interface ServerInterfacepublic static void main(String[] args) throws Exception
args - program arguments; should contain a single entry
specifying the path to the properties file or Spring
XML config file for the server instance.Exception - problem with the starting the serverCopyright © 2023. All rights reserved.