summaryrefslogtreecommitdiff
path: root/java/demo/Manual/map_filesystem/Server.java
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2015-03-18 12:58:16 -0230
committerMatthew Newhook <matthew@zeroc.com>2015-03-18 12:58:16 -0230
commit9b7668c7c92cf9cb311fe444cdddb489cd2a219d (patch)
tree5016567c58c81f5654e9d01935e199c6bf4761d2 /java/demo/Manual/map_filesystem/Server.java
parentVS add-in & build updates: (diff)
downloadice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.bz2
ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.xz
ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.zip
Removed demos.
Moved demoscript to distribution.
Diffstat (limited to 'java/demo/Manual/map_filesystem/Server.java')
-rw-r--r--java/demo/Manual/map_filesystem/Server.java80
1 files changed, 0 insertions, 80 deletions
diff --git a/java/demo/Manual/map_filesystem/Server.java b/java/demo/Manual/map_filesystem/Server.java
deleted file mode 100644
index b3793185e34..00000000000
--- a/java/demo/Manual/map_filesystem/Server.java
+++ /dev/null
@@ -1,80 +0,0 @@
-// **********************************************************************
-//
-// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
-//
-// This copy of Ice is licensed to you under the terms described in the
-// ICE_LICENSE file included in this distribution.
-//
-// **********************************************************************
-
-import FilesystemDB.*;
-
-public class Server extends Ice.Application
-{
- public
- Server(String envName)
- {
- _envName = envName;
- }
-
- @Override
- public int
- run(String[] args)
- {
- //
- // Create an object adapter
- //
- Ice.ObjectAdapter adapter = communicator().createObjectAdapter("MapFilesystem");
-
- 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);
- new IdentityFileEntryMap(connection, FileI.filesDB(), true);
- new IdentityDirectoryEntryMap(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.
- //
- if(connection != null)
- {
- connection.close();
- }
- }
-
- return 0;
- }
-
- public static void
- main(String[] args)
- {
- Server app = new Server("db");
- app.main("demo.book.map_filesystem.Server", args, "config.server");
- System.exit(0);
- }
-
- private String _envName;
-}