KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > examples > tools > config > ConfigurationShutdown


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.examples.tools.config;
10
11 import java.net.Socket JavaDoc;
12
13 /**
14  * This class invokes the shutdown section of the XML configuration file bundled
15  * with this example. <br />
16  * Refer to the ConfigurationLoader documentation for further information.
17  *
18  * @version $Revision: 1.3 $
19  * @see ConfigurationStartup
20  */

21 public class ConfigurationShutdown
22 {
23    public static void main(String JavaDoc[] args) throws Exception JavaDoc
24    {
25       String JavaDoc shutdownCommand = "shutdown";
26       Socket JavaDoc socket = new Socket JavaDoc("127.0.0.1", 9876);
27       socket.getOutputStream().write(shutdownCommand.getBytes());
28       socket.close();
29    }
30 }
31
Popular Tags