Shutting down the .NET application is easy (simply close the application window), and the C++ application is even easier—it terminates automatically after each execution, so there is nothing you need to do.
However, shutting down all server-side components is a bit trickier, especially if you started multiple cache servers. At the very least you will need to shut down the web server, Extend proxy server, and database server.
What makes this even more complicated is that all these processes were started in the background using the Ant script, making them almost invisible. However, if you open Task Manager, you will see a number of java.exe
processes running:
So, in order to shut down everything on the server, you can kill java.exe
processes one by one in Task Manager.
However, there is an easier way, at least for all processes that are part of the Coherence cluster, which includes the web server, proxy server, and all cache servers you have started.
The Ant build file contains a stop-cluster
target, which will send an invocable agent (see Chapter 6, Parallel and In-Place Processing, if you don't remember what that is) that executes System.exit()
to all cluster members, effectively shutting them down gracefully.
> ant stop-cluster
However, before you run this task, make sure that your sample application cluster is fully isolated from any other clusters you might have on your network. Otherwise, there is a possibility that the stop-cluster
task might decide to send the shutdown agent to your production cluster as well! If you are not sure, be safe and kill the processes from the Task Manager instead.
The last thing you need to do is to shut down the database server as well. You can try to do so by running this Ant task:
> ant stop-db-server
However, my experience so far has been that this task rarely succeeds, so you might need to kill the last remaining java.exe
process using Task Manager (or if you have multiple java.exe
processes running even after you have shut down the cluster, look for one that uses approximately 30 MB of memory).