summaryrefslogtreecommitdiff
path: root/java/demo/book/map_filesystem/Server.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2010-01-05 20:17:33 -0800
committerMark Spruiell <mes@zeroc.com>2010-01-05 20:17:33 -0800
commitcf24e681e8c52cd20d81fe750ff258e67ee65734 (patch)
tree8411820ce3a257272d6ffa0d3dcdab9ce106609a /java/demo/book/map_filesystem/Server.java
parentFixed bug 4576 - add NPTL options only on Rhel4 (diff)
downloadice-cf24e681e8c52cd20d81fe750ff258e67ee65734.tar.bz2
ice-cf24e681e8c52cd20d81fe750ff258e67ee65734.tar.xz
ice-cf24e681e8c52cd20d81fe750ff258e67ee65734.zip
bug 4495 - clean up book demos
Diffstat (limited to 'java/demo/book/map_filesystem/Server.java')
-rw-r--r--java/demo/book/map_filesystem/Server.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/java/demo/book/map_filesystem/Server.java b/java/demo/book/map_filesystem/Server.java
index da9ce6e8617..e7851806949 100644
--- a/java/demo/book/map_filesystem/Server.java
+++ b/java/demo/book/map_filesystem/Server.java
@@ -21,6 +21,7 @@ public class Server extends Ice.Application
public int
run(String[] args)
{
+ //
// Create an object adapter
//
Ice.ObjectAdapter adapter = communicator().createObjectAdapter("MapFilesystem");
@@ -28,35 +29,40 @@ public class Server extends Ice.Application
Freeze.Connection connection = null;
try
{
+ //
// Open a connection to the files and directories
// database. This should remain open for the duration of the
// application for performance reasons.
//
connection = Freeze.Util.createConnection(communicator(), _envName);
- IdentityFileEntryMap fileDB = new IdentityFileEntryMap(connection, FileI.filesDB(), true);
+ IdentityFileEntryMap fileDB = new IdentityFileEntryMap(connection, FileI.filesDB(), true);
IdentityDirectoryEntryMap dirDB = new IdentityDirectoryEntryMap(
- connection, DirectoryI.directoriesDB(), true);
-
+ connection, DirectoryI.directoriesDB(), true);
+
+ //
// Add default servants for the file and directory.
//
adapter.addDefaultServant(new FileI(communicator(), _envName), "file");
adapter.addDefaultServant(new DirectoryI(communicator(), _envName), "");
-
+
+ //
// Ready to accept requests now
//
adapter.activate();
-
+
+ //
// Wait until we are done
//
communicator().waitForShutdown();
}
finally
{
+ //
// Close the connection gracefully.
//
connection.close();
}
-
+
return 0;
}