summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-09-27 11:37:26 -0400
committerBernard Normier <bernard@zeroc.com>2007-09-27 11:37:26 -0400
commit29aad94424e506d30ba89c18e3ce3d5fecc03dcc (patch)
tree9acda23df0d372428fe500ff55a02d07db382792 /cpp
parentSquashed commit of the following: (diff)
downloadice-29aad94424e506d30ba89c18e3ce3d5fecc03dcc.tar.bz2
ice-29aad94424e506d30ba89c18e3ce3d5fecc03dcc.tar.xz
ice-29aad94424e506d30ba89c18e3ce3d5fecc03dcc.zip
iceboxadmin is now using IceBoxAdmin.ServiceManager.Proxy
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/config/PropertyNames.xml4
-rw-r--r--cpp/demo/IceBox/hello/README2
-rw-r--r--cpp/demo/IceBox/hello/config.admin14
-rw-r--r--cpp/demo/IceBox/hello/config.icebox37
-rw-r--r--cpp/src/Ice/PropertyNames.cpp22
-rw-r--r--cpp/src/Ice/PropertyNames.h3
-rw-r--r--cpp/src/IceBox/Admin.cpp56
-rwxr-xr-xcpp/test/IceStorm/federation/run.py15
8 files changed, 111 insertions, 42 deletions
diff --git a/cpp/config/PropertyNames.xml b/cpp/config/PropertyNames.xml
index 04763e2cda7..b0e7d943ac4 100755
--- a/cpp/config/PropertyNames.xml
+++ b/cpp/config/PropertyNames.xml
@@ -375,6 +375,10 @@ generated from the section label.
<property name="InheritProperties" />
</section>
+ <section name="IceBoxAdmin">
+ <property name="ServiceManager.Proxy" class="proxy"/>
+ </section>
+
<section name="IceGridAdmin">
<property name="AuthenticateUsingSSL" />
<property name="Username" />
diff --git a/cpp/demo/IceBox/hello/README b/cpp/demo/IceBox/hello/README
index 10561cdf56a..649e76814a8 100644
--- a/cpp/demo/IceBox/hello/README
+++ b/cpp/demo/IceBox/hello/README
@@ -15,7 +15,7 @@ $ client
To shut down IceBox, use iceboxadmin:
-$ iceboxadmin --Ice.Config=config.icebox shutdown
+$ iceboxadmin --Ice.Config=config.admin shutdown
Unix Note:
diff --git a/cpp/demo/IceBox/hello/config.admin b/cpp/demo/IceBox/hello/config.admin
new file mode 100644
index 00000000000..4e148e8a316
--- /dev/null
+++ b/cpp/demo/IceBox/hello/config.admin
@@ -0,0 +1,14 @@
+#
+# Proxy to the IceBox ServiceManager:
+#
+
+#
+# When the IceBox.ServiceManager object adapter is configured:
+#
+#IceBoxAdmin.ServiceManager.Proxy=DemoIceBox/ServiceManager:tcp -p 9998 -h 127.0.0.1
+
+#
+# When Ice.Admin is configured:
+#
+IceBoxAdmin.ServiceManager.Proxy=DemoIceBox/admin -f IceBox.ServiceManager:tcp -p 9996 -h 127.0.0.1
+
diff --git a/cpp/demo/IceBox/hello/config.icebox b/cpp/demo/IceBox/hello/config.icebox
index 65c0c31d1a0..d28f367c194 100644
--- a/cpp/demo/IceBox/hello/config.icebox
+++ b/cpp/demo/IceBox/hello/config.icebox
@@ -1,13 +1,37 @@
#
+# The IceBox ServiceManager object can be provided by configuring
+# IceBox.ServiceManager.Endpoints (and optionally
+# IceBox.InstanceName), or as a facet of the Ice.Admin object
+# (or both if you like). Make sure to keep config.admin
+# synchronized with these settings.
+#
+
+#
+# IceBox.ServiceManager configuration
+#
+
+#
# The IceBox instance name is used to set the category field of the
# IceBox ServiceManager identity.
#
-IceBox.InstanceName=DemoIceBox
+#IceBox.InstanceName=DemoIceBox
#
# The IceBox server endpoint configuration
#
-IceBox.ServiceManager.Endpoints=tcp -p 9998:ssl -p 9999
+#IceBox.ServiceManager.Endpoints=tcp -p 9998 -h 127.0.0.1
+
+
+#
+# Ice.Admin configuration
+#
+
+#
+# Enable Ice.Admin object:
+#
+Ice.Admin.InstanceName=DemoIceBox
+Ice.Admin.Endpoints=tcp -p 9996 -h 127.0.0.1
+
#
# The hello service
@@ -37,12 +61,3 @@ Ice.Warn.Connections=1
#
#Ice.Trace.Protocol=1
-#
-# SSL Configuration
-#
-Ice.Plugin.IceSSL=IceSSL:createIceSSL
-IceSSL.DefaultDir=../../../certs
-IceSSL.CertAuthFile=cacert.pem
-IceSSL.CertFile=s_rsa1024_pub.pem
-IceSSL.KeyFile=s_rsa1024_priv.pem
-#IceSSL.Trace.Security=2
diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp
index f514fb6a11a..f4af02db377 100644
--- a/cpp/src/Ice/PropertyNames.cpp
+++ b/cpp/src/Ice/PropertyNames.cpp
@@ -7,7 +7,7 @@
//
// **********************************************************************
//
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Wed Sep 26 17:22:42 2007
+// Generated by makeprops.py from file ../config/PropertyNames.xml, Wed Sep 26 19:26:30 2007
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -150,6 +150,24 @@ const IceInternal::PropertyArray
IceInternal::PropertyNames::IceBoxProps(IceBoxPropsData,
sizeof(IceBoxPropsData)/sizeof(IceBoxPropsData[0]));
+const IceInternal::Property IceBoxAdminPropsData[] =
+{
+ IceInternal::Property("IceBoxAdmin.ServiceManager.Proxy.EndpointSelection", false, 0),
+ IceInternal::Property("IceBoxAdmin.ServiceManager.Proxy.ConnectionCached", false, 0),
+ IceInternal::Property("IceBoxAdmin.ServiceManager.Proxy.PreferSecure", false, 0),
+ IceInternal::Property("IceBoxAdmin.ServiceManager.Proxy.LocatorCacheTimeout", false, 0),
+ IceInternal::Property("IceBoxAdmin.ServiceManager.Proxy.Locator", false, 0),
+ IceInternal::Property("IceBoxAdmin.ServiceManager.Proxy.Router", false, 0),
+ IceInternal::Property("IceBoxAdmin.ServiceManager.Proxy.CollocationOptimization", true, "IceBoxAdmin.ServiceManager.Proxy.CollocationOptimized"),
+ IceInternal::Property("IceBoxAdmin.ServiceManager.Proxy.CollocationOptimized", false, 0),
+ IceInternal::Property("IceBoxAdmin.ServiceManager.Proxy.ThreadPerConnection", false, 0),
+ IceInternal::Property("IceBoxAdmin.ServiceManager.Proxy", false, 0),
+};
+
+const IceInternal::PropertyArray
+ IceInternal::PropertyNames::IceBoxAdminProps(IceBoxAdminPropsData,
+ sizeof(IceBoxAdminPropsData)/sizeof(IceBoxAdminPropsData[0]));
+
const IceInternal::Property IceGridAdminPropsData[] =
{
IceInternal::Property("IceGridAdmin.AuthenticateUsingSSL", false, 0),
@@ -618,6 +636,7 @@ const IceInternal::PropertyArray IceInternal::PropertyNames::validProps[] =
{
IceProps,
IceBoxProps,
+ IceBoxAdminProps,
IceGridAdminProps,
IceGridProps,
IcePatch2Props,
@@ -634,6 +653,7 @@ const char* IceInternal::PropertyNames::clPropNames[] =
{
"Ice",
"IceBox",
+ "IceBoxAdmin",
"IceGridAdmin",
"IceGrid",
"IcePatch2",
diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h
index c9b88bf3f2a..e38d1d94eed 100644
--- a/cpp/src/Ice/PropertyNames.h
+++ b/cpp/src/Ice/PropertyNames.h
@@ -7,7 +7,7 @@
//
// **********************************************************************
//
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Wed Sep 26 17:22:42 2007
+// Generated by makeprops.py from file ../config/PropertyNames.xml, Wed Sep 26 19:26:30 2007
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -59,6 +59,7 @@ public:
static const PropertyArray IceProps;
static const PropertyArray IceBoxProps;
+ static const PropertyArray IceBoxAdminProps;
static const PropertyArray IceGridAdminProps;
static const PropertyArray IceGridProps;
static const PropertyArray IcePatch2Props;
diff --git a/cpp/src/IceBox/Admin.cpp b/cpp/src/IceBox/Admin.cpp
index fce10f5681d..e2f02d6a728 100644
--- a/cpp/src/IceBox/Admin.cpp
+++ b/cpp/src/IceBox/Admin.cpp
@@ -84,40 +84,52 @@ Client::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- PropertiesPtr properties = communicator()->getProperties();
- Identity managerIdentity;
- managerIdentity.category = properties->getPropertyWithDefault("IceBox.InstanceName", "IceBox");
- managerIdentity.name = "ServiceManager";
+
+ ObjectPrx base = communicator()->propertyToProxy("IceBoxAdmin.ServiceManager.Proxy");
- string managerProxy;
- if(properties->getProperty("Ice.Default.Locator").empty())
+ if(base == 0)
{
- string managerEndpoints = properties->getProperty("IceBox.ServiceManager.Endpoints");
- if(managerEndpoints.empty())
+ //
+ // The old deprecated way to retrieve the service manager proxy
+ //
+
+ PropertiesPtr properties = communicator()->getProperties();
+
+ Identity managerIdentity;
+ managerIdentity.category = properties->getPropertyWithDefault("IceBox.InstanceName", "IceBox");
+ managerIdentity.name = "ServiceManager";
+
+ string managerProxy;
+ if(properties->getProperty("Ice.Default.Locator").empty())
{
- cerr << appName() << ": property `IceBox.ServiceManager.Endpoints' is not set" << endl;
- return EXIT_FAILURE;
+ string managerEndpoints = properties->getProperty("IceBox.ServiceManager.Endpoints");
+ if(managerEndpoints.empty())
+ {
+ cerr << appName() << ": property `IceBoxAdmin.ServiceManager.Proxy' is not set" << endl;
+ return EXIT_FAILURE;
+ }
+
+ managerProxy = "\"" + communicator()->identityToString(managerIdentity) + "\" :" + managerEndpoints;
}
-
- managerProxy = "\"" + communicator()->identityToString(managerIdentity) + "\" :" + managerEndpoints;
- }
- else
- {
- string managerAdapterId = properties->getProperty("IceBox.ServiceManager.AdapterId");
- if(managerAdapterId.empty())
+ else
{
- cerr << appName() << ": property `IceBox.ServiceManager.AdapterId' is not set" << endl;
- return EXIT_FAILURE;
+ string managerAdapterId = properties->getProperty("IceBox.ServiceManager.AdapterId");
+ if(managerAdapterId.empty())
+ {
+ cerr << appName() << ": property `IceBoxAdmin.ServiceManager.Proxy' is not set" << endl;
+ return EXIT_FAILURE;
+ }
+
+ managerProxy = "\"" + communicator()->identityToString(managerIdentity) + "\" @" + managerAdapterId;
}
- managerProxy = "\"" + communicator()->identityToString(managerIdentity) + "\" @" + managerAdapterId;
+ base = communicator()->stringToProxy(managerProxy);
}
- ObjectPrx base = communicator()->stringToProxy(managerProxy);
IceBox::ServiceManagerPrx manager = IceBox::ServiceManagerPrx::checkedCast(base);
if(!manager)
{
- cerr << appName() << ": `" << managerProxy << "' is not running" << endl;
+ cerr << appName() << ": `" << base << "' is not an IceBox::ServiceManager" << endl;
return EXIT_FAILURE;
}
diff --git a/cpp/test/IceStorm/federation/run.py b/cpp/test/IceStorm/federation/run.py
index c7763662b2b..4920a9b2436 100755
--- a/cpp/test/IceStorm/federation/run.py
+++ b/cpp/test/IceStorm/federation/run.py
@@ -28,14 +28,17 @@ iceBox = TestUtil.getIceBox(testdir)
iceBoxAdmin = os.path.join(toplevel, "bin", "iceboxadmin")
iceStormAdmin = os.path.join(toplevel, "bin", "icestormadmin")
-iceBoxEndpoints = ' --IceBox.ServiceManager.Endpoints="default -p 12010" --Ice.Default.Locator='
-
iceStormService = " --IceBox.Service.IceStorm=IceStormService," + TestUtil.getIceSoVersion() + ":createIceStorm" + \
' --IceStorm.TopicManager.Endpoints="default -p 12011"' + \
' --IceStorm.Publish.Endpoints="default"' + \
" --IceBox.PrintServicesReady=IceStorm" + \
- " --IceBox.InheritProperties=1"
-iceStormReference = ' --IceStorm.TopicManager.Proxy="IceStorm/TopicManager: default -p 12011"'
+ " --IceBox.InheritProperties=1" + \
+ ' --Ice.Admin.Endpoints="default -p 12010"' + \
+ " --Ice.Admin.InstanceName=IceBox"
+
+serviceManagerProxy = ' --IceBoxAdmin.ServiceManager.Proxy="IceBox/admin -f IceBox.ServiceManager:default -p 12010"'
+
+iceStormReference = ' --IceStorm.TopicManager.Proxy="IceStorm/TopicManager:default -p 12011"'
def doTest(batch):
global testdir
@@ -79,7 +82,7 @@ TestUtil.cleanDbDir(dbHome)
iceStormDBEnv=" --Freeze.DbEnv.IceStorm.DbHome=" + dbHome
print "starting icestorm service...",
-command = iceBox + TestUtil.clientServerOptions + iceBoxEndpoints + iceStormService + iceStormDBEnv
+command = iceBox + TestUtil.clientServerOptions + iceStormService + iceStormDBEnv
if TestUtil.debug:
print "(" + command + ")",
iceBoxPipe = os.popen(command + " 2>&1")
@@ -133,7 +136,7 @@ print "ok"
# Shutdown icestorm.
#
print "shutting down icestorm service...",
-command = iceBoxAdmin + TestUtil.clientOptions + iceBoxEndpoints + r' shutdown'
+command = iceBoxAdmin + TestUtil.clientOptions + serviceManagerProxy + r' shutdown'
if TestUtil.debug:
print "(" + command + ")",
iceBoxAdminPipe = os.popen(command + " 2>&1")