summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/allTests.py1
-rw-r--r--cpp/config/IcePackAdmin.py60
-rw-r--r--cpp/doc/Properties.sgml135
-rw-r--r--cpp/slice/IcePack/Admin.ice10
-rw-r--r--cpp/src/IceBox/Server.cpp9
-rw-r--r--cpp/src/IceBox/ServiceManagerI.cpp1
-rw-r--r--cpp/src/IcePack/.depend9
-rw-r--r--cpp/src/IcePack/Activator.ice23
-rw-r--r--cpp/src/IcePack/ActivatorI.cpp236
-rw-r--r--cpp/src/IcePack/ActivatorI.h14
-rw-r--r--cpp/src/IcePack/AdapterManagerI.cpp90
-rw-r--r--cpp/src/IcePack/AdapterManagerI.h10
-rw-r--r--cpp/src/IcePack/AdminI.cpp60
-rw-r--r--cpp/src/IcePack/AdminI.h7
-rw-r--r--cpp/src/IcePack/ApplicationDeployer.cpp5
-rw-r--r--cpp/src/IcePack/Client.cpp6
-rw-r--r--cpp/src/IcePack/ComponentDeployer.cpp33
-rw-r--r--cpp/src/IcePack/ComponentDeployer.h6
-rw-r--r--cpp/src/IcePack/Makefile5
-rw-r--r--cpp/src/IcePack/Server.cpp444
-rw-r--r--cpp/src/IcePack/ServerDeployer.cpp12
-rw-r--r--cpp/src/IcePack/ServerManager.ice14
-rw-r--r--cpp/src/IcePack/ServerManagerI.cpp292
-rw-r--r--cpp/src/IcePack/ServerManagerI.h17
-rw-r--r--cpp/src/IcePack/ServiceDeployer.cpp2
-rw-r--r--cpp/src/IcePack/TraceLevels.cpp34
-rw-r--r--cpp/src/IcePack/TraceLevels.h44
-rw-r--r--cpp/test/IcePack/Makefile2
-rw-r--r--cpp/test/IcePack/deployer/.depend7
-rw-r--r--cpp/test/IcePack/deployer/AllTests.cpp159
-rw-r--r--cpp/test/IcePack/deployer/Client.cpp80
-rw-r--r--cpp/test/IcePack/deployer/Makefile64
-rw-r--r--cpp/test/IcePack/deployer/Server.cpp47
-rw-r--r--cpp/test/IcePack/deployer/Service.cpp130
-rw-r--r--cpp/test/IcePack/deployer/Test.ice21
-rw-r--r--cpp/test/IcePack/deployer/TestI.cpp30
-rw-r--r--cpp/test/IcePack/deployer/TestI.h31
-rw-r--r--cpp/test/IcePack/deployer/application.xml10
-rw-r--r--cpp/test/IcePack/deployer/db/.dummy0
-rw-r--r--cpp/test/IcePack/deployer/db/db/.dummy0
-rw-r--r--cpp/test/IcePack/deployer/freezeservice.xml18
-rw-r--r--cpp/test/IcePack/deployer/icebox.xml21
-rw-r--r--cpp/test/IcePack/deployer/icestorm_icebox.xml8
-rw-r--r--cpp/test/IcePack/deployer/icestorm_service.xml17
-rwxr-xr-xcpp/test/IcePack/deployer/run.py93
-rw-r--r--cpp/test/IcePack/deployer/server.xml31
-rw-r--r--cpp/test/IcePack/deployer/service.xml20
-rw-r--r--cpp/test/IcePack/deployer/yellow_icebox.xml17
-rwxr-xr-xcpp/test/IcePack/simple/run.py98
-rw-r--r--cpp/test/IcePack/simple/simple_server.xml11
50 files changed, 2043 insertions, 451 deletions
diff --git a/cpp/allTests.py b/cpp/allTests.py
index f4a5ca28c16..bf8183180b2 100755
--- a/cpp/allTests.py
+++ b/cpp/allTests.py
@@ -58,6 +58,7 @@ tests = [ \
if TestUtil.isWin32() == 0:
tests += [ \
"IcePack/simple", \
+ "IcePack/deployer", \
"Glacier/starter", \
]
diff --git a/cpp/config/IcePackAdmin.py b/cpp/config/IcePackAdmin.py
index 7af77185381..1ca50938760 100644
--- a/cpp/config/IcePackAdmin.py
+++ b/cpp/config/IcePackAdmin.py
@@ -17,7 +17,7 @@ def startIcePack(toplevel, port, testdir):
global icePackPort
- options = TestUtil.serverOptions.replace("TOPLEVELDIR", toplevel)
+ options = TestUtil.clientServerOptions.replace("TOPLEVELDIR", toplevel)
icePackPort = port
@@ -28,10 +28,17 @@ def startIcePack(toplevel, port, testdir):
r' --IcePack.Locator.Endpoints="default -p ' + icePackPort + ' -t 5000" ' + \
r' --IcePack.LocatorRegistry.Endpoints=default' + \
r' --IcePack.Admin.Endpoints=default' + \
- r' --IcePack.Data=' + os.path.join(testdir, "db")
+ r' --IcePack.Yellow.Query=Yellow/Query@YellowQueryAdapter' + \
+ r' --IcePack.Yellow.Admin=Yellow/Admin@YellowAdminAdapter' + \
+ r' --IcePack.Data=' + os.path.join(testdir, "db") + \
+ r' --Ice.ProgramName=icepack' + \
+ r' --IcePack.Trace.Activator=0 --IcePack.Trace.AdapterManager=0 --IcePack.Trace.ServerManager=0'
icePackPipe = os.popen(command)
TestUtil.getServerPid(icePackPipe)
+ TestUtil.getServerPid(icePackPipe)
+ TestUtil.getAdapterReady(icePackPipe)
+ TestUtil.getAdapterReady(icePackPipe)
TestUtil.getAdapterReady(icePackPipe)
TestUtil.getAdapterReady(icePackPipe)
print "ok"
@@ -46,9 +53,9 @@ def shutdownIcePack(toplevel, icePackPipe):
print "shutting down icepack...",
command = icePackAdmin + options + \
- r' "--Ice.Default.Locator=IcePack/locator:default -p ' + icePackPort + '" ' + \
- r' -e "shutdown" '
-
+ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
+ r' -e "shutdown" '
+
icePackAdminPipe = os.popen(command)
icePackAdminStatus = icePackAdminPipe.close()
icePackPipe.close()
@@ -58,6 +65,39 @@ def shutdownIcePack(toplevel, icePackPipe):
TestUtil.killServers()
sys.exit(1)
+def addApplication(toplevel, descriptor, targets):
+
+ global icePackPort
+ icePackAdmin = os.path.join(toplevel, "bin", "icepackadmin")
+
+ options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
+
+ command = icePackAdmin + options + \
+ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
+ r' -e "application add \"' + descriptor + '\\" ' + targets + ' \"'
+
+ icePackAdminPipe = os.popen(command)
+ icePackAdminStatus = icePackAdminPipe.close()
+ if icePackAdminStatus:
+ TestUtil.killServers()
+ sys.exit(1)
+
+def removeApplication(toplevel, descriptor):
+
+ global icePackPort
+ icePackAdmin = os.path.join(toplevel, "bin", "icepackadmin")
+
+ options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
+
+ command = icePackAdmin + options + \
+ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
+ r' -e "application remove \"' + descriptor + '\\" \"'
+
+ icePackAdminPipe = os.popen(command)
+ icePackAdminStatus = icePackAdminPipe.close()
+ if icePackAdminStatus:
+ TestUtil.killServers()
+ sys.exit(1)
def addServer(toplevel, name, serverDescriptor, server, libpath, targets):
@@ -67,7 +107,7 @@ def addServer(toplevel, name, serverDescriptor, server, libpath, targets):
options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
command = icePackAdmin + options + \
- r' "--Ice.Default.Locator=IcePack/locator:default -p ' + icePackPort + '" ' + \
+ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "server add \"' + name + '\\" \\"' + serverDescriptor + '\\" ' + \
r' \"' + server + '\\" \\"' + libpath + '\\" ' + targets + '\"'
@@ -85,7 +125,7 @@ def removeServer(toplevel, name):
options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
command = icePackAdmin + options + \
- r' "--Ice.Default.Locator=IcePack/locator:default -p ' + icePackPort + '" ' + \
+ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "server remove \"' + name + '\\" \"'
icePackAdminPipe = os.popen(command)
@@ -101,7 +141,7 @@ def startServer(toplevel, name):
options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
command = icePackAdmin + options + \
- r' "--Ice.Default.Locator=IcePack/locator:default -p ' + icePackPort + '" ' + \
+ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "server start \"' + name + '\\""'
icePackAdminPipe = os.popen(command)
@@ -117,7 +157,7 @@ def listAdapters(toplevel):
options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
command = icePackAdmin + options + \
- r' "--Ice.Default.Locator=IcePack/locator:default -p ' + icePackPort + '" ' + \
+ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "adapter list"'
icePackAdminPipe = os.popen(command)
@@ -131,7 +171,7 @@ def removeAdapter(toplevel, name):
options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
command = icePackAdmin + options + \
- r' "--Ice.Default.Locator=IcePack/locator:default -p ' + icePackPort + '" ' + \
+ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "adapter remove \"' + name + '\\""'
icePackAdminPipe = os.popen(command)
diff --git a/cpp/doc/Properties.sgml b/cpp/doc/Properties.sgml
index 2eacc1887c7..30496438a5d 100644
--- a/cpp/doc/Properties.sgml
+++ b/cpp/doc/Properties.sgml
@@ -862,7 +862,7 @@ interface. The locator endpoints must be accessible to &Ice; clients
that are using &IcePack; to locate objects.
</para>
<para>The default value for <literal>IcePack.Locator.Identity</literal>
-is <literal>IcePack/locator</literal>.
+is <literal>IcePack/Locator</literal>.
</para>
</section>
@@ -884,7 +884,7 @@ servers that are using &IcePack; to register their object adapters.
</para>
<para>The default value for
<literal>IcePack.LocatorRegistry.Identity</literal>
-is <literal>IcePack/locatorregistry</literal>.
+is <literal>IcePack/LocatorRegistry</literal>.
</para>
</section>
@@ -906,7 +906,7 @@ accessible to clients which are using the &IcePack; administrative
interface such as the &IcePack; administrative tool.
</para>
<para>The default value for IcePack.Admin.Identity is
-<literal>IcePack/admin</literal>.
+<literal>IcePack/Admin</literal>.
</para>
<note><para>Allowing access to the &IcePack; admin interface is a
security risk! If you don't specify the administrative endpoints the
@@ -923,11 +923,130 @@ IcePack.Activation.WaitTime=<replaceable>num</replaceable>
<section>
<title>Description</title>
<para>
-Defines the interval in seconds that &IcePack; will wait for the
-server to register its adapters. If the server didn't register its
-adapters during this time interval and a client is waiting for the
-activation of one of the server object adapters, &IcePack; will return
-empty endpoints to the client. The default value is 10 seconds.
+Defines the interval in seconds that &IcePack; will wait for server
+activation and deactivation.</para>
+<para>If a server is automatically activated as a result of a client object
+adapter lookup and if the server doesn't register its object adapters
+during this time interval, &IcePack; will return empty endpoints to
+the client.</para>
+<para>If a server is being gracefully deactivated and &IcePack; doesn't
+detect the server deactivation during this time interval, &IcePack;
+will kill the server.</para>
+<note><para>The default value is 60 seconds.</para></note>
+</section>
+</section>
+
+<section><title>IcePack.Trace.ServerManager</title>
+<section><title>Synopsis</title>
+<synopsis>
+IcePack.Trace.ServerManager=<replaceable>num</replaceable>
+</synopsis>
+</section>
+<section>
+<title>Description</title>
+<para>
+The server manager tracing level:
+<informaltable>
+<tgroup cols=2>
+<tbody>
+<row>
+<entry>0</entry>
+<entry>No server manager tracing. (default)</entry>
+</row>
+<row>
+<entry>1</entry>
+<entry>Trace server addition, removal.</entry>
+</row>
+<row>
+<entry>2</entry>
+<entry>Like 1, but more verbose, includes server activation and
+deactivation and more diagnostic messages.</entry>
+</row>
+<row>
+<entry>3</entry>
+<entry>Like 2, but more verbose, includes server transitional state
+change (activating and deactivating).</entry>
+</row>
+</tbody>
+</tgroup>
+</informaltable>
+</para>
+</section>
+</section>
+
+<section><title>IcePack.Trace.AdapterManager</title>
+<section><title>Synopsis</title>
+<synopsis>
+IcePack.Trace.AdapterManager=<replaceable>num</replaceable>
+</synopsis>
+</section>
+<section>
+<title>Description</title>
+<para>
+The adapter manager tracing level:
+<informaltable>
+<tgroup cols=2>
+<tbody>
+<row>
+<entry>0</entry>
+<entry>No adapter manager tracing. (default)</entry>
+</row>
+<row>
+<entry>1</entry>
+<entry>Trace adapter addition, removal.</entry>
+</row>
+<row>
+<entry>2</entry>
+<entry>Like 1, but more verbose, includes adapter activation and
+deactivation and more diagnostic messages.</entry>
+</row>
+<row>
+<entry>3</entry>
+<entry>Like 2, but more verbose, includes adapter transitional state
+change (`waiting for activation' for example).</entry>
+</row>
+</tbody>
+</tgroup>
+</informaltable>
+</para>
+</section>
+</section>
+
+<section><title>IcePack.Trace.Activator</title>
+<section><title>Synopsis</title>
+<synopsis>
+IcePack.Trace.Activator=<replaceable>num</replaceable>
+</synopsis>
+</section>
+<section>
+<title>Description</title>
+<para>
+The activator tracing level:
+<informaltable>
+<tgroup cols=2>
+<tbody>
+<row>
+<entry>0</entry>
+<entry>No activator tracing. (default)</entry>
+</row>
+<row>
+<entry>1</entry>
+<entry>Trace process activation, termination.</entry>
+</row>
+<row>
+<entry>2</entry>
+<entry>Like 1, but more verbose, includes process signaling and more
+diagnostic messages on process activation.</entry>
+</row>
+<row>
+<entry>3</entry>
+<entry>Like 2, but more verbose, includes more diagnostic messages on
+process activation (path, working directory and arguments of the
+activated process for instance).</entry>
+</row>
+</tbody>
+</tgroup>
+</informaltable>
</para>
</section>
</section>
diff --git a/cpp/slice/IcePack/Admin.ice b/cpp/slice/IcePack/Admin.ice
index 019af17a762..4ab7bf2d35e 100644
--- a/cpp/slice/IcePack/Admin.ice
+++ b/cpp/slice/IcePack/Admin.ice
@@ -1,3 +1,4 @@
+
// **********************************************************************
//
// Copyright (c) 2001
@@ -198,6 +199,15 @@ struct ServerDescription
*
**/
Args args;
+
+ /**
+ *
+ * True if the server is an &IceBox;. &IceBox; servers are
+ * shutdown using the service manager instead of relying on
+ * signals.
+ *
+ **/
+ bool isIceBox;
};
/**
diff --git a/cpp/src/IceBox/Server.cpp b/cpp/src/IceBox/Server.cpp
index 167a419737b..7954e000e14 100644
--- a/cpp/src/IceBox/Server.cpp
+++ b/cpp/src/IceBox/Server.cpp
@@ -49,9 +49,6 @@ Server::usage()
int
Server::run(int argc, char* argv[])
{
- ServiceManagerPtr serviceManager;
- int status;
-
PropertiesPtr properties = communicator()->getProperties();
StringSeq args = argsToStringSeq(argc, argv);
args = properties->parseCommandLineOptions("IceBox", args);
@@ -78,8 +75,6 @@ Server::run(int argc, char* argv[])
}
ServiceManagerI* serviceManagerImpl = new ServiceManagerI(this, argc, argv);
- serviceManager = serviceManagerImpl;
- status = serviceManagerImpl->run();
-
- return EXIT_SUCCESS;
+ ServiceManagerPtr serviceManager = serviceManagerImpl;
+ return serviceManagerImpl->run();
}
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp
index b39622d032a..ab79dfe2c8c 100644
--- a/cpp/src/IceBox/ServiceManagerI.cpp
+++ b/cpp/src/IceBox/ServiceManagerI.cpp
@@ -160,6 +160,7 @@ IceBox::ServiceManagerI::run()
_server->shutdownOnInterrupt();
_server->communicator()->waitForShutdown();
+ _server->ignoreInterrupt();
//
// Invoke stop() on the services.
diff --git a/cpp/src/IcePack/.depend b/cpp/src/IcePack/.depend
index 3061cf45932..071ae967ca6 100644
--- a/cpp/src/IcePack/.depend
+++ b/cpp/src/IcePack/.depend
@@ -6,9 +6,9 @@ Grammar.o: Grammar.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ..
Scanner.o: Scanner.cpp ../../include/IceUtil/Config.h ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../IcePack/Parser.h ../../include/IcePack/Admin.h ../IcePack/Grammar.h
Parser.o: Parser.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../IcePack/Parser.h ../../include/IcePack/Admin.h
Client.o: Client.cpp ../../include/Ice/Application.h ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../IcePack/Parser.h ../../include/IcePack/Admin.h
-Server.o: Server.cpp ../../include/Freeze/Application.h ../../include/Ice/Application.h ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../../include/Freeze/Freeze.h ../../include/Freeze/Initialize.h ../../include/Freeze/DBF.h ../../include/Freeze/DB.h ../../include/Freeze/DBException.h ../../include/Freeze/EvictorF.h ../../include/Freeze/Evictor.h ../../include/Freeze/Map.h ../IcePack/LocatorI.h ../../include/Ice/Locator.h ../IcePack/AdapterManagerF.h ../IcePack/LocatorRegistryI.h ../IcePack/ServerManagerI.h ../IcePack/ServerManager.h ../../include/IcePack/Admin.h ../IcePack/AdapterManager.h ../IcePack/Activator.h ../IcePack/ServerManagerF.h ../IcePack/AdapterManagerI.h ../IcePack/AdminI.h ../IcePack/ActivatorI.h ../../include/IceUtil/Thread.h
-AdapterManagerI.o: AdapterManagerI.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../../include/Freeze/DB.h ../../include/Freeze/DBException.h ../../include/Freeze/DBF.h ../../include/Freeze/EvictorF.h ../../include/Freeze/Evictor.h ../IcePack/AdapterManagerI.h ../IcePack/AdapterManager.h ../../include/IcePack/Admin.h ../IcePack/ServerManager.h
-ServerManagerI.o: ServerManagerI.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../../include/Freeze/DB.h ../../include/Freeze/DBException.h ../../include/Freeze/DBF.h ../../include/Freeze/EvictorF.h ../../include/Freeze/Evictor.h ../../include/Ice/Functional.h ../../include/IceUtil/Functional.h ../IcePack/ServerManagerI.h ../IcePack/ServerManager.h ../../include/IcePack/Admin.h ../IcePack/AdapterManager.h ../IcePack/Activator.h ../IcePack/ServerManagerF.h ../IcePack/ServerDeployer.h ../IcePack/ComponentDeployer.h ../../include/Yellow/Yellow.h ../IcePack/AdapterManagerF.h
+Server.o: Server.cpp ../../include/Ice/Application.h ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../../include/Freeze/Freeze.h ../../include/Freeze/Initialize.h ../../include/Freeze/DBF.h ../../include/Freeze/DB.h ../../include/Freeze/DBException.h ../../include/Freeze/EvictorF.h ../../include/Freeze/Evictor.h ../../include/Freeze/Map.h ../IcePack/LocatorI.h ../../include/Ice/Locator.h ../IcePack/AdapterManagerF.h ../IcePack/LocatorRegistryI.h ../IcePack/ServerManagerI.h ../IcePack/ServerManager.h ../../include/IcePack/Admin.h ../IcePack/AdapterManager.h ../IcePack/Activator.h ../IcePack/ServerManagerF.h ../IcePack/AdapterManagerI.h ../IcePack/AdminI.h ../IcePack/TraceLevels.h ../IcePack/ActivatorI.h ../../include/IceUtil/Thread.h
+AdapterManagerI.o: AdapterManagerI.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../../include/Freeze/DB.h ../../include/Freeze/DBException.h ../../include/Freeze/DBF.h ../../include/Freeze/EvictorF.h ../../include/Freeze/Evictor.h ../IcePack/AdapterManagerI.h ../IcePack/AdapterManager.h ../../include/IcePack/Admin.h ../IcePack/ServerManager.h ../IcePack/TraceLevels.h
+ServerManagerI.o: ServerManagerI.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../../include/Freeze/DB.h ../../include/Freeze/DBException.h ../../include/Freeze/DBF.h ../../include/Freeze/EvictorF.h ../../include/Freeze/Evictor.h ../../include/Ice/Functional.h ../../include/IceUtil/Functional.h ../IcePack/ServerManagerI.h ../IcePack/ServerManager.h ../../include/IcePack/Admin.h ../IcePack/AdapterManager.h ../IcePack/Activator.h ../IcePack/ServerManagerF.h ../IcePack/ServerDeployer.h ../IcePack/ComponentDeployer.h ../../include/Yellow/Yellow.h ../IcePack/AdapterManagerF.h ../IcePack/TraceLevels.h ../../include/IceBox/IceBox.h
ComponentDeployer.o: ComponentDeployer.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../../include/Ice/Locator.h ../IcePack/ComponentDeployer.h ../../include/IcePack/Admin.h ../../include/Yellow/Yellow.h
ServerDeployer.o: ServerDeployer.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../IcePack/ServerDeployer.h ../IcePack/ComponentDeployer.h ../../include/IcePack/Admin.h ../../include/Yellow/Yellow.h ../IcePack/ServerManagerF.h ../IcePack/AdapterManagerF.h ../IcePack/ServiceDeployer.h ../IcePack/AdapterManager.h ../IcePack/ServerManager.h
ServiceDeployer.o: ServiceDeployer.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../IcePack/ServiceDeployer.h ../IcePack/ComponentDeployer.h ../../include/IcePack/Admin.h ../../include/Yellow/Yellow.h ../IcePack/ServerDeployer.h ../IcePack/ServerManagerF.h ../IcePack/AdapterManagerF.h
@@ -16,4 +16,5 @@ ApplicationDeployer.o: ApplicationDeployer.cpp ../../include/Ice/Ice.h ../../inc
LocatorI.o: LocatorI.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../IcePack/AdapterManager.h ../../include/IcePack/Admin.h ../IcePack/LocatorI.h ../../include/Ice/Locator.h ../IcePack/AdapterManagerF.h
LocatorRegistryI.o: LocatorRegistryI.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../IcePack/AdapterManager.h ../../include/IcePack/Admin.h ../IcePack/LocatorRegistryI.h ../../include/Ice/Locator.h ../IcePack/AdapterManagerF.h
AdminI.o: AdminI.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../IcePack/AdminI.h ../../include/IcePack/Admin.h ../IcePack/ServerManagerF.h ../IcePack/AdapterManagerF.h ../IcePack/ServerManager.h ../IcePack/AdapterManager.h ../IcePack/ApplicationDeployer.h ../IcePack/ComponentDeployer.h ../../include/Yellow/Yellow.h ../IcePack/ServerDeployer.h
-ActivatorI.o: ActivatorI.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../IcePack/ActivatorI.h ../../include/IceUtil/Thread.h ../IcePack/Activator.h ../IcePack/ServerManagerF.h ../../include/IcePack/Admin.h ../IcePack/ServerManager.h ../IcePack/AdapterManager.h
+ActivatorI.o: ActivatorI.cpp ../../include/Ice/Ice.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/LoggerF.h ../../include/Ice/Communicator.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ObjectFactory.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocator.h ../../include/Ice/IdentityUtil.h ../IcePack/ActivatorI.h ../../include/IceUtil/Thread.h ../IcePack/Activator.h ../IcePack/ServerManagerF.h ../../include/IcePack/Admin.h ../IcePack/ServerManager.h ../IcePack/AdapterManager.h ../IcePack/TraceLevels.h
+TraceLevels.o: TraceLevels.cpp ../../include/Ice/Properties.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/StreamF.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/Identity.h ../../include/Ice/Facet.h ../../include/Ice/Object.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/InstanceF.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Incoming.h ../../include/Ice/Direct.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/BuiltinSequences.h ../IcePack/TraceLevels.h ../../include/Ice/PropertiesF.h ../../include/Ice/LoggerF.h
diff --git a/cpp/src/IcePack/Activator.ice b/cpp/src/IcePack/Activator.ice
index 1bd2cd66664..4cdecbf029a 100644
--- a/cpp/src/IcePack/Activator.ice
+++ b/cpp/src/IcePack/Activator.ice
@@ -16,7 +16,7 @@
module IcePack
{
-interface Activator
+local interface Activator
{
/**
*
@@ -27,6 +27,27 @@ interface Activator
*
**/
int activate(Server* server);
+
+ /**
+ *
+ * Deactivate a server.
+ *
+ **/
+ void deactivate(Server* server);
+
+ /**
+ *
+ * Kill a server.
+ *
+ **/
+ void kill(Server* server);
+
+ /**
+ *
+ * Destroy the activator.
+ *
+ **/
+ void destroy();
};
};
diff --git a/cpp/src/IcePack/ActivatorI.cpp b/cpp/src/IcePack/ActivatorI.cpp
index 10b0043e48d..92654ff8eda 100644
--- a/cpp/src/IcePack/ActivatorI.cpp
+++ b/cpp/src/IcePack/ActivatorI.cpp
@@ -16,15 +16,21 @@
#include <IcePack/ActivatorI.h>
#include <IcePack/Admin.h>
#include <IcePack/ServerManager.h>
+#include <IcePack/TraceLevels.h>
+
+#include <sys/types.h>
+#include <signal.h>
#include <fcntl.h>
using namespace std;
using namespace Ice;
using namespace IcePack;
-IcePack::ActivatorI::ActivatorI(const CommunicatorPtr& communicator) :
+IcePack::ActivatorI::ActivatorI(const CommunicatorPtr& communicator, const TraceLevelsPtr& traceLevels) :
_communicator(communicator),
- _destroy(false)
+ _traceLevels(traceLevels),
+ _destroy(false),
+ _deactivating(false)
{
int fds[2];
if(pipe(fds) != 0)
@@ -43,12 +49,10 @@ IcePack::ActivatorI::ActivatorI(const CommunicatorPtr& communicator) :
IcePack::ActivatorI::~ActivatorI()
{
assert(_destroy);
+ assert(_processes.empty());
+
close(_fdIntrRead);
close(_fdIntrWrite);
- for(vector<Process>::iterator p = _processes.begin(); p != _processes.end(); ++p)
- {
- close(p->fd);
- }
}
void
@@ -73,23 +77,74 @@ IcePack::ActivatorI::run()
void
IcePack::ActivatorI::destroy()
{
- IceUtil::Mutex::Lock sync(*this);
+ {
+ IceUtil::Mutex::Lock sync(*this);
+
+ if(_destroy || _deactivating) // Don't destroy or deactivate twice.
+ {
+ return;
+ }
+
+ //
+ // This ensure that no new processes will be activated.
+ //
+ _deactivating = true;
+ }
+
- if(_destroy) // Don't destroy twice.
+ //
+ // Stop all activated processes.
+ //
+ while(true)
{
- return;
+ ServerPrx server;
+ {
+ IceUtil::Mutex::Lock sync(*this);
+ if(!_processes.empty())
+ {
+ server = _processes.begin()->server;
+ }
+ else
+ {
+ //
+ // No more process to deactivate.
+ //
+ break;
+ }
+ }
+
+ //
+ // Stop the server. The activator thread should detect the
+ // process deactivation and remove it from the activator
+ // active processes. This garantees that this loop will end at
+ // one point.
+ //
+ server->stop();
}
- _destroy = true;
- setInterrupt();
+ //
+ // Set the state as destroyed, this will cause the
+ // activator thread to exit.
+ //
+ {
+ IceUtil::Mutex::Lock sync(*this);
+
+ _destroy = true;
+ setInterrupt();
+ }
+
+ //
+ // Join the activator thread.
+ //
+ getThreadControl().join();
}
Ice::Int
-IcePack::ActivatorI::activate(const ServerPrx& server, const ::Ice::Current&)
+IcePack::ActivatorI::activate(const ServerPrx& server)
{
IceUtil::Mutex::Lock sync(*this);
- if(_destroy)
+ if(_destroy || _deactivating)
{
return false;
}
@@ -116,7 +171,58 @@ IcePack::ActivatorI::activate(const ServerPrx& server, const ::Ice::Current&)
}
//
- // Process does not exist, activate and create.
+ // Normalize the path to the working directory.
+ //
+ string pwd = desc.pwd;
+ if(!pwd.empty())
+ {
+ string::size_type pos;
+ while((pos = pwd.find("//")) != string::npos)
+ {
+ pwd.erase(pos, 1);
+ }
+ while((pos = pwd.find("/./")) != string::npos)
+ {
+ pwd.erase(pos, 2);
+ }
+ }
+
+ //
+ // Compute arguments.
+ //
+ int argc = desc.args.size() + 2;
+ char** argv = static_cast<char**>(malloc(argc * sizeof(char*)));
+ argv[0] = strdup(path.c_str());
+ unsigned int i = 0;
+ vector<string>::const_iterator q;
+ for(q = desc.args.begin(); q != desc.args.end(); ++q, ++i)
+ {
+ argv[i + 1] = strdup(q->c_str());
+ }
+ argv[argc - 1] = 0;
+
+ if(_traceLevels->activator > 1)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->activatorCat);
+ out << "activating server `" << desc.name << "'";
+ if(_traceLevels->activator > 2)
+ {
+ out << "\n";
+ out << "path = " << path << "\n";
+ out << "pwd = " << pwd << "\n";
+ out << "args = ";
+
+ char **args = argv;
+ while(*args)
+ {
+ out << " " << *args;
+ args++;
+ }
+ }
+ }
+
+ //
+ // Activate and create.
//
int fds[2];
if(pipe(fds) != 0)
@@ -183,19 +289,8 @@ IcePack::ActivatorI::activate(const ServerPrx& server, const ::Ice::Current&)
//
// Change working directory.
//
- string pwd = desc.pwd;
if(!pwd.empty())
{
- string::size_type pos;
- while((pos = pwd.find("//")) != string::npos)
- {
- pwd.erase(pos, 1);
- }
- while((pos = pwd.find("/./")) != string::npos)
- {
- pwd.erase(pos, 2);
- }
-
if(chdir(pwd.c_str()) == -1)
{
//
@@ -210,21 +305,7 @@ IcePack::ActivatorI::activate(const ServerPrx& server, const ::Ice::Current&)
close(fds[1]);
exit(EXIT_FAILURE);
}
- }
-
- //
- // Compute arguments.
- //
- int argc = desc.args.size() + 2;
- char** argv = static_cast<char**>(malloc(argc * sizeof(char*)));
- argv[0] = strdup(path.c_str());
- unsigned int i = 0;
- vector<string>::const_iterator q;
- for(q = desc.args.begin(); q != desc.args.end(); ++q, ++i)
- {
- argv[i + 1] = strdup(q->c_str());
- }
- argv[argc - 1] = 0;
+ }
if(execvp(argv[0], argv) == -1)
{
@@ -256,12 +337,66 @@ IcePack::ActivatorI::activate(const ServerPrx& server, const ::Ice::Current&)
fcntl(process.fd, F_SETFL, flags);
setInterrupt();
+
+ if(_traceLevels->activator > 0)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->activatorCat);
+ out << "activated server `" << desc.name << "'(pid = " << pid << ")";
+ }
}
return pid;
}
void
+IcePack::ActivatorI::deactivate(const ServerPrx& server)
+{
+ pid_t pid = static_cast<pid_t>(server->getPid());
+
+ //
+ // Send a SIGTERM to the process.
+ //
+ if(::kill(pid, SIGTERM))
+ {
+ SystemException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
+ }
+
+ if(_traceLevels->activator > 1)
+ {
+ ServerDescription desc = server->getServerDescription();
+
+ Ice::Trace out(_traceLevels->logger, _traceLevels->activatorCat);
+ out << "sent SIGTERM to server `" << desc.name << "' (pid = " << pid << ")";
+ }
+}
+
+void
+IcePack::ActivatorI::kill(const ServerPrx& server)
+{
+ pid_t pid = static_cast<pid_t>(server->getPid());
+
+ //
+ // Send a SIGKILL to the process.
+ //
+ if(::kill(pid, SIGKILL))
+ {
+ SystemException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
+ }
+
+ if(_traceLevels->activator > 1)
+ {
+ ServerDescription desc = server->getServerDescription();
+
+ Ice::Trace out(_traceLevels->logger, _traceLevels->activatorCat);
+ out << "sent SIGKILL to server `" << desc.name << "' (pid = " << pid << ")";
+ }
+}
+
+void
IcePack::ActivatorI::terminationListener()
{
while(true)
@@ -278,7 +413,7 @@ IcePack::ActivatorI::terminationListener()
{
return;
}
-
+
for(vector<Process>::iterator p = _processes.begin(); p != _processes.end(); ++p)
{
int fd = p->fd;
@@ -358,20 +493,19 @@ IcePack::ActivatorI::terminationListener()
//
p = _processes.erase(p);
close(fd);
+
+ if(_traceLevels->activator > 0)
+ {
+ ServerDescription desc = server->getServerDescription();
+
+ Ice::Trace out(_traceLevels->logger, _traceLevels->activatorCat);
+ out << "detected server `" << desc.name << "' termination";
+ }
//
// Notify the server it has terminated.
//
- try
- {
- server->terminationCallback();
- }
- catch(const Ice::ObjectAdapterDeactivatedException&)
- {
- //
- // Expected when IcePack is shutdown.
- //
- }
+ server->terminationCallback();
}
//
diff --git a/cpp/src/IcePack/ActivatorI.h b/cpp/src/IcePack/ActivatorI.h
index b779cbe4d22..084e526cbcd 100644
--- a/cpp/src/IcePack/ActivatorI.h
+++ b/cpp/src/IcePack/ActivatorI.h
@@ -18,17 +18,22 @@
namespace IcePack
{
+class TraceLevels;
+typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
+
class ActivatorI : public Activator, public IceUtil::Thread, public IceUtil::Mutex
{
public:
- ActivatorI(const Ice::CommunicatorPtr&);
+ ActivatorI(const Ice::CommunicatorPtr&, const TraceLevelsPtr&);
virtual ~ActivatorI();
virtual void run();
- void destroy();
- virtual Ice::Int activate(const ::IcePack::ServerPrx&, const ::Ice::Current&);
+ virtual Ice::Int activate(const ::IcePack::ServerPrx&);
+ virtual void deactivate(const ::IcePack::ServerPrx&);
+ virtual void kill(const ::IcePack::ServerPrx&);
+ virtual void destroy();
private:
@@ -44,8 +49,11 @@ private:
};
Ice::CommunicatorPtr _communicator;
+ TraceLevelsPtr _traceLevels;
std::vector<Process> _processes;
bool _destroy;
+ bool _deactivating;
+
int _fdIntrRead;
int _fdIntrWrite;
};
diff --git a/cpp/src/IcePack/AdapterManagerI.cpp b/cpp/src/IcePack/AdapterManagerI.cpp
index 13c0bf73e26..2fb9890d81c 100644
--- a/cpp/src/IcePack/AdapterManagerI.cpp
+++ b/cpp/src/IcePack/AdapterManagerI.cpp
@@ -13,6 +13,7 @@
#include <Freeze/Evictor.h>
#include <IcePack/AdapterManagerI.h>
#include <IcePack/ServerManager.h>
+#include <IcePack/TraceLevels.h>
using namespace std;
using namespace Ice;
@@ -48,7 +49,9 @@ class AdapterFactory : public ObjectFactory
{
public:
- AdapterFactory(int waitTime) : _waitTime(waitTime)
+ AdapterFactory(const TraceLevelsPtr& traceLevels, int waitTime) :
+ _traceLevels(traceLevels),
+ _waitTime(waitTime)
{
}
@@ -59,7 +62,7 @@ public:
create(const std::string& type)
{
assert(type == "::IcePack::Adapter");
- return new AdapterI(_waitTime);
+ return new AdapterI(_traceLevels, _waitTime);
}
virtual void
@@ -69,12 +72,14 @@ public:
private:
+ TraceLevelsPtr _traceLevels;
int _waitTime;
};
}
-IcePack::AdapterI::AdapterI(Int waitTime) :
+IcePack::AdapterI::AdapterI(const TraceLevelsPtr& traceLevels, Int waitTime) :
+ _traceLevels(traceLevels),
_waitTime(waitTime),
_active(false)
{
@@ -104,20 +109,39 @@ IcePack::AdapterI::getDirectProxy(bool activate, const Current&)
// If there's a server associated to this adapter, try to start
// the server and wait for the adapter state to change.
//
- if(description.server && description.server->start())
+ if(description.server)
{
- //
- // Wait for this adapter to be marked as active or the
- // activation timeout.
- //
- while(!_active)
+ if(_traceLevels->adapterMgr > 2)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->adapterMgrCat);
+ out << "waiting for activation of adapter `" << description.name << "'";
+ }
+
+ if(description.server->start())
{
- bool notify = timedWait(IceUtil::Time::seconds(_waitTime));
- if(!notify)
+ //
+ // Wait for this adapter to be marked as active or the
+ // activation timeout.
+ //
+ while(!_active)
{
- throw AdapterActivationTimeoutException();
+ bool notify = timedWait(IceUtil::Time::seconds(_waitTime));
+ if(!notify)
+ {
+ if(_traceLevels->adapterMgr > 1)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->adapterMgrCat);
+ out << "adapter `" << description.name << "' activation timed out";
+ }
+ throw AdapterActivationTimeoutException();
+ }
}
}
+ else if(_traceLevels->adapterMgr > 1)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->adapterMgrCat);
+ out << "adapter `" << description.name << "' activation failed, couldn't start the server";
+ }
}
return proxy;
@@ -135,6 +159,13 @@ IcePack::AdapterI::markAsActive(const Current&)
{
::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this);
_active = true;
+
+ if(_traceLevels->adapterMgr > 1)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->adapterMgrCat);
+ out << "adapter `" << description.name << "' activated";
+ }
+
notifyAll();
}
@@ -143,21 +174,30 @@ IcePack::AdapterI::markAsInactive(const Current&)
{
::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this);
_active = false;
+
+ if(_traceLevels->adapterMgr > 1)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->adapterMgrCat);
+ out << "adapter `" << description.name << "' deactivated";
+ }
+
notifyAll();
}
-IcePack::AdapterManagerI::AdapterManagerI(const ObjectAdapterPtr& adapter, const Freeze::DBEnvironmentPtr& dbEnv) :
- _adapter(adapter)
+IcePack::AdapterManagerI::AdapterManagerI(const ObjectAdapterPtr& adapter, const TraceLevelsPtr& traceLevels,
+ const Freeze::DBEnvironmentPtr& dbEnv) :
+ _adapter(adapter),
+ _traceLevels(traceLevels)
{
Ice::PropertiesPtr properties = adapter->getCommunicator()->getProperties();
_waitTime = properties->getPropertyAsIntWithDefault("IcePack.Activation.WaitTime", 60);
- ObjectFactoryPtr adapterFactory = new AdapterFactory(_waitTime);
+ ObjectFactoryPtr adapterFactory = new AdapterFactory(_traceLevels, _waitTime);
adapter->getCommunicator()->addObjectFactory(adapterFactory, "::IcePack::Adapter");
Freeze::DBPtr dbAdapters = dbEnv->openDB("adapters", true);
_evictor = dbAdapters->createEvictor(Freeze::SaveUponEviction);
- _evictor->setSize(100);
+ _evictor->setSize(1000);
_adapter->addServantLocator(_evictor, "adapter");
//
@@ -174,6 +214,10 @@ IcePack::AdapterManagerI::AdapterManagerI(const ObjectAdapterPtr& adapter, const
}
}
+IcePack::AdapterManagerI::~AdapterManagerI()
+{
+}
+
AdapterPrx
IcePack::AdapterManagerI::create(const AdapterDescription& description, const Current&)
{
@@ -193,7 +237,7 @@ IcePack::AdapterManagerI::create(const AdapterDescription& description, const Cu
{
}
- AdapterPtr adapterI = new AdapterI(_waitTime);
+ AdapterPtr adapterI = new AdapterI(_traceLevels, _waitTime);
adapterI->description = description;
adapterI->proxy = 0;
@@ -204,6 +248,12 @@ IcePack::AdapterManagerI::create(const AdapterDescription& description, const Cu
_evictor->createObject(adapter->ice_getIdentity(), adapterI);
+ if(_traceLevels->adapterMgr > 0)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->adapterMgrCat);
+ out << "added adapter `" << description.name << "'";
+ }
+
return adapter;
}
@@ -243,6 +293,12 @@ IcePack::AdapterManagerI::remove(const string& name, const Current&)
// Remove the adapter name from our internal name set.
//
_adapterNames.erase(_adapterNames.find(name));
+
+ if(_traceLevels->adapterMgr > 0)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->adapterMgrCat);
+ out << "removed adapter `" << name << "'";
+ }
}
AdapterNames
diff --git a/cpp/src/IcePack/AdapterManagerI.h b/cpp/src/IcePack/AdapterManagerI.h
index 61a5ee81e2d..088276e0c46 100644
--- a/cpp/src/IcePack/AdapterManagerI.h
+++ b/cpp/src/IcePack/AdapterManagerI.h
@@ -20,11 +20,14 @@
namespace IcePack
{
+class TraceLevels;
+typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
+
class AdapterI : public Adapter, public IceUtil::Monitor< ::IceUtil::Mutex>
{
public:
- AdapterI(::Ice::Int);
+ AdapterI(const TraceLevelsPtr&, ::Ice::Int);
virtual ~AdapterI();
virtual AdapterDescription getAdapterDescription(const ::Ice::Current&);
@@ -35,6 +38,7 @@ public:
private:
+ TraceLevelsPtr _traceLevels;
::Ice::Int _waitTime;
bool _active;
};
@@ -43,7 +47,8 @@ class AdapterManagerI : public AdapterManager, public IceUtil::Mutex
{
public:
- AdapterManagerI(const Ice::ObjectAdapterPtr&, const Freeze::DBEnvironmentPtr&);
+ AdapterManagerI(const Ice::ObjectAdapterPtr&, const TraceLevelsPtr&, const Freeze::DBEnvironmentPtr&);
+ virtual ~AdapterManagerI();
virtual AdapterPrx create(const AdapterDescription&, const ::Ice::Current&);
virtual AdapterPrx findByName(const ::std::string&, const ::Ice::Current&);
@@ -53,6 +58,7 @@ public:
private:
::Ice::ObjectAdapterPtr _adapter;
+ TraceLevelsPtr _traceLevels;
::Freeze::EvictorPtr _evictor;
::std::set< ::std::string> _adapterNames;
::Ice::Int _waitTime;
diff --git a/cpp/src/IcePack/AdminI.cpp b/cpp/src/IcePack/AdminI.cpp
index dd849abe1d9..f97a727bcc8 100644
--- a/cpp/src/IcePack/AdminI.cpp
+++ b/cpp/src/IcePack/AdminI.cpp
@@ -19,26 +19,38 @@ using namespace std;
using namespace Ice;
using namespace IcePack;
-IcePack::AdminI::AdminI(const CommunicatorPtr& communicator, const ServerManagerPrx& serverManager,
- const AdapterManagerPrx& adapterManager) :
- _communicator(communicator),
+IcePack::AdminI::AdminI(const CommunicatorPtr& shutdownCommunicator, const CommunicatorPtr& backendCommunicator,
+ const ServerManagerPrx& serverManager, const AdapterManagerPrx& adapterManager) :
+ _shutdownCommunicator(shutdownCommunicator),
+ _backendCommunicator(backendCommunicator),
_serverManager(serverManager),
_adapterManager(adapterManager)
{
}
+IcePack::AdminI::~AdminI()
+{
+}
+
void
IcePack::AdminI::addApplication(const string& descriptor, const Targets& targets, const Current&)
{
- ApplicationDeployer deployer(_communicator, this, targets);
- deployer.parse(descriptor);
- deployer.deploy();
+ try
+ {
+ ApplicationDeployer deployer(_backendCommunicator, this, targets);
+ deployer.parse(descriptor);
+ deployer.deploy();
+ }
+ catch(const LocalException& ex)
+ {
+ cout << ex << endl;
+ }
}
void
IcePack::AdminI::removeApplication(const string& descriptor, const Current&)
{
- ApplicationDeployer deployer(_communicator, this, Targets());
+ ApplicationDeployer deployer(_backendCommunicator, this, Targets());
deployer.parse(descriptor);
deployer.undeploy();
}
@@ -47,7 +59,7 @@ void
IcePack::AdminI::addServer(const string& name, const string& path, const string& ldpath, const string& descriptor,
const Targets& targets, const Current&)
{
- ServerDeployer deployer(_communicator, name, path, ldpath, targets);
+ ServerDeployer deployer(_backendCommunicator, name, path, ldpath, targets);
deployer.setServerManager(_serverManager);
deployer.setAdapterManager(_adapterManager);
deployer.parse(descriptor);
@@ -126,18 +138,24 @@ void
IcePack::AdminI::removeServer(const string& name, const Current&)
{
ServerPrx server = _serverManager->findByName(name);
- if(!server)
+ if(server)
{
- throw ServerNotExistException();
+ try
+ {
+ ServerDescription desc = server->getServerDescription();
+
+ ServerDeployer deployer(_backendCommunicator, desc.name, desc.path, "", desc.targets);
+ deployer.setServerManager(_serverManager);
+ deployer.setAdapterManager(_adapterManager);
+ deployer.parse(desc.descriptor);
+ deployer.undeploy();
+ return;
+ }
+ catch(const ObjectNotExistException&)
+ {
+ }
}
-
- ServerDescription desc = server->getServerDescription();
-
- ServerDeployer deployer(_communicator, desc.name, desc.path, "", desc.targets);
- deployer.setServerManager(_serverManager);
- deployer.setAdapterManager(_adapterManager);
- deployer.parse(desc.descriptor);
- deployer.undeploy();
+ throw ServerNotExistException();
}
ServerNames
@@ -160,7 +178,7 @@ IcePack::AdminI::addAdapterWithEndpoints(const string& name, const string& endpo
//
// Set the adapter direct proxy.
//
- ObjectPrx object = _communicator->stringToProxy("dummy:" + endpoints);
+ ObjectPrx object = _backendCommunicator->stringToProxy("dummy:" + endpoints);
adapter->setDirectProxy(object);
}
@@ -178,7 +196,7 @@ IcePack::AdminI::getAdapterEndpoints(const string& name, const Current&) const
{
try
{
- return _communicator->proxyToString(adapter->getDirectProxy(false));
+ return _backendCommunicator->proxyToString(adapter->getDirectProxy(false));
}
catch(const ObjectNotExistException&)
{
@@ -196,5 +214,5 @@ IcePack::AdminI::getAllAdapterNames(const Current&) const
void
IcePack::AdminI::shutdown(const Current&)
{
- _communicator->shutdown();
+ _shutdownCommunicator->shutdown();
}
diff --git a/cpp/src/IcePack/AdminI.h b/cpp/src/IcePack/AdminI.h
index 0e0f94d17d3..5c431c10b9d 100644
--- a/cpp/src/IcePack/AdminI.h
+++ b/cpp/src/IcePack/AdminI.h
@@ -22,7 +22,9 @@ class AdminI : public Admin, public IceUtil::Mutex
{
public:
- AdminI(const Ice::CommunicatorPtr&, const ServerManagerPrx&, const AdapterManagerPrx&);
+ AdminI(const Ice::CommunicatorPtr&, const Ice::CommunicatorPtr&, const ServerManagerPrx&,
+ const AdapterManagerPrx&);
+ virtual ~AdminI();
virtual void addApplication(const std::string&, const Targets&, const Ice::Current& = Ice::Current());
virtual void removeApplication(const std::string&, const Ice::Current& = Ice::Current());
@@ -45,7 +47,8 @@ public:
private:
- Ice::CommunicatorPtr _communicator;
+ Ice::CommunicatorPtr _shutdownCommunicator;
+ Ice::CommunicatorPtr _backendCommunicator;
ServerManagerPrx _serverManager;
AdapterManagerPrx _adapterManager;
};
diff --git a/cpp/src/IcePack/ApplicationDeployer.cpp b/cpp/src/IcePack/ApplicationDeployer.cpp
index 28384fec7ca..19cbcf3e8c5 100644
--- a/cpp/src/IcePack/ApplicationDeployer.cpp
+++ b/cpp/src/IcePack/ApplicationDeployer.cpp
@@ -142,8 +142,7 @@ IcePack::ApplicationDeployer::addServer(const string& name,
throw DeploySAXParseException("descriptor attribute value is empty", _locator);
}
- string xmlFile = descriptor[0] != '/' ? _variables["basedir"] + "/" + descriptor : descriptor;
-
- _tasks.push_back(new AddServer(_admin, name, xmlFile, binpath, libpath, _targets));
+ _tasks.push_back(new AddServer(_admin, name, toLocation(descriptor), toLocation(binpath), toLocation(libpath),
+ _targets));
}
diff --git a/cpp/src/IcePack/Client.cpp b/cpp/src/IcePack/Client.cpp
index 0b70eb9a98c..a3c1d5960b1 100644
--- a/cpp/src/IcePack/Client.cpp
+++ b/cpp/src/IcePack/Client.cpp
@@ -175,12 +175,10 @@ Client::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- Ice::ObjectPrx base = communicator()->stringToProxy("IcePack/admin@IcePack.Admin");
-
- AdminPrx admin = AdminPrx::checkedCast(base);
+ AdminPrx admin = AdminPrx::checkedCast(communicator()->stringToProxy("IcePack/Admin@IcePackAdminAdapter"));
if(!admin)
{
- cerr << appName() << ": `" << "' are no valid administrative endpoints" << endl;
+ cerr << appName() << ": no valid administrative endpoints" << endl;
return EXIT_FAILURE;
}
diff --git a/cpp/src/IcePack/ComponentDeployer.cpp b/cpp/src/IcePack/ComponentDeployer.cpp
index 0a56a6d2e79..5461728cea2 100644
--- a/cpp/src/IcePack/ComponentDeployer.cpp
+++ b/cpp/src/IcePack/ComponentDeployer.cpp
@@ -488,20 +488,8 @@ IcePack::ComponentDeployer::ComponentDeployer(const Ice::CommunicatorPtr& commun
assert(!serversPath.empty());
_variables["datadir"] = serversPath + (serversPath[serversPath.length() - 1] == '/' ? "" : "/") + "servers";
- //
- // TODO: Find a better way to bootstrap the yellow service. We
- // need to set the locator on the proxy here, because the
- // communicator doesn't have a default locator since it's the
- // locator communicator...
- //
- Ice::ObjectPrx object =
- _communicator->stringToProxy(_communicator->getProperties()->getProperty("IcePack.Yellow.Admin"));
- if(object)
- {
- Ice::LocatorPrx locator = Ice::LocatorPrx::uncheckedCast(
- _communicator->stringToProxy(_communicator->getProperties()->getProperty("Ice.Default.Locator")));
- _yellowAdmin = Yellow::AdminPrx::uncheckedCast(object->ice_locator(locator));
- }
+ _yellowAdmin = Yellow::AdminPrx::uncheckedCast(
+ _communicator->stringToProxy(_communicator->getProperties()->getProperty("IcePack.Yellow.Admin")));
}
void
@@ -738,6 +726,23 @@ IcePack::ComponentDeployer::overrideBaseDir(const string& basedir)
}
//
+// Returns a path including the base directory if path is a relative
+// path.
+//
+string
+IcePack::ComponentDeployer::toLocation(const string& path) const
+{
+ if(path.empty())
+ {
+ return "";
+ }
+
+ map<string, string>::const_iterator p = _variables.find("basedir");
+ assert(p != _variables.end());
+ return path[0] != '/' ? p->second + "/" + path : path;
+}
+
+//
// Substitute variables with their values.
//
string
diff --git a/cpp/src/IcePack/ComponentDeployer.h b/cpp/src/IcePack/ComponentDeployer.h
index aed0a920dcb..17bfb9778f8 100644
--- a/cpp/src/IcePack/ComponentDeployer.h
+++ b/cpp/src/IcePack/ComponentDeployer.h
@@ -120,7 +120,6 @@ public:
void parse(const std::string&, ComponentDeployHandler&);
void setDocumentLocator(const Locator*const locator);
- std::string substitute(const std::string&) const;
bool isTargetDeployable(const std::string&) const;
@@ -130,9 +129,12 @@ public:
void addOffer(const std::string&, const std::string&, const std::string&);
void overrideBaseDir(const std::string&);
+ std::string toLocation(const std::string&) const;
+ std::string substitute(const std::string&) const;
+ void undeployFrom(std::vector<TaskPtr>::iterator);
+
protected:
- void undeployFrom(std::vector<TaskPtr>::iterator);
Ice::CommunicatorPtr _communicator;
Yellow::AdminPrx _yellowAdmin;
diff --git a/cpp/src/IcePack/Makefile b/cpp/src/IcePack/Makefile
index 4833dcd761c..8d36864f3f8 100644
--- a/cpp/src/IcePack/Makefile
+++ b/cpp/src/IcePack/Makefile
@@ -41,7 +41,8 @@ SOBJS = Server.o \
LocatorI.o \
LocatorRegistryI.o \
AdminI.o \
- ActivatorI.o
+ ActivatorI.o \
+ TraceLevels.o
SRCS = $(OBJS:.o=.cpp) \
$(COBJS:.o=.cpp) \
@@ -71,7 +72,7 @@ $(CLIENT): $(COBJS)
$(SERVER): $(SOBJS)
rm -f $@
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(SOBJS) -lYellow -lIcePack -lFreeze $(XERCESC_LIBS) $(LIBS) -ldb
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(SOBJS) -lYellow -lIcePack -lIceBox -lFreeze $(XERCESC_LIBS) $(LIBS) -ldb
Grammar.cpp Grammar.h: Grammar.y
bison -dvt Grammar.y
diff --git a/cpp/src/IcePack/Server.cpp b/cpp/src/IcePack/Server.cpp
index 71b47459ccb..37643b62116 100644
--- a/cpp/src/IcePack/Server.cpp
+++ b/cpp/src/IcePack/Server.cpp
@@ -8,12 +8,14 @@
//
// **********************************************************************
-#include <Freeze/Application.h>
+#include <Ice/Application.h>
+#include <Freeze/Freeze.h>
#include <IcePack/LocatorI.h>
#include <IcePack/LocatorRegistryI.h>
#include <IcePack/ServerManagerI.h>
#include <IcePack/AdapterManagerI.h>
#include <IcePack/AdminI.h>
+#include <IcePack/TraceLevels.h>
#ifndef _WIN32
# include <IcePack/ActivatorI.h>
# include <signal.h>
@@ -30,17 +32,31 @@ using namespace Ice;
using namespace Freeze;
using namespace IcePack;
-class Server : public Freeze::Application
+class Server : public Ice::Application
{
public:
- Server(const string& dbEnvName) :
- Freeze::Application(dbEnvName)
+ Server()
{
}
void usage();
- virtual int runFreeze(int argc, char* argv[], const DBEnvironmentPtr&);
+ virtual int run(int argc, char* argv[]);
+
+private:
+
+ void initInternal(const CommunicatorPtr&);
+ void initLocator(const CommunicatorPtr&);
+ void initLocatorRegistry(const CommunicatorPtr&);
+ void initAdmin(const CommunicatorPtr&, const CommunicatorPtr&);
+
+ AdapterManagerPrx _adapterManager;
+ ServerManagerPrx _serverManager;
+ ActivatorPtr _activator;
+ AdminPrx _admin;
+ LocatorPrx _locator;
+ LocatorRegistryPrx _locatorRegistry;
+ DBEnvironmentPtr _dbEnv;
};
#ifndef _WIN32
@@ -77,60 +93,7 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
- // TODO: ML: Loose this try/catch, it's unnecessary. The
- // Application::main() catches already.
- PropertiesPtr defaultProperties;
- try
- {
- defaultProperties = getDefaultProperties(argc, argv);
- StringSeq args = argsToStringSeq(argc, argv);
- args = defaultProperties->parseCommandLineOptions("IcePack", args);
- stringSeqToArgs(args, argc, argv);
- }
- catch(const SystemException& ex)
- {
- cerr << argv[0] << ": " << ex << endl;
- return EXIT_FAILURE;
- }
-
- //
- // Check that IcePack.Data property is set and creates
- // subdirectories db and servers if they don't already exist.
- //
- string dataPath = defaultProperties->getProperty("IcePack.Data");
- if(dataPath.empty())
- {
- cerr << argv[0] << ": property `IcePack.Data' is not set" << endl;
- return EXIT_FAILURE;
- }
- if(dataPath[dataPath.length() - 1] != '/')
- {
- dataPath += "/";
- }
-
- string dbPath = dataPath + "db";
- string serversPath = dataPath + "servers";
-
- struct stat filestat;
- if(stat(dataPath.c_str(), &filestat) == 0 && S_ISDIR(filestat.st_mode))
- {
- if(stat(dbPath.c_str(), &filestat) != 0)
- {
- mkdir(dbPath.c_str(), 0755);
- }
-
- if(stat(serversPath.c_str(), &filestat) != 0)
- {
- mkdir(serversPath.c_str(), 0755);
- }
- }
- else
- {
- cerr << argv[0] << ": `IcePack.Data' doesn't contain a valid directory path." << endl;
- return EXIT_FAILURE;
- }
-
- ::Server app(dbPath);
+ ::Server app;
int rc = app.main(argc, argv);
XMLPlatformUtils::Terminate();
@@ -154,10 +117,12 @@ void
}
int
-::Server::runFreeze(int argc, char* argv[], const DBEnvironmentPtr& dbEnv)
+::Server::run(int argc, char* argv[])
{
PropertiesPtr properties = communicator()->getProperties();
+ communicator()->setDefaultLocator(0);
+
StringSeq args = argsToStringSeq(argc, argv);
args = properties->parseCommandLineOptions("IcePack", args);
args = properties->parseCommandLineOptions("Freeze", args);
@@ -206,22 +171,40 @@ int
}
}
- string locatorEndpoints = properties->getProperty("IcePack.Locator.Endpoints");
- if(locatorEndpoints.empty())
+ //
+ // Check that required properties are set and valid.
+ //
+ if(properties->getProperty("IcePack.Locator.Endpoints").empty())
{
cerr << appName() << ": property `IcePack.Locator.Endpoints' is not set" << endl;
return EXIT_FAILURE;
}
-
- string locatorRegistryEndpoints = properties->getProperty("IcePack.LocatorRegistry.Endpoints");
- if(locatorRegistryEndpoints.empty())
+ if(properties->getProperty("IcePack.LocatorRegistry.Endpoints").empty())
{
cerr << appName() << ": property `IcePack.LocatorRegistry.Endpoints' is not set" << endl;
return EXIT_FAILURE;
}
-
- string adminEndpoints = properties->getProperty("IcePack.Admin.Endpoints");
- if(!adminEndpoints.empty())
+ if(properties->getProperty("IcePack.Data").empty())
+ {
+ cerr << argv[0] << ": property `IcePack.Data' is not set" << endl;
+ return EXIT_FAILURE;
+ }
+ else
+ {
+ struct stat filestat;
+ if(stat(properties->getProperty("IcePack.Data").c_str(), &filestat) != 0)
+ {
+ cerr << argv[0] << ": failed to check if property `IcePack.Data' is set to a directory path: "
+ << strerror(getSystemErrno()) << endl;
+ return EXIT_FAILURE;
+ }
+ if(!S_ISDIR(filestat.st_mode))
+ {
+ cerr << argv[0] << ": property `IcePack.Data' is not set to a directory path" << endl;
+ return EXIT_FAILURE;
+ }
+ }
+ if(!properties->getProperty("IcePack.Admin.Endpoints").empty())
{
if(!nowarn)
{
@@ -229,137 +212,262 @@ int
}
}
- string locatorId = properties->getPropertyWithDefault("IcePack.Locator.Identity", "IcePack/locator");
- string locatorRegistryId = properties->getPropertyWithDefault("IcePack.LocatorRegistry.Identity",
- "IcePack/locatorregistry");
- string adminId = properties->getPropertyWithDefault("IcePack.Admin.Identity", "IcePack/admin");
-
- communicator()->getProperties()->setProperty("Ice.Default.Locator", locatorId + ":" + locatorEndpoints);
-
//
- // An internal object adapter for internal objects which are not
- // exposed to the outside world. They might be at one point.
+ // We need another communicator for two reasons:
//
- ObjectAdapterPtr internalAdapter = communicator()->createObjectAdapterWithEndpoints("IcePack.Internal", "");
- internalAdapter->setLocator(0);
-
+ // We need a separate thread pool to dispatch the locator registry
+ // incoming calls to avoid deadlocks (where a client makes a
+ // request on the locator which in turn causes the activation of a
+ // server which invoke on the locator registry interface).
//
- // Creates and register the adapter manager.
+ // We need to make collocated calls on the internal objects after
+ // shutdown.
//
- AdapterManagerPtr adapterManager = new AdapterManagerI(internalAdapter, dbEnv);
- AdapterManagerPrx adapterManagerProxy =
- AdapterManagerPrx::uncheckedCast(internalAdapter->add(adapterManager,
- stringToIdentity("IcePack/adaptermanager")));
+ int dummyArgc = 0;
+ char **dummyArgv = 0;
+ Ice::CommunicatorPtr backendCommunicator = Ice::initialize(dummyArgc, dummyArgv, communicator()->getProperties());
+
+ int status = EXIT_SUCCESS;
+
+ try
+ {
+ //
+ // Initialize internal objects and external interfaces.
+ //
+ initInternal(backendCommunicator);
+ initLocatorRegistry(backendCommunicator);
+ initLocator(communicator());
+ initAdmin(communicator(), backendCommunicator);
+
+
+ //
+ // Deploy application descriptor if a descriptor is passed as
+ // a command line option.
+ //
+ if(!descriptor.empty())
+ {
+ try
+ {
+ _admin->addApplication(descriptor, targets);
+ }
+ catch(const ServerDeploymentException& ex)
+ {
+ cerr << appName() << ": warning: failed to deploy application " << descriptor << ":" << endl;
+ cerr << ex << ": " << ex.server << ": " << ex.reason << endl;
+ }
+ catch(const DeploymentException& ex)
+ {
+ cerr << appName() << ": warning: failed to deploy application " << descriptor << ":" << endl;
+ cerr << ex << ": " << ex.component << ": " << ex.reason << endl;
+ }
+ }
+
+ string bundleName = properties->getProperty("IcePack.PrintServersReady");
+ if(!bundleName.empty())
+ {
+ cout << bundleName << " ready" << endl;
+ }
+
+ shutdownOnInterrupt();
+ communicator()->waitForShutdown();
+ ignoreInterrupt();
+ }
+ catch(const DBException& ex)
+ {
+ cerr << appName() << ": " << ex << ": " << ex.message << endl;
+ status = EXIT_FAILURE;
+ }
+ catch(const Exception& ex)
+ {
+ cerr << appName() << ": " << ex << endl;
+ status = EXIT_FAILURE;
+ }
+ catch(...)
+ {
+ cerr << appName() << ": unknown exception" << endl;
+ status = EXIT_FAILURE;
+ }
+
+ try
+ {
+ //
+ // Destroy and join with activator, must be done before shutting
+ // down the backend communicator since invocation on collocated
+ // objects are done while deactivating the servers.
+ //
+ if(_activator)
+ {
+ _activator->destroy();
+ _activator = 0;
+ }
+
+ _adapterManager = 0;
+ _serverManager = 0;
+ _admin = 0;
+ _locator = 0;
+ _locatorRegistry = 0;
+
+ //
+ // Shutdown the backend communicator. This cause the internal
+ // adapter to evict all its objects and save their state to
+ // the database. This needs to be done before destroying the
+ // database environment.
+ //
+ backendCommunicator->shutdown();
+ backendCommunicator->waitForShutdown();
+
+ if(_dbEnv)
+ {
+ _dbEnv->close();
+ _dbEnv = 0;
+ }
+
+ backendCommunicator->destroy();
+ backendCommunicator = 0;
+ }
+ catch(const DBException& ex)
+ {
+ cerr << appName() << ": " << ex << ": " << ex.message << endl;
+ status = EXIT_FAILURE;
+ }
+
+ return status;
+}
+
+//
+// Initialize internal objects: the adapter manager, the server
+// manager and the activator.
+//
+void
+::Server::initInternal(const CommunicatorPtr& communicator)
+{
+ PropertiesPtr properties = communicator->getProperties();
+
+ TraceLevelsPtr traceLevels = new TraceLevels(properties, communicator->getLogger());
//
- // Activator and server manager are not supported on Windows yet.
+ // Creates subdirectories db and servers if they don't already
+ // exist.
//
- ServerManagerPrx serverManagerProxy;
+ string dataPath = properties->getProperty("IcePack.Data");
+ if(dataPath[dataPath.length() - 1] != '/')
+ {
+ dataPath += "/";
+ }
-#ifndef _WIN32
+ string dbPath = dataPath + "db";
+ string serversPath = dataPath + "servers";
+
+ struct stat filestat;
+ if(stat(dbPath.c_str(), &filestat) != 0)
+ {
+ mkdir(dbPath.c_str(), 0755);
+ }
+
+ if(stat(serversPath.c_str(), &filestat) != 0)
+ {
+ mkdir(serversPath.c_str(), 0755);
+ }
+
+ _dbEnv = Freeze::initialize(communicator, dbPath);
+
+ ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("IcePackInternalAdapter", "");
+ adapter->setLocator(0);
- ActivatorIPtr activator = new ActivatorI(communicator());
+ Ice::ObjectPrx object;
+
+ ActivatorIPtr activator = new ActivatorI(communicator, traceLevels);
activator->start();
- ActivatorPrx activatorProxy = ActivatorPrx::uncheckedCast(internalAdapter->add(activator,
- stringToIdentity("IcePack/activator")));
+ _activator = activator;
- ServerManagerPtr serverManager = new ServerManagerI(internalAdapter, dbEnv, adapterManagerProxy, activatorProxy);
- serverManagerProxy =
- ServerManagerPrx::uncheckedCast(internalAdapter->add(serverManager,
- stringToIdentity("IcePack/servermanager")));
- internalAdapter->activate();
+ AdapterManagerPtr adapterManager = new AdapterManagerI(adapter, traceLevels, _dbEnv);
+ object = adapter->add(adapterManager, stringToIdentity("IcePack/AdapterManager"));
+ _adapterManager = AdapterManagerPrx::uncheckedCast(object);
-#endif
+ ServerManagerPtr serverManager = new ServerManagerI(adapter, traceLevels, _dbEnv, _adapterManager, _activator);
+ object = adapter->add(serverManager, stringToIdentity("IcePack/ServerManager"));
+ _serverManager = ServerManagerPrx::uncheckedCast(object);
- //
- // Create the "IcePack.Admin" object adapter and register the
- // admin object. The admin object is used by icepackadmin to
- // administrate IcePack.
- //
- ObjectAdapterPtr adminAdapter = communicator()->createObjectAdapterWithEndpoints("IcePack.Admin", adminEndpoints);
- AdminPtr admin = new AdminI(communicator(), serverManagerProxy, adapterManagerProxy);
- adminAdapter->add(admin, stringToIdentity(adminId));
+ adapter->activate();
+}
- //
- // Create the "IcePack.LocatorRegistry" object adapter and
- // registry the locator registry object.
- //
- // The locator registry object provides an implementation of the
- // Ice::LocatorRegistry interface. This interface is used by Ice
- // servers to register their object adapters.
- //
- ObjectAdapterPtr locatorRegistryAdapter =
- communicator()->createObjectAdapterWithEndpoints("IcePack.LocatorRegistry", locatorRegistryEndpoints);
- locatorRegistryAdapter->setLocator(0);
- LocatorRegistryPtr locatorRegistry = new LocatorRegistryI(adapterManagerProxy);
- LocatorRegistryPrx locatorRegistryProxy =
- LocatorRegistryPrx::uncheckedCast(locatorRegistryAdapter->add(locatorRegistry,
- stringToIdentity(locatorRegistryId)));
+void
+::Server::initLocator(const CommunicatorPtr& communicator)
+{
+ assert(_adapterManager && _locatorRegistry);
+
+ PropertiesPtr properties = communicator->getProperties();
+
+ string endpoints = properties->getProperty("IcePack.Locator.Endpoints");
+ string id = properties->getPropertyWithDefault("IcePack.Locator.Identity", "IcePack/Locator");
//
// Create the "IcePack.Locator" object adapter and register the
// locator object.
//
- // The locator locator object provides an implementation of the
+ // The locator object provides an implementation of the
// Ice::Locator interface. This interface is used by Ice clients
// to locate object adapters and their associated endpoints.
//
- LocatorPtr locator = new LocatorI(adapterManagerProxy, locatorRegistryProxy);
- ObjectAdapterPtr locatorAdapter = communicator()->createObjectAdapterWithEndpoints("IcePack.Locator",
- locatorEndpoints);
- locatorAdapter->setLocator(0);
- LocatorPrx locatorProxy = LocatorPrx::uncheckedCast(locatorAdapter->add(locator, stringToIdentity(locatorId)));
+ ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("IcePackLocatorAdapter", endpoints);
+ adapter->setLocator(0);
- //
- // Set the locator for the admin object adapter.
- //
- adminAdapter->setLocator(locatorProxy);
+ LocatorPtr locator = new LocatorI(_adapterManager, _locatorRegistry);
+ _locator = LocatorPrx::uncheckedCast(adapter->add(locator, stringToIdentity(id)));
- //
- // Activate adapters.
- //
- adminAdapter->activate();
- locatorRegistryAdapter->activate();
- locatorAdapter->activate();
+ adapter->activate();
+}
+
+void
+::Server::initLocatorRegistry(const CommunicatorPtr& communicator)
+{
+ assert(_adapterManager);
+
+ PropertiesPtr properties = communicator->getProperties();
+
+ string endpoints = properties->getProperty("IcePack.LocatorRegistry.Endpoints");
+ string id = properties->getPropertyWithDefault("IcePack.LocatorRegistry.Identity", "IcePack/LocatorRegistry");
//
- // Deploy application desciptor.
+ // Create the "IcePack.LocatorRegistry" object adapter and
+ // register the locator registry object.
//
- if(!descriptor.empty())
- {
- try
- {
- admin->addApplication(descriptor, targets);
- }
- catch(const ServerDeploymentException& ex)
- {
- cerr << appName() << ": warning: failed to deploy application " << descriptor << ":" << endl;
- cerr << ex << ": " << ex.server << ": " << ex.reason << endl;
- }
- catch(const DeploymentException& ex)
- {
- cerr << appName() << ": warning: failed to deploy application " << descriptor << ":" << endl;
- cerr << ex << ": " << ex.component << ": " << ex.reason << endl;
- }
- }
+ // The locator registry object provides an implementation of the
+ // Ice::LocatorRegistry interface. This interface is used by Ice
+ // servers to register their object adapters.
+ //
+ ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("IcePackLocatorRegistryAdapter",
+ endpoints);
+ adapter->setLocator(0);
+ LocatorRegistryPtr locatorRegistry = new LocatorRegistryI(_adapterManager);
+ _locatorRegistry = LocatorRegistryPrx::uncheckedCast(adapter->add(locatorRegistry, stringToIdentity(id)));
- string bundleName = properties->getProperty("IcePack.PrintServersReady");
- if(!bundleName.empty())
- {
- cout << bundleName << " ready" << endl;
- }
+ adapter->activate();
+}
- shutdownOnInterrupt();
- communicator()->waitForShutdown();
- ignoreInterrupt();
+void
+::Server::initAdmin(const CommunicatorPtr& communicator, const CommunicatorPtr& backendCommunicator)
+{
+ assert(_serverManager && _adapterManager && _locator);
+
+ PropertiesPtr properties = communicator->getProperties();
-#ifndef _WIN32
//
- // Destroy and join with activator.
+ // The deployer get the locator proxy from the communicator
+ // properties.
//
- activator->destroy();
- activator->getThreadControl().join();
-#endif
+ properties->setProperty("Ice.Default.Locator", communicator->proxyToString(_locator));
+
+ backendCommunicator->setDefaultLocator(_locator);
+
+ string endpoints = properties->getProperty("IcePack.Admin.Endpoints");
+ string id = properties->getPropertyWithDefault("IcePack.Admin.Identity", "IcePack/Admin");
+
+ ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("IcePackAdminAdapter", endpoints);
+ AdminPtr admin = new AdminI(communicator, backendCommunicator, _serverManager, _adapterManager);
+ _admin = AdminPrx::uncheckedCast(adapter->add(admin, stringToIdentity(id)));
+
+ _locatorRegistry->addAdapter("IcePackAdminAdapter", adapter->createProxy(stringToIdentity("dummy")));
- return EXIT_SUCCESS;
+ adapter->activate();
}
diff --git a/cpp/src/IcePack/ServerDeployer.cpp b/cpp/src/IcePack/ServerDeployer.cpp
index 636ee0ac022..ba2f94f32d5 100644
--- a/cpp/src/IcePack/ServerDeployer.cpp
+++ b/cpp/src/IcePack/ServerDeployer.cpp
@@ -363,7 +363,7 @@ IcePack::ServerDeployer::addAdapter(const string& name, const string& endpoints)
if(_automaticActivation)
{
desc.server = ServerPrx::uncheckedCast(
- _communicator->stringToProxy("server/" + _description.name + "@IcePack.Internal"));
+ _communicator->stringToProxy("server/" + _description.name + "@IcePackInternalAdapter"));
_description.adapters.push_back(desc.name);
}
@@ -404,8 +404,7 @@ IcePack::ServerDeployer::addService(const string& name, const string& descriptor
ServiceDeployer* task = new ServiceDeployer(_communicator, *this, variables, componentPath, _targets);
try
{
- string xmlFile = descriptor[0] != '/' ? _variables["basedir"] + "/" + descriptor : descriptor;
- task->parse(xmlFile);
+ task->parse(toLocation(descriptor));
}
catch(const ParserDeploymentException& ex)
{
@@ -437,12 +436,15 @@ IcePack::ServerDeployer::setKind(ServerDeployer::ServerKind kind)
{
throw DeploySAXParseException("C++ server path is not specified", _locator);
}
-
+ _description.isIceBox = false;
+ break;
+
case ServerKindJavaServer:
if(_description.path.empty())
{
_description.path = "java";
}
+ _description.isIceBox = false;
break;
case ServerKindJavaIceBox:
@@ -450,6 +452,7 @@ IcePack::ServerDeployer::setKind(ServerDeployer::ServerKind kind)
{
_description.path = "java";
}
+ _description.isIceBox = true;
_className = "IceBox.Server";
createDirectory("/dbs");
addProperty("IceBox.Name", _variables["name"]);
@@ -461,6 +464,7 @@ IcePack::ServerDeployer::setKind(ServerDeployer::ServerKind kind)
{
_description.path = "icebox";
}
+ _description.isIceBox = true;
createDirectory("/dbs");
addProperty("IceBox.Name", _variables["name"]);
addAdapter(_variables["name"] + ".ServiceManagerAdapter","");
diff --git a/cpp/src/IcePack/ServerManager.ice b/cpp/src/IcePack/ServerManager.ice
index de78c865d2d..d1f1ac581f5 100644
--- a/cpp/src/IcePack/ServerManager.ice
+++ b/cpp/src/IcePack/ServerManager.ice
@@ -40,6 +40,15 @@ class Server
/**
*
+ * Stop the server. This methods returns only when the server is
+ * deactivated. If the server doesn't stop after a configurable
+ * amount of time, it will be killed.
+ *
+ **/
+ void stop();
+
+ /**
+ *
* This method is called by the activator when it detects that the
* server has terminated.
*
@@ -55,7 +64,7 @@ class Server
/**
*
- * Set the server pid.
+ * Get the server pid.
*
**/
int getPid();
@@ -83,7 +92,8 @@ class ServerManager
*
**/
Server* create(ServerDescription desc)
- throws DeploymentException, ServerExistsException;
+ throws ServerExistsException;
+
/**
*
diff --git a/cpp/src/IcePack/ServerManagerI.cpp b/cpp/src/IcePack/ServerManagerI.cpp
index 9889ef68a44..4663853b87b 100644
--- a/cpp/src/IcePack/ServerManagerI.cpp
+++ b/cpp/src/IcePack/ServerManagerI.cpp
@@ -17,6 +17,8 @@
#include <IcePack/AdapterManager.h>
#include <IcePack/Activator.h>
#include <IcePack/ServerDeployer.h>
+#include <IcePack/TraceLevels.h>
+#include <IceBox/IceBox.h>
using namespace std;
using namespace Ice;
@@ -52,8 +54,9 @@ class ServerFactory : public ObjectFactory
{
public:
- ServerFactory(const ObjectAdapterPtr& adapter, const ActivatorPrx& activator) :
+ ServerFactory(const ObjectAdapterPtr& adapter, const TraceLevelsPtr& traceLevels, const ActivatorPtr& activator) :
_adapter(adapter),
+ _traceLevels(traceLevels),
_activator(activator)
{
}
@@ -62,7 +65,7 @@ public:
create(const std::string& type)
{
assert(type == "::IcePack::Server");
- return new ServerI(_adapter, _activator);
+ return new ServerI(_adapter, _traceLevels, _activator);
}
virtual void
@@ -75,17 +78,21 @@ public:
private:
ObjectAdapterPtr _adapter;
- ActivatorPrx _activator;
+ TraceLevelsPtr _traceLevels;
+ ActivatorPtr _activator;
};
}
-IcePack::ServerI::ServerI(const ObjectAdapterPtr& adapter, const ActivatorPrx& activator) :
+IcePack::ServerI::ServerI(const ObjectAdapterPtr& adapter, const TraceLevelsPtr& traceLevels,
+ const ActivatorPtr& activator) :
_adapter(adapter),
+ _traceLevels(traceLevels),
_activator(activator),
_state(Inactive),
_pid(0)
{
+ assert(_activator);
}
IcePack::ServerI::~ServerI()
@@ -104,11 +111,6 @@ IcePack::ServerI::start(const Current&)
while(true)
{
IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this);
- if(!_activator)
- {
- return false;
- }
-
switch(_state)
{
case Inactive:
@@ -122,19 +124,22 @@ IcePack::ServerI::start(const Current&)
continue;
}
case Active:
- {
- return true; // Raise an exception instead?
- }
case Deactivating:
{
- wait();
- continue;
+ return true; // Raise an exception instead?
}
case Destroyed:
{
throw ObjectNotExistException(__FILE__,__LINE__);
}
}
+
+ if(_traceLevels->serverMgr > 2)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "changed server `" << description.name << "' state to `Activating'";
+ }
+ assert(_state == Activating);
break;
}
@@ -157,14 +162,203 @@ IcePack::ServerI::start(const Current&)
}
void
-IcePack::ServerI::terminationCallback(const Current&)
+IcePack::ServerI::stop(const Current&)
{
+ while(true)
+ {
+ IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this);
+ switch(_state)
+ {
+ case Inactive:
+ {
+ return;
+ }
+ case Activating:
+ {
+ wait(); // TODO: Timeout?
+ continue;
+ }
+ case Active:
+ {
+ _state = Deactivating;
+ break;
+ }
+ case Deactivating:
+ {
+ wait();
+ continue;
+ }
+ case Destroyed:
+ {
+ throw ObjectNotExistException(__FILE__,__LINE__);
+ }
+ }
+
+ if(_traceLevels->serverMgr > 2)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "changed server `" << description.name << "' state to `Deactivating'";
+ }
+ assert(_state == Deactivating);
+ break;
+ }
+
+ Ice::PropertiesPtr properties = _adapter->getCommunicator()->getProperties();
+ Int waitTime = properties->getPropertyAsIntWithDefault("IcePack.Activation.WaitTime", 60);
+
+ //
+ // If the server is an icebox, first try to use the IceBox service
+ // manager to shutdown the server.
+ //
+ bool deactivate = true;
+
+ if(description.isIceBox)
+ {
+ try
+ {
+ Ice::ObjectPrx object = _adapter->getCommunicator()->stringToProxy(
+ description.name + ".ServiceManager@" + description.name + ".ServiceManagerAdapter");
+
+ if(object)
+ {
+ IceBox::ServiceManagerPrx serviceManager =
+ IceBox::ServiceManagerPrx::uncheckedCast(object->ice_timeout(waitTime));
+
+ if(serviceManager)
+ {
+ serviceManager->shutdown();
+
+ //
+ // No need to deactivate the process by sending a signal
+ // since we successfully called shutdown on the service
+ // manager.
+ //
+ deactivate = false;
+ }
+ }
+ }
+ catch(const Ice::LocalException& ex)
+ {
+ if(_traceLevels->serverMgr > 1)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "couldn't contact the IceBox `" << description.name << "' service manager:\n";
+ out << ex;
+ }
+ }
+
+ }
+
+ if(deactivate)
+ {
+ //
+ // Deactivate the server by sending a SIGTERM.
+ //
+ try
+ {
+ _activator->deactivate(ServerNameToServer(_adapter)(description.name));
+ }
+ catch (const SystemException& ex)
+ {
+ Warning out(_adapter->getCommunicator()->getLogger());
+ out << "deactivation failed for server `" << description.name << "':\n";
+ out << ex;
+
+ setState(Active);
+ return;
+ }
+ }
+
+ //
+ // Wait for the server to be inactive (the activator monitors the
+ // process and should notify us when it detects the process
+ // termination by calling the terminationCallback() method).
//
- // Callback from the activator indicating that the server
- // stopped. Change state to deactivating while we mark the server
- // adapters as inactive.
+ {
+ IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this);
+ while(true)
+ {
+ if(_state == Inactive)
+ {
+ //
+ // State changed to inactive, the server has been
+ // correctly deactivated, we can return.
+ //
+ return;
+ }
+
+ //
+ // Wait for a state change.
+ //
+ bool notify = timedWait(IceUtil::Time::seconds(waitTime));
+ if(!notify)
+ {
+ //
+ // Timeout.
+ //
+ assert(_state == Deactivating);
+ break;
+ }
+ }
+ }
+
+ if(_traceLevels->serverMgr > 1)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "gracefull server shutdown failed, killing server `" << description.name << "'";
+ }
+
//
- setState(Deactivating);
+ // The server is still not inactive, kill it.
+ //
+ try
+ {
+ _activator->kill(ServerNameToServer(_adapter)(description.name));
+ }
+ catch (const SystemException& ex)
+ {
+ Warning out(_adapter->getCommunicator()->getLogger());
+ out << "deactivation failed for server `" << description.name << "':\n";
+ out << ex;
+
+ setState(Active);
+ }
+}
+
+void
+IcePack::ServerI::terminationCallback(const Current&)
+{
+ while(true)
+ {
+ IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this);
+ switch(_state)
+ {
+ case Inactive:
+ case Activating:
+ case Destroyed:
+ {
+ assert(false);
+ }
+ case Active:
+ {
+ _state = Deactivating;
+
+ if(_traceLevels->serverMgr > 2)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "changed server `" << description.name << "' state to `Deactivating'";
+ }
+ break;
+ }
+ case Deactivating:
+ {
+ // Deactivation was initiated by stop().
+ break;
+ }
+ }
+ assert(_state == Deactivating);
+ break;
+ }
//
// Mark each adapter as inactive. adapters is immutable when
@@ -204,6 +398,33 @@ IcePack::ServerI::setState(ServerState state)
_state = state;
+ if(_traceLevels->serverMgr > 1)
+ {
+ if(_state == Active)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "changed server `" << description.name << "' state to `Active'";
+ }
+ else if(_state == Inactive)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "changed server `" << description.name << "' state to `Inactive'";
+ }
+ else if(_traceLevels->serverMgr > 2)
+ {
+ if(_state == Activating)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "changed server `" << description.name << "' state to `Activating'";
+ }
+ else if(_state == Deactivating)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "changed server `" << description.name << "' state to `Deactivating'";
+ }
+ }
+ }
+
notifyAll();
}
@@ -215,19 +436,21 @@ IcePack::ServerI::setPid(int pid)
}
IcePack::ServerManagerI::ServerManagerI(const ObjectAdapterPtr& adapter,
+ const TraceLevelsPtr& traceLevels,
const Freeze::DBEnvironmentPtr& dbEnv,
const AdapterManagerPrx& adapterManager,
- const ActivatorPrx& activator) :
+ const ActivatorPtr& activator) :
_adapter(adapter),
+ _traceLevels(traceLevels),
_adapterManager(adapterManager),
_activator(activator)
{
- ObjectFactoryPtr serverFactory = new ServerFactory(adapter, activator);
+ ObjectFactoryPtr serverFactory = new ServerFactory(adapter, _traceLevels, activator);
adapter->getCommunicator()->addObjectFactory(serverFactory, "::IcePack::Server");
Freeze::DBPtr dbServers = dbEnv->openDB("servers", true);
_evictor = dbServers->createEvictor(Freeze::SaveUponEviction);
- _evictor->setSize(100);
+ _evictor->setSize(1000);
_adapter->addServantLocator(_evictor, "server");
//
@@ -263,18 +486,27 @@ IcePack::ServerManagerI::create(const ServerDescription& desc, const Current&)
{
}
- ServerPtr serverI = new ServerI(_adapter, _activator);
+ ServerPtr serverI = new ServerI(_adapter, _traceLevels, _activator);
serverI->description = desc;
for(AdapterNames::const_iterator p = desc.adapters.begin(); p != desc.adapters.end(); ++p)
{
AdapterPrx adapter = _adapterManager->findByName(*p);
- serverI->adapters.push_back(adapter);
+ if(adapter)
+ {
+ serverI->adapters.push_back(adapter);
+ }
}
_evictor->createObject(server->ice_getIdentity(), serverI);
_serverNames.insert(desc.name);
+ if(_traceLevels->serverMgr > 0)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "added server `" << desc.name << "'";
+ }
+
return server;
}
@@ -310,9 +542,20 @@ IcePack::ServerManagerI::remove(const string& name, const Current&)
throw ServerNotExistException();
}
+ //
+ // Stop the server before removing it.
+ //
+ server->stop();
+
_evictor->destroyObject(server->ice_getIdentity());
_serverNames.erase(_serverNames.find(name));
+
+ if(_traceLevels->serverMgr > 0)
+ {
+ Ice::Trace out(_traceLevels->logger, _traceLevels->serverMgrCat);
+ out << "removed server `" << name << "'";
+ }
}
ServerNames
@@ -326,4 +569,3 @@ IcePack::ServerManagerI::getAll(const Current&)
return names;
}
-
diff --git a/cpp/src/IcePack/ServerManagerI.h b/cpp/src/IcePack/ServerManagerI.h
index 992a0560725..462db298267 100644
--- a/cpp/src/IcePack/ServerManagerI.h
+++ b/cpp/src/IcePack/ServerManagerI.h
@@ -21,15 +21,19 @@
namespace IcePack
{
+class TraceLevels;
+typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
+
class ServerI : public Server, public ::IceUtil::Monitor< ::IceUtil::Mutex>
{
public:
- ServerI(const ::Ice::ObjectAdapterPtr&, const ActivatorPrx&);
+ ServerI(const ::Ice::ObjectAdapterPtr&, const TraceLevelsPtr&, const ActivatorPtr&);
virtual ~ServerI();
virtual ServerDescription getServerDescription(const ::Ice::Current& = ::Ice::Current());
virtual bool start(const ::Ice::Current& = ::Ice::Current());
+ virtual void stop(const ::Ice::Current& = ::Ice::Current());
virtual void terminationCallback(const ::Ice::Current& = ::Ice::Current());
virtual ServerState getState(const ::Ice::Current& = ::Ice::Current());
virtual Ice::Int getPid(const ::Ice::Current& = ::Ice::Current());
@@ -40,7 +44,8 @@ public:
private:
::Ice::ObjectAdapterPtr _adapter;
- ActivatorPrx _activator;
+ TraceLevelsPtr _traceLevels;
+ ActivatorPtr _activator;
ServerState _state;
int _pid;
@@ -51,8 +56,9 @@ class ServerManagerI : public ServerManager, public IceUtil::Mutex
{
public:
- ServerManagerI(const Ice::ObjectAdapterPtr&, const Freeze::DBEnvironmentPtr&, const AdapterManagerPrx&,
- const ActivatorPrx&);
+ ServerManagerI(const Ice::ObjectAdapterPtr&, const TraceLevelsPtr&, const Freeze::DBEnvironmentPtr&,
+ const AdapterManagerPrx&, const ActivatorPtr&);
+
virtual ~ServerManagerI();
virtual ServerPrx create(const ServerDescription&, const ::Ice::Current&);
@@ -63,10 +69,11 @@ public:
private:
::Ice::ObjectAdapterPtr _adapter;
+ TraceLevelsPtr _traceLevels;
::Freeze::EvictorPtr _evictor;
::std::set< ::std::string> _serverNames;
AdapterManagerPrx _adapterManager;
- ActivatorPrx _activator;
+ ActivatorPtr _activator;
};
}
diff --git a/cpp/src/IcePack/ServiceDeployer.cpp b/cpp/src/IcePack/ServiceDeployer.cpp
index 429f5fcaab6..dd617279041 100644
--- a/cpp/src/IcePack/ServiceDeployer.cpp
+++ b/cpp/src/IcePack/ServiceDeployer.cpp
@@ -147,7 +147,7 @@ IcePack::ServiceDeployer::setDBEnv(const string& dir)
}
else
{
- path = dir[0] == '/' ? dir : _variables["basedir"] + "/" + dir;
+ path = toLocation(dir);
}
_serverDeployer.addProperty("IceBox.DBEnvName." + _variables["name"], path);
}
diff --git a/cpp/src/IcePack/TraceLevels.cpp b/cpp/src/IcePack/TraceLevels.cpp
new file mode 100644
index 00000000000..35f03f1ee7c
--- /dev/null
+++ b/cpp/src/IcePack/TraceLevels.cpp
@@ -0,0 +1,34 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <Ice/Properties.h>
+#include <IcePack/TraceLevels.h>
+
+using namespace std;
+using namespace IcePack;
+
+TraceLevels::TraceLevels(const Ice::PropertiesPtr& properties, const Ice::LoggerPtr& theLogger) :
+ serverMgr(0),
+ serverMgrCat("ServerManager"),
+ adapterMgr(0),
+ adapterMgrCat("AdapterManager"),
+ activator(0),
+ activatorCat("Activator"),
+ logger(theLogger)
+{
+ const string keyBase = "IcePack.Trace.";
+ const_cast<int&>(serverMgr) = properties->getPropertyAsInt(keyBase + serverMgrCat);
+ const_cast<int&>(adapterMgr) = properties->getPropertyAsInt(keyBase + adapterMgrCat);
+ const_cast<int&>(activator) = properties->getPropertyAsInt(keyBase + activatorCat);
+}
+
+TraceLevels::~TraceLevels()
+{
+}
diff --git a/cpp/src/IcePack/TraceLevels.h b/cpp/src/IcePack/TraceLevels.h
new file mode 100644
index 00000000000..dfe8e8425de
--- /dev/null
+++ b/cpp/src/IcePack/TraceLevels.h
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2002
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#ifndef ICE_PACK_TRACE_LEVELS_H
+#define ICE_PACK_TRACE_LEVELS_H
+
+#include <IceUtil/Shared.h>
+#include <Ice/PropertiesF.h>
+#include <Ice/LoggerF.h>
+
+namespace IcePack
+{
+
+class TraceLevels : public ::IceUtil::Shared
+{
+public:
+
+ TraceLevels(const ::Ice::PropertiesPtr&, const Ice::LoggerPtr&);
+ virtual ~TraceLevels();
+
+ const int serverMgr;
+ const char* serverMgrCat;
+
+ const int adapterMgr;
+ const char* adapterMgrCat;
+
+ const int activator;
+ const char* activatorCat;
+
+ const Ice::LoggerPtr logger;
+};
+
+typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
+
+} // End namespace IcePack
+
+#endif
diff --git a/cpp/test/IcePack/Makefile b/cpp/test/IcePack/Makefile
index 9d6ac10b9f0..cfabf83226d 100644
--- a/cpp/test/IcePack/Makefile
+++ b/cpp/test/IcePack/Makefile
@@ -12,7 +12,7 @@ top_srcdir = ../..
include $(top_srcdir)/config/Make.rules
-SUBDIRS = simple
+SUBDIRS = simple deployer
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
diff --git a/cpp/test/IcePack/deployer/.depend b/cpp/test/IcePack/deployer/.depend
new file mode 100644
index 00000000000..4df8a3e1b06
--- /dev/null
+++ b/cpp/test/IcePack/deployer/.depend
@@ -0,0 +1,7 @@
+Test.o: Test.cpp Test.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/InstanceF.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/Stream.h ../../../include/Ice/BuiltinSequences.h
+Client.o: Client.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../include/TestCommon.h Test.h
+AllTests.o: AllTests.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/IcePack/Admin.h ../../../include/Yellow/Yellow.h ../../include/TestCommon.h Test.h
+TestI.o: TestI.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h TestI.h Test.h
+Server.o: Server.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/Ice/Application.h TestI.h Test.h
+TestI.o: TestI.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h TestI.h Test.h
+Service.o: Service.cpp ../../../include/Ice/Ice.h ../../../include/Ice/Initialize.h ../../../include/Ice/CommunicatorF.h ../../../include/Ice/LocalObjectF.h ../../../include/Ice/Handle.h ../../../include/IceUtil/Handle.h ../../../include/IceUtil/Exception.h ../../../include/IceUtil/Config.h ../../../include/Ice/Config.h ../../../include/Ice/ProxyF.h ../../../include/Ice/ProxyHandle.h ../../../include/Ice/ObjectF.h ../../../include/Ice/Exception.h ../../../include/Ice/LocalObject.h ../../../include/IceUtil/Shared.h ../../../include/Ice/StreamF.h ../../../include/Ice/PropertiesF.h ../../../include/Ice/InstanceF.h ../../../include/Ice/BuiltinSequences.h ../../../include/Ice/Proxy.h ../../../include/IceUtil/Mutex.h ../../../include/IceUtil/Lock.h ../../../include/Ice/ProxyFactoryF.h ../../../include/Ice/ConnectionF.h ../../../include/Ice/EndpointF.h ../../../include/Ice/ObjectAdapterF.h ../../../include/Ice/ReferenceF.h ../../../include/Ice/Current.h ../../../include/Ice/Identity.h ../../../include/Ice/Facet.h ../../../include/Ice/Object.h ../../../include/Ice/Outgoing.h ../../../include/IceUtil/Monitor.h ../../../include/IceUtil/Cond.h ../../../include/IceUtil/Time.h ../../../include/Ice/BasicStream.h ../../../include/Ice/Buffer.h ../../../include/Ice/ObjectFactoryF.h ../../../include/Ice/Incoming.h ../../../include/Ice/Direct.h ../../../include/Ice/ServantLocatorF.h ../../../include/Ice/LocalException.h ../../../include/Ice/Properties.h ../../../include/Ice/Logger.h ../../../include/Ice/LoggerUtil.h ../../../include/Ice/LoggerF.h ../../../include/Ice/Communicator.h ../../../include/Ice/UserExceptionFactoryF.h ../../../include/Ice/RouterF.h ../../../include/Ice/LocatorF.h ../../../include/Ice/PluginF.h ../../../include/Ice/ObjectFactory.h ../../../include/Ice/UserExceptionFactory.h ../../../include/Ice/ObjectAdapter.h ../../../include/Ice/ServantLocator.h ../../../include/Ice/IdentityUtil.h ../../../include/IceBox/IceBox.h ../../../include/Freeze/DB.h ../../../include/Freeze/DBException.h ../../../include/Freeze/DBF.h ../../../include/Freeze/EvictorF.h ../../../include/Freeze/Freeze.h ../../../include/Freeze/Initialize.h ../../../include/Freeze/Evictor.h ../../../include/Freeze/Map.h TestI.h Test.h
diff --git a/cpp/test/IcePack/deployer/AllTests.cpp b/cpp/test/IcePack/deployer/AllTests.cpp
new file mode 100644
index 00000000000..28ac9beb5cf
--- /dev/null
+++ b/cpp/test/IcePack/deployer/AllTests.cpp
@@ -0,0 +1,159 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <Ice/BuiltinSequences.h>
+#include <Ice/IdentityUtil.h>
+#include <IcePack/Admin.h>
+#include <Yellow/Yellow.h>
+#include <TestCommon.h>
+#include <Test.h>
+
+using namespace std;
+
+struct ProxyIdentityEqual : public std::binary_function<Ice::ObjectPrx,string,bool>
+{
+
+public:
+
+ bool
+ operator()(const Ice::ObjectPrx& p1, const string& id) const
+ {
+ return p1->ice_getIdentity() == Ice::stringToIdentity(id);
+ }
+};
+
+void
+allCommonTests(const Ice::CommunicatorPtr& communicator)
+{
+ IcePack::AdminPrx admin = IcePack::AdminPrx::checkedCast(
+ communicator->stringToProxy("IcePack/Admin@IcePackAdminAdapter"));
+ test(admin);
+
+ cout << "test server registration..." << flush;
+ IcePack::ServerNames serverNames = admin->getAllServerNames();
+ test(find(serverNames.begin(), serverNames.end(), "Server1") != serverNames.end());
+ test(find(serverNames.begin(), serverNames.end(), "Server2") != serverNames.end());
+ test(find(serverNames.begin(), serverNames.end(), "IceBox1") != serverNames.end());
+ test(find(serverNames.begin(), serverNames.end(), "IceBox2") != serverNames.end());
+ cout << "ok" << endl;
+
+ cout << "testing adapter registration... " << flush;
+ IcePack::AdapterNames adapterNames = admin->getAllAdapterNames();
+ test(find(adapterNames.begin(), adapterNames.end(), "Server1Adapter") != adapterNames.end());
+ test(find(adapterNames.begin(), adapterNames.end(), "Server2Adapter") != adapterNames.end());
+ test(find(adapterNames.begin(), adapterNames.end(), "IceBox1Service1Adapter") != adapterNames.end());
+ test(find(adapterNames.begin(), adapterNames.end(), "IceBox1Service2Adapter") != adapterNames.end());
+ test(find(adapterNames.begin(), adapterNames.end(), "IceBox2Service1Adapter") != adapterNames.end());
+ test(find(adapterNames.begin(), adapterNames.end(), "IceBox2Service2Adapter") != adapterNames.end());
+ cout << "ok" << endl;
+
+ Yellow::QueryPrx yellow = Yellow::QueryPrx::checkedCast(
+ communicator->stringToProxy("Yellow/Query@YellowQueryAdapter"));
+ test(yellow);
+
+ cout << "testing offer registration... " << flush;
+ Ice::ObjectProxySeq offers = yellow->lookupAll("::Test");
+ test(find_if(offers.begin(), offers.end(), bind2nd(ProxyIdentityEqual(),"Server1")) != offers.end());
+ test(find_if(offers.begin(), offers.end(), bind2nd(ProxyIdentityEqual(),"Server2")) != offers.end());
+ test(find_if(offers.begin(), offers.end(), bind2nd(ProxyIdentityEqual(),"IceBox1Service1")) != offers.end());
+ test(find_if(offers.begin(), offers.end(), bind2nd(ProxyIdentityEqual(),"IceBox1Service2")) != offers.end());
+ test(find_if(offers.begin(), offers.end(), bind2nd(ProxyIdentityEqual(),"IceBox2Service1")) != offers.end());
+ test(find_if(offers.begin(), offers.end(), bind2nd(ProxyIdentityEqual(),"IceBox2Service2")) != offers.end());
+
+ cout << "ok" << endl;
+}
+
+void
+allTests(const Ice::CommunicatorPtr& communicator)
+{
+ allCommonTests(communicator);
+
+ //
+ // Ensure that all server and service objects are reachable.
+ //
+ // The identity for the test object in deployed server or services
+ // is the name of the service or server. The object adapter name
+ // is Adapter prefixed with the name of the service or
+ // server. Ensure we can reach each object.
+ //
+ cout << "pinging server objects... " << flush;
+
+ TestPrx obj;
+
+ obj = TestPrx::checkedCast(communicator->stringToProxy("Server1@Server1Adapter"));
+ obj = TestPrx::checkedCast(communicator->stringToProxy("Server2@Server2Adapter"));
+ obj = TestPrx::checkedCast(communicator->stringToProxy("IceBox1Service1@IceBox1Service1Adapter"));
+ obj = TestPrx::checkedCast(communicator->stringToProxy("IceBox1Service2@IceBox1Service2Adapter"));
+ obj = TestPrx::checkedCast(communicator->stringToProxy("IceBox2Service1@IceBox2Service1Adapter"));
+ obj = TestPrx::checkedCast(communicator->stringToProxy("IceBox2Service2@IceBox2Service2Adapter"));
+
+ cout << "ok" << endl;
+
+ cout << "testing server configuration... " << flush;
+
+ obj = TestPrx::checkedCast(communicator->stringToProxy("Server1@Server1Adapter"));
+ test(obj->getProperty("Type") == "Server");
+ test(obj->getProperty("Name") == "Server1");
+
+ cout << "ok" << endl;
+
+ cout << "testing service configuration... " << flush;
+
+ obj = TestPrx::checkedCast(communicator->stringToProxy("IceBox1Service1@IceBox1Service1Adapter"));
+ test(obj->getProperty("IceBox1Service1.Type") == "standard");
+ test(obj->getProperty("IceBox1Service1.ServiceName") == "IceBox1Service1");
+
+ obj = TestPrx::checkedCast(communicator->stringToProxy("IceBox2Service2@IceBox2Service2Adapter"));
+ test(obj->getProperty("IceBox2Service2.Type") == "freeze");
+ test(obj->getProperty("IceBox2Service2.ServiceName") == "IceBox2Service2");
+
+ test(obj->getProperty("IceBox2Service2.DebugProperty") == "");
+ test(obj->getProperty("IceBox1Service1.DebugProperty") == "");
+
+ cout << "ok" << endl;
+}
+
+void
+allTestsWithTarget(const Ice::CommunicatorPtr& communicator)
+{
+ allCommonTests(communicator);
+
+ IcePack::AdminPrx admin = IcePack::AdminPrx::checkedCast(
+ communicator->stringToProxy("IcePack/Admin@IcePackAdminAdapter"));
+ test(admin);
+
+ cout << "pinging server objects... " << flush;
+
+ //
+ // Application is deployed with Server1.manual which disables on demand activation.
+ //
+ TestPrx obj;
+ try
+ {
+ obj = TestPrx::checkedCast(communicator->stringToProxy("Server1@Server1Adapter"));
+ test(false);
+ }
+ catch(const Ice::LocalException&)
+ {
+ }
+ admin->startServer("Server1");
+
+ obj = TestPrx::checkedCast(communicator->stringToProxy("Server2@Server2Adapter"));
+
+ cout << "ok" << endl;
+
+ cout << "testing service configuration... " << flush;
+
+ obj = TestPrx::checkedCast(communicator->stringToProxy("IceBox1Service1@IceBox1Service1Adapter"));
+ test(obj->getProperty("IceBox1Service1.DebugProperty") == "debug");
+
+ cout << "ok" << endl;
+}
diff --git a/cpp/test/IcePack/deployer/Client.cpp b/cpp/test/IcePack/deployer/Client.cpp
new file mode 100644
index 00000000000..9bb8f2d4217
--- /dev/null
+++ b/cpp/test/IcePack/deployer/Client.cpp
@@ -0,0 +1,80 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestCommon.h>
+#include <Test.h>
+
+using namespace std;
+
+int
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
+{
+ bool withTarget = false;
+ if(argc > 1)
+ {
+ int i = 1;
+ while(i < argc)
+ {
+ if(strcmp(argv[i], "-t") == 0)
+ {
+ withTarget = true;
+ break;
+ }
+ i++;
+ }
+ }
+
+ if(!withTarget)
+ {
+ void allTests(const Ice::CommunicatorPtr&);
+ allTests(communicator);
+ }
+ else
+ {
+ void allTestsWithTarget(const Ice::CommunicatorPtr&);
+ allTestsWithTarget(communicator);
+ }
+
+ return EXIT_SUCCESS;
+}
+
+int
+main(int argc, char* argv[])
+{
+ int status;
+ Ice::CommunicatorPtr communicator;
+
+ try
+ {
+ communicator = Ice::initialize(argc, argv);
+ status = run(argc, argv, communicator);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+
+ if(communicator)
+ {
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+ }
+
+ return status;
+}
diff --git a/cpp/test/IcePack/deployer/Makefile b/cpp/test/IcePack/deployer/Makefile
new file mode 100644
index 00000000000..88e4a8898c2
--- /dev/null
+++ b/cpp/test/IcePack/deployer/Makefile
@@ -0,0 +1,64 @@
+# **********************************************************************
+#
+# Copyright (c) 2001
+# Mutable Realms, Inc.
+# Huntsville, AL, USA
+#
+# All Rights Reserved
+#
+# **********************************************************************
+
+top_srcdir = ../../..
+
+CLIENT = client
+SERVER = server
+SERVICE = libTestService.so
+VERSIONED_SVC = $(SERVICE).$(VERSION)
+
+TARGETS = $(CLIENT) $(SERVER) $(SERVICE) $(VERSIONED_SVC)
+
+OBJS = Test.o
+
+COBJS = Client.o \
+ AllTests.o
+
+SOBJS = TestI.o \
+ Server.o
+
+SERVICE_OBJS = TestI.o \
+ Service.o
+
+SRCS = $(OBJS:.o=.cpp) \
+ $(COBJS:.o=.cpp) \
+ $(SOBJS:.o=.cpp) \
+ $(SERVICE_OBJS:.o=.cpp)
+
+include $(top_srcdir)/config/Make.rules
+
+CPPFLAGS := -I. -I../../include $(CPPFLAGS)
+
+$(CLIENT): $(OBJS) $(COBJS)
+ rm -f $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) -lIcePack -lYellow $(LIBS)
+
+$(SERVER): $(OBJS) $(SOBJS)
+ rm -f $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) $(LIBS)
+
+$(VERSIONED_SVC): $(OBJS) $(SERVICE_OBJS)
+ rm -f $@
+ $(CXX) -Xlinker -soname -Xlinker $(VERSIONED_SERVICE) $(LDFLAGS) -shared -o $@ $(OBJS) $(SERVICE_OBJS)
+
+$(SERVICE): $(VERSIONED_SVC)
+ rm -f $@
+ ln -s $(VERSIONED_SVC) $@
+
+
+Test.h Test.cpp: Test.ice $(SLICE2CPP)
+ rm -f Test.h Test.cpp
+ $(SLICE2CPP) Test.ice
+
+clean::
+ rm -f Test.h Test.cpp
+
+include .depend
diff --git a/cpp/test/IcePack/deployer/Server.cpp b/cpp/test/IcePack/deployer/Server.cpp
new file mode 100644
index 00000000000..c68f83839b4
--- /dev/null
+++ b/cpp/test/IcePack/deployer/Server.cpp
@@ -0,0 +1,47 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <Ice/Application.h>
+#include <TestI.h>
+
+using namespace std;
+
+class Server : public Ice::Application
+{
+public:
+
+ virtual int run(int argc, char* argv[]);
+
+};
+
+int
+::Server::run(int argc, char* argv[])
+{
+ Ice::PropertiesPtr properties = communicator()->getProperties();
+ string name = properties->getProperty("Ice.ProgramName");
+
+ Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter(name + "Adapter");
+ Ice::ObjectPtr object = new TestI(adapter, properties);
+ adapter->add(object, Ice::stringToIdentity(name));
+ adapter->activate();
+ shutdownOnInterrupt();
+ communicator()->waitForShutdown();
+ ignoreInterrupt();
+ return EXIT_SUCCESS;
+}
+
+int
+main(int argc, char* argv[])
+{
+ Server app;
+ int rc = app.main(argc, argv);
+ return rc;
+}
diff --git a/cpp/test/IcePack/deployer/Service.cpp b/cpp/test/IcePack/deployer/Service.cpp
new file mode 100644
index 00000000000..b1a54c8bc23
--- /dev/null
+++ b/cpp/test/IcePack/deployer/Service.cpp
@@ -0,0 +1,130 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <IceBox/IceBox.h>
+#include <Freeze/Freeze.h>
+#include <TestI.h>
+
+#if defined(_WIN32)
+# define TEST_SERVICE_API __declspec(dllexport)
+#else
+# define TEST_SERVICE_API /**/
+#endif
+
+using namespace std;
+using namespace Ice;
+
+class TEST_SERVICE_API ServiceI : public ::IceBox::Service
+{
+public:
+
+ ServiceI();
+ virtual ~ServiceI();
+
+ virtual void start(const string&,
+ const CommunicatorPtr&,
+ const PropertiesPtr&,
+ const StringSeq&);
+
+ virtual void stop();
+};
+
+class TEST_SERVICE_API FreezeServiceI : public ::IceBox::FreezeService
+{
+public:
+
+ FreezeServiceI();
+ virtual ~FreezeServiceI();
+
+ virtual void start(const string&,
+ const CommunicatorPtr&,
+ const PropertiesPtr&,
+ const StringSeq&,
+ const Freeze::DBEnvironmentPtr&);
+
+ virtual void stop();
+};
+
+extern "C"
+{
+
+//
+// Factory function
+//
+TEST_SERVICE_API ::IceBox::Service*
+create(CommunicatorPtr communicator)
+{
+ return new ServiceI;
+}
+
+TEST_SERVICE_API ::IceBox::FreezeService*
+createFreezeService(CommunicatorPtr communicator)
+{
+ return new FreezeServiceI;
+}
+
+}
+
+ServiceI::ServiceI()
+{
+}
+
+ServiceI::~ServiceI()
+{
+}
+
+void
+ServiceI::start(const string& name,
+ const CommunicatorPtr& communicator,
+ const PropertiesPtr& properties,
+ const StringSeq& args)
+{
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name + "Adapter");
+ Ice::ObjectPtr object = new TestI(adapter, properties);
+ adapter->add(object, Ice::stringToIdentity(name));
+ adapter->activate();
+}
+
+void
+ServiceI::stop()
+{
+}
+
+FreezeServiceI::FreezeServiceI()
+{
+}
+
+FreezeServiceI::~FreezeServiceI()
+{
+}
+
+void
+FreezeServiceI::start(const string& name,
+ const CommunicatorPtr& communicator,
+ const PropertiesPtr& properties,
+ const StringSeq& args,
+ const Freeze::DBEnvironmentPtr& dbEnv)
+{
+ //
+ // Ensure that we can create an environment.
+ //
+ Freeze::DBPtr db = dbEnv->openDB("testdb", true);
+
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name + "Adapter");
+ Ice::ObjectPtr object = new TestI(adapter, properties);
+ adapter->add(object, Ice::stringToIdentity(name));
+ adapter->activate();
+}
+
+void
+FreezeServiceI::stop()
+{
+}
diff --git a/cpp/test/IcePack/deployer/Test.ice b/cpp/test/IcePack/deployer/Test.ice
new file mode 100644
index 00000000000..6d4d1189b0d
--- /dev/null
+++ b/cpp/test/IcePack/deployer/Test.ice
@@ -0,0 +1,21 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+interface Test
+{
+ void shutdown();
+
+ string getProperty(string name);
+};
+
+#endif
diff --git a/cpp/test/IcePack/deployer/TestI.cpp b/cpp/test/IcePack/deployer/TestI.cpp
new file mode 100644
index 00000000000..57245e39a69
--- /dev/null
+++ b/cpp/test/IcePack/deployer/TestI.cpp
@@ -0,0 +1,30 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestI.h>
+
+TestI::TestI(const Ice::ObjectAdapterPtr& adapter, const Ice::PropertiesPtr& properties) :
+ _adapter(adapter),
+ _properties(properties)
+{
+}
+
+void
+TestI::shutdown(const Ice::Current&)
+{
+ _adapter->getCommunicator()->shutdown();
+}
+
+std::string
+TestI::getProperty(const std::string& name, const Ice::Current&)
+{
+ return _properties->getProperty(name);
+}
diff --git a/cpp/test/IcePack/deployer/TestI.h b/cpp/test/IcePack/deployer/TestI.h
new file mode 100644
index 00000000000..21870e8cde8
--- /dev/null
+++ b/cpp/test/IcePack/deployer/TestI.h
@@ -0,0 +1,31 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#ifndef TEST_I_H
+#define TEST_I_H
+
+#include <Test.h>
+
+class TestI : public Test
+{
+public:
+
+ TestI(const Ice::ObjectAdapterPtr&, const Ice::PropertiesPtr&);
+
+ virtual void shutdown(const Ice::Current&);
+ virtual std::string getProperty(const std::string&, const Ice::Current&);
+
+private:
+
+ Ice::ObjectAdapterPtr _adapter;
+ Ice::PropertiesPtr _properties;
+};
+
+#endif
diff --git a/cpp/test/IcePack/deployer/application.xml b/cpp/test/IcePack/deployer/application.xml
new file mode 100644
index 00000000000..ba7d00e63f9
--- /dev/null
+++ b/cpp/test/IcePack/deployer/application.xml
@@ -0,0 +1,10 @@
+<application>
+
+ <server name="Yellow" descriptor="yellow_icebox.xml"/>
+
+ <server name="IceBox1" descriptor="icebox.xml"/>
+ <server name="IceBox2" descriptor="icebox.xml"/>
+ <server name="Server1" binpath="server" descriptor="server.xml"/>
+ <server name="Server2" binpath="server" descriptor="server.xml"/>
+
+</application> \ No newline at end of file
diff --git a/cpp/test/IcePack/deployer/db/.dummy b/cpp/test/IcePack/deployer/db/.dummy
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/cpp/test/IcePack/deployer/db/.dummy
diff --git a/cpp/test/IcePack/deployer/db/db/.dummy b/cpp/test/IcePack/deployer/db/db/.dummy
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/cpp/test/IcePack/deployer/db/db/.dummy
diff --git a/cpp/test/IcePack/deployer/freezeservice.xml b/cpp/test/IcePack/deployer/freezeservice.xml
new file mode 100644
index 00000000000..5dd9940494e
--- /dev/null
+++ b/cpp/test/IcePack/deployer/freezeservice.xml
@@ -0,0 +1,18 @@
+<service kind="freeze" entry="TestService:createFreezeService">
+
+ <adapters>
+ <adapter name="${name}Adapter" endpoints="default">
+ <offer interface="::Test" identity="${name}"/>
+ </adapter>
+ </adapters>
+
+ <properties>
+ <property name="${name}.Type" value="freeze"/>
+ <property name="${name}.ServiceName" value="${name}"/>
+ </properties>
+
+ <target name="manual">
+ <property name="Mode" value="manual"/>
+ </target>
+
+</service> \ No newline at end of file
diff --git a/cpp/test/IcePack/deployer/icebox.xml b/cpp/test/IcePack/deployer/icebox.xml
new file mode 100644
index 00000000000..a1115a3a3ab
--- /dev/null
+++ b/cpp/test/IcePack/deployer/icebox.xml
@@ -0,0 +1,21 @@
+<server kind="cpp-icebox" endpoints="default">
+
+ <service name="${name}Service1" descriptor="service.xml"/>
+ <service name="${name}Service2" descriptor="freezeservice.xml"/>
+
+ <properties>
+ <property name="Ice.ConnectionWarnings" value="1"/>
+ </properties>
+
+ <target name="ssl">
+ <properties>
+ <property name="Ice.Plugin.IceSSL" value="IceSSL:create"/>
+ <property name="Ice.Default.Protocol" value="ssl"/>
+ <property name="IceSSL.Client.CertPath" location="../../../certs"/>
+ <property name="IceSSL.Client.Config" value="client_sslconfig.xml"/>
+ <property name="IceSSL.Server.CertPath" location="../../../certs"/>
+ <property name="IceSSL.Server.Config" value="server_sslconfig.xml"/>
+ </properties>
+ </target>
+
+</server> \ No newline at end of file
diff --git a/cpp/test/IcePack/deployer/icestorm_icebox.xml b/cpp/test/IcePack/deployer/icestorm_icebox.xml
deleted file mode 100644
index ffe5fa0e5ac..00000000000
--- a/cpp/test/IcePack/deployer/icestorm_icebox.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<server kind="cpp-icebox" endpoints="default">
-
-<services>
- <service name="AnIceStorm" descriptor="icestorm_service.xml"/>
- <service name="AnotherIceStorm" descriptor="icestorm_service.xml"/>
-</services>
-
-</server>
diff --git a/cpp/test/IcePack/deployer/icestorm_service.xml b/cpp/test/IcePack/deployer/icestorm_service.xml
deleted file mode 100644
index ae1007f1062..00000000000
--- a/cpp/test/IcePack/deployer/icestorm_service.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<service kind="freeze" entry="IceStormService:create" endpoints="default">
-
-<adapters>
- <adapter name="${name}.TopicManagerAdapter">
- <offer interface="::IceStorm::TopicManager" identity="${name}"/>
- </adapter>
-</adapters>
-
-<properties>
- <property name="${name}.TopicManager.Endpoints" value="default"/>
-
- <!-- FIXME: wrong configuration variable name for the topic manager -->
- <!-- object identity -->
- <property name="${name}.TopicManager" value="${name}"/>
-</properties>
-
-</service>
diff --git a/cpp/test/IcePack/deployer/run.py b/cpp/test/IcePack/deployer/run.py
new file mode 100755
index 00000000000..667ad26bc43
--- /dev/null
+++ b/cpp/test/IcePack/deployer/run.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2001
+# Mutable Realms, Inc.
+# Huntsville, AL, USA
+#
+# All Rights Reserved
+#
+# **********************************************************************
+
+import os, sys
+
+for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")):
+ break
+else:
+ raise "can't find toplevel directory!"
+
+sys.path.append(os.path.join(toplevel, "config"))
+import TestUtil
+import IcePackAdmin
+
+testdir = os.path.join(toplevel, "test", "IcePack", "deployer")
+
+
+os.environ['LD_LIBRARY_PATH'] = testdir + ":" + os.environ['LD_LIBRARY_PATH']
+
+#
+# Start the client.
+#
+def startClient(options):
+
+ updatedClientOptions = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel) + \
+ " --Ice.Default.Locator=\"IcePack/Locator:default -p 12346\" " + \
+ options
+
+ print "starting client...",
+ clientPipe = os.popen(os.path.join(testdir, "client") + updatedClientOptions)
+ print "ok"
+
+ for output in clientPipe.xreadlines():
+ print output,
+
+ clientStatus = clientPipe.close()
+ if clientStatus:
+ print "failed"
+
+if TestUtil.protocol == "ssl":
+ targets = "ssl"
+else:
+ targets = ""
+
+#
+# Start IcePack.
+#
+TestUtil.cleanDbDir(os.path.join(testdir, "db/db"))
+icePackPipe = IcePackAdmin.startIcePack(toplevel, "12346", testdir)
+
+#
+# Deploy the application, run the client and remove the application.
+#
+print "deploying application...",
+IcePackAdmin.addApplication(toplevel, os.path.join(testdir, "application.xml"), targets);
+print "ok"
+
+startClient("")
+
+print "removing application...",
+IcePackAdmin.removeApplication(toplevel, os.path.join(testdir, "application.xml"));
+print "ok"
+
+#
+# Deploy the application with some targets to test targets, run the
+# client to test targets (-t options) and remove the application.
+#
+print "deploying application with target...",
+IcePackAdmin.addApplication(toplevel, os.path.join(testdir, "application.xml"), targets + " debug Server1.manual");
+print "ok"
+
+startClient("-t")
+
+print "removing application...",
+IcePackAdmin.removeApplication(toplevel, os.path.join(testdir, "application.xml"));
+print "ok"
+
+#
+# Shutdown IcePack.
+#
+IcePackAdmin.shutdownIcePack(toplevel, icePackPipe)
+
+sys.exit(0)
diff --git a/cpp/test/IcePack/deployer/server.xml b/cpp/test/IcePack/deployer/server.xml
new file mode 100644
index 00000000000..ac21a8cbd0f
--- /dev/null
+++ b/cpp/test/IcePack/deployer/server.xml
@@ -0,0 +1,31 @@
+<server kind="cpp">
+
+ <target name="manual">
+ <activation mode="manual"/>
+ <property name="Mode" value="manual"/>
+ </target>
+
+ <adapters>
+ <adapter name="${name}Adapter" endpoints="default">
+ <offer interface="::Test" identity="${name}"/>
+ </adapter>
+ </adapters>
+
+ <properties>
+ <property name="Type" value="Server"/>
+ <property name="Name" value="${name}"/>
+ <property name="Ice.ConnectionWarnings" value="1"/>
+ </properties>
+
+ <target name="ssl">
+ <properties>
+ <property name="Ice.Plugin.IceSSL" value="IceSSL:create"/>
+ <property name="Ice.Default.Protocol" value="ssl"/>
+ <property name="IceSSL.Client.CertPath" location="../../../certs"/>
+ <property name="IceSSL.Client.Config" value="client_sslconfig.xml"/>
+ <property name="IceSSL.Server.CertPath" location="../../../certs"/>
+ <property name="IceSSL.Server.Config" value="server_sslconfig.xml"/>
+ </properties>
+ </target>
+
+</server> \ No newline at end of file
diff --git a/cpp/test/IcePack/deployer/service.xml b/cpp/test/IcePack/deployer/service.xml
new file mode 100644
index 00000000000..d62c74789b5
--- /dev/null
+++ b/cpp/test/IcePack/deployer/service.xml
@@ -0,0 +1,20 @@
+<service kind="standard" entry="TestService:create">
+
+ <adapters>
+ <adapter name="${name}Adapter" endpoints="default">
+ <offer interface="::Test" identity="${name}"/>
+ </adapter>
+ </adapters>
+
+ <properties>
+ <property name="${name}.Type" value="standard"/>
+ <property name="${name}.ServiceName" value="${name}"/>
+ </properties>
+
+ <target name="debug">
+ <properties>
+ <property name="${name}.DebugProperty" value="debug"/>
+ </properties>
+ </target>
+
+</service> \ No newline at end of file
diff --git a/cpp/test/IcePack/deployer/yellow_icebox.xml b/cpp/test/IcePack/deployer/yellow_icebox.xml
index 095e8bb0518..257a0a521cc 100644
--- a/cpp/test/IcePack/deployer/yellow_icebox.xml
+++ b/cpp/test/IcePack/deployer/yellow_icebox.xml
@@ -1,7 +1,18 @@
<server kind="cpp-icebox" endpoints="default">
+
+ <services>
+ <service name="Yellow" descriptor="yellow_service.xml"/>
+ </services>
-<services>
- <service name="Yellow" descriptor="yellow_service.xml"/>
-</services>
+ <target name="ssl">
+ <properties>
+ <property name="Ice.Plugin.IceSSL" value="IceSSL:create"/>
+ <property name="Ice.Default.Protocol" value="ssl"/>
+ <property name="IceSSL.Client.CertPath" location="../../../certs"/>
+ <property name="IceSSL.Client.Config" value="client_sslconfig.xml"/>
+ <property name="IceSSL.Server.CertPath" location="../../../certs"/>
+ <property name="IceSSL.Server.Config" value="server_sslconfig.xml"/>
+ </properties>
+ </target>
</server>
diff --git a/cpp/test/IcePack/simple/run.py b/cpp/test/IcePack/simple/run.py
index f1e00d3f108..508743bf808 100755
--- a/cpp/test/IcePack/simple/run.py
+++ b/cpp/test/IcePack/simple/run.py
@@ -26,11 +26,10 @@ name = os.path.join("IcePack", "simple")
testdir = os.path.join(toplevel, "test", "IcePack", "simple")
#
-# Add locator options for client and servers. All servers are now
-# clients since they need to make requests to IcePack.
+# Add locator options for the client and server. Since the server
+# invokes on the locator it's also considered to be a client.
#
-additionalOptions = " --Ice.Default.Locator=\"IcePack/locator:default -p 12346\" " + \
- "--Ice.Adapter.TestAdapter.Endpoints=default"
+additionalOptions = " --Ice.Default.Locator=\"IcePack/Locator:default -p 12346\""
TestUtil.cleanDbDir(os.path.join(testdir, "db/db"))
@@ -40,82 +39,49 @@ TestUtil.cleanDbDir(os.path.join(testdir, "db/db"))
icePackPipe = IcePackAdmin.startIcePack(toplevel, "12346", testdir)
#
-# Test client/server, collocated w/o automatic activation.
+# Test client/server, collocated without on demand activation.
#
TestUtil.mixedClientServerTestWithOptions(toplevel, name, additionalOptions, additionalOptions)
TestUtil.collocatedTestWithOptions(toplevel, name, additionalOptions)
#
-# Get adapter list, ensure that TestAdapter is in the list.
+# Remove the adapter (registered by the server) before deploying the
+# server.
#
-print "testing adapter registration...",
-hasTestAdapter = 0;
-icePackAdminPipe = IcePackAdmin.listAdapters(toplevel);
-for adaptername in icePackAdminPipe.xreadlines():
- if adaptername.strip() == "TestAdapter":
- hasTestAdapter = 1
-
-if hasTestAdapter == 0:
- print "failed!"
- TestUtil.killServers()
- sys.exit(1)
-
-icePackStatus = icePackAdminPipe.close()
-if icePackStatus:
- TestUtil.killServers()
- sys.exit(1)
-print "ok"
-
IcePackAdmin.removeAdapter(toplevel, "TestAdapter")
#
-# This test doesn't work under Windows.
+# Test client/server with on demand activation.
#
-if TestUtil.isWin32() == 0 and TestUtil.protocol != "ssl":
+server = os.path.join(testdir, "server")
+client = os.path.join(testdir, "client")
- server = os.path.join(testdir, "server")
- client = os.path.join(testdir, "client")
+if TestUtil.protocol == "ssl":
+ targets = "ssl"
+else:
+ targets = ""
- print "registering server with icepack...",
- IcePackAdmin.addServer(toplevel, "server", os.path.join(testdir, "simple_server.xml"), server, "", "");
- print "ok"
+print "registering server with icepack...",
+IcePackAdmin.addServer(toplevel, "server", os.path.join(testdir, "simple_server.xml"), server, "", targets);
+print "ok"
- print "testing adapter registration...",
- hasTestAdapter = 0;
- icePackAdminPipe = IcePackAdmin.listAdapters(toplevel);
- for adaptername in icePackAdminPipe.xreadlines():
- if adaptername.strip() == "TestAdapter":
- hasTestAdapter = 1
-
- if hasTestAdapter == 0:
- print "failed!"
- TestUtil.killServers()
- sys.exit(1)
-
- icePackStatus = icePackAdminPipe.close()
- if icePackStatus:
- TestUtil.killServers()
- sys.exit(1)
-
- print "ok"
-
- updatedClientOptions = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel) + additionalOptions
-
- print "starting client...",
- clientPipe = os.popen(client + updatedClientOptions)
- print "ok"
-
- for output in clientPipe.xreadlines():
- print output,
-
- clientStatus = clientPipe.close()
- if clientStatus:
- TestUtil.killServers()
- sys.exit(1)
+updatedClientOptions = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel) + additionalOptions
+
+print "starting client...",
+clientPipe = os.popen(client + updatedClientOptions)
+print "ok"
+
+for output in clientPipe.xreadlines():
+ print output,
- print "unregister server with icepack...",
- IcePackAdmin.removeServer(toplevel, "server");
- print "ok"
+clientStatus = clientPipe.close()
+if clientStatus:
+ TestUtil.killServers()
+ sys.exit(1)
+
+print "unregister server with icepack...",
+IcePackAdmin.removeServer(toplevel, "server");
+print "ok"
IcePackAdmin.shutdownIcePack(toplevel, icePackPipe)
diff --git a/cpp/test/IcePack/simple/simple_server.xml b/cpp/test/IcePack/simple/simple_server.xml
index 9b2268fb7c1..535ded622b5 100644
--- a/cpp/test/IcePack/simple/simple_server.xml
+++ b/cpp/test/IcePack/simple/simple_server.xml
@@ -11,4 +11,15 @@
</properties>
</target>
+ <target name="ssl">
+ <properties>
+ <property name="Ice.Plugin.IceSSL" value="IceSSL:create"/>
+ <property name="Ice.Default.Protocol" value="ssl"/>
+ <property name="IceSSL.Client.CertPath" location="../../../certs"/>
+ <property name="IceSSL.Client.Config" value="client_sslconfig.xml"/>
+ <property name="IceSSL.Server.CertPath" location="../../../certs"/>
+ <property name="IceSSL.Server.Config" value="server_sslconfig.xml"/>
+ </properties>
+ </target>
+
</server> \ No newline at end of file