summaryrefslogtreecommitdiff
path: root/java/demo/book/simple_filesystem/Server.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/demo/book/simple_filesystem/Server.java')
-rwxr-xr-xjava/demo/book/simple_filesystem/Server.java96
1 files changed, 48 insertions, 48 deletions
diff --git a/java/demo/book/simple_filesystem/Server.java b/java/demo/book/simple_filesystem/Server.java
index ae847feec1e..bb94f350b31 100755
--- a/java/demo/book/simple_filesystem/Server.java
+++ b/java/demo/book/simple_filesystem/Server.java
@@ -14,68 +14,68 @@ public class Server extends Ice.Application {
run(String[] args)
{
// Terminate cleanly on receipt of a signal
- //
- shutdownOnInterrupt();
+ //
+ shutdownOnInterrupt();
- // Create an object adapter (stored in the _adapter
- // static members)
- //
- Ice.ObjectAdapter adapter = communicator().createObjectAdapterWithEndpoints(
- "SimpleFilesystem", "default -p 10000");
- DirectoryI._adapter = adapter;
- FileI._adapter = adapter;
+ // Create an object adapter (stored in the _adapter
+ // static members)
+ //
+ Ice.ObjectAdapter adapter = communicator().createObjectAdapterWithEndpoints(
+ "SimpleFilesystem", "default -p 10000");
+ DirectoryI._adapter = adapter;
+ FileI._adapter = adapter;
- // Create the root directory (with name "/" and no parent)
- //
- DirectoryI root = new DirectoryI("/", null);
+ // Create the root directory (with name "/" and no parent)
+ //
+ DirectoryI root = new DirectoryI("/", null);
- // Create a file called "README" in the root directory
- //
- File file = new FileI("README", root);
- String[] text;
- text = new String[]{ "This file system contains a collection of poetry." };
- try {
- file.write(text, null);
- } catch (GenericError e) {
- System.err.println(e.reason);
- }
+ // Create a file called "README" in the root directory
+ //
+ File file = new FileI("README", root);
+ String[] text;
+ text = new String[]{ "This file system contains a collection of poetry." };
+ try {
+ file.write(text, null);
+ } catch (GenericError e) {
+ System.err.println(e.reason);
+ }
- // Create a directory called "Coleridge" in the root directory
- //
- DirectoryI coleridge = new DirectoryI("Coleridge", root);
+ // Create a directory called "Coleridge" in the root directory
+ //
+ DirectoryI coleridge = new DirectoryI("Coleridge", root);
- // Create a file called "Kubla_Khan" in the Coleridge directory
- //
- file = new FileI("Kubla_Khan", coleridge);
- text = new String[]{ "In Xanadu did Kubla Khan",
- "A stately pleasure-dome decree:",
- "Where Alph, the sacred river, ran",
- "Through caverns measureless to man",
- "Down to a sunless sea." };
- try {
- file.write(text, null);
- } catch (GenericError e) {
- System.err.println(e.reason);
- }
+ // Create a file called "Kubla_Khan" in the Coleridge directory
+ //
+ file = new FileI("Kubla_Khan", coleridge);
+ text = new String[]{ "In Xanadu did Kubla Khan",
+ "A stately pleasure-dome decree:",
+ "Where Alph, the sacred river, ran",
+ "Through caverns measureless to man",
+ "Down to a sunless sea." };
+ try {
+ file.write(text, null);
+ } catch (GenericError e) {
+ System.err.println(e.reason);
+ }
- // All objects are created, allow client requests now
- //
- adapter.activate();
+ // All objects are created, allow client requests now
+ //
+ adapter.activate();
- // Wait until we are done
- //
- communicator().waitForShutdown();
+ // Wait until we are done
+ //
+ communicator().waitForShutdown();
- if (interrupted())
- System.err.println(appName() + ": terminating");
+ if (interrupted())
+ System.err.println(appName() + ": terminating");
- return 0;
+ return 0;
}
public static void
main(String[] args)
{
Server app = new Server();
- System.exit(app.main("Server", args));
+ System.exit(app.main("Server", args));
}
}