Shutting down by using the API

You can use the NetworkServerControl API to shut down the Network Server from within a Java application.

The name of the method that you use to shut down the Network Server is shutdown().

For example, the following command shuts down the Network Server running on the current machine using the default port number (1527):

NetworkServerControl server = new NetworkServerControl();
server.shutdown();

To shut down a server running with user authentication, you need to use a NetworkServerControl instance created with user credentials:

NetworkServerControl server = new NetworkServerControl(username, password);
server.shutdown();
Related tasks
Shutting down by using the command line