summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/demo/Ice/callback/config4
-rw-r--r--cpp/demo/Ice/hello/config2
-rw-r--r--cpp/demo/Ice/latency/config2
-rw-r--r--cpp/demo/Ice/nested/config4
-rw-r--r--cpp/demo/Ice/value/config2
-rw-r--r--cpp/doc/Properties.sgml19
-rw-r--r--cpp/slice/Ice/ObjectAdapter.ice4
-rw-r--r--cpp/slice/Ice/Properties.ice12
-rw-r--r--cpp/src/Glacier/GlacierRouter.cpp28
-rw-r--r--cpp/src/Glacier/GlacierStarter.cpp3
-rw-r--r--cpp/src/Glacier/Makefile7
-rw-r--r--cpp/src/Ice/PropertiesI.cpp13
-rw-r--r--cpp/src/Ice/PropertiesI.h1
-rw-r--r--cpp/src/IcePack/Activator.cpp2
14 files changed, 87 insertions, 16 deletions
diff --git a/cpp/demo/Ice/callback/config b/cpp/demo/Ice/callback/config
index d03875188c7..9cf77303e41 100644
--- a/cpp/demo/Ice/callback/config
+++ b/cpp/demo/Ice/callback/config
@@ -17,6 +17,6 @@ Glacier.Trace.Server=2
Glacier.Trace.RoutingTable=1
# Uncomment the following lines if you want to run this demo with Glacier
-Ice.DefaultRouter=router:default -p 10005
-Ice.Adapter.CallbackReceiverAdapter.Router=router:default -p 10005
+Ice.DefaultRouter=Glacier#router:default -p 10005
+Ice.Adapter.CallbackReceiverAdapter.Router=Glacier#router:default -p 10005
Ice.Adapter.CallbackReceiverAdapter.Endpoints=
diff --git a/cpp/demo/Ice/hello/config b/cpp/demo/Ice/hello/config
index 98ad20288ca..a1272b14dd9 100644
--- a/cpp/demo/Ice/hello/config
+++ b/cpp/demo/Ice/hello/config
@@ -67,4 +67,4 @@ Glacier.Trace.RoutingTable=1
#
# Uncomment the following lines if you want to run this demo with Glacier
#
-#Ice.DefaultRouter=router:default -p 10005
+#Ice.DefaultRouter=Glacier#router:default -p 10005
diff --git a/cpp/demo/Ice/latency/config b/cpp/demo/Ice/latency/config
index 33247ac065d..d40a25b1fbd 100644
--- a/cpp/demo/Ice/latency/config
+++ b/cpp/demo/Ice/latency/config
@@ -8,4 +8,4 @@ Glacier.Router.Endpoints=default -p 10005
Glacier.Client.Endpoints=default
# Uncomment the following lines if you want to run this demo with Glacier
-#Ice.DefaultRouter=router:default -p 10005
+#Ice.DefaultRouter=Glacier#router:default -p 10005
diff --git a/cpp/demo/Ice/nested/config b/cpp/demo/Ice/nested/config
index 2e1ea55916e..45117037d1d 100644
--- a/cpp/demo/Ice/nested/config
+++ b/cpp/demo/Ice/nested/config
@@ -18,6 +18,6 @@ Glacier.Trace.Server=2
Glacier.Trace.RoutingTable=1
# Uncomment the following lines if you want to run this demo with Glacier
-#Ice.DefaultRouter=router:default -p 10005
-#Ice.Adapter.NestedClientAdapter.Router=router:default -p 10005
+#Ice.DefaultRouter=Glacier#router:default -p 10005
+#Ice.Adapter.NestedClientAdapter.Router=Glacier#router:default -p 10005
#Ice.Adapter.NestedClientAdapter.Endpoints=
diff --git a/cpp/demo/Ice/value/config b/cpp/demo/Ice/value/config
index 322a63ef695..61fb10d0107 100644
--- a/cpp/demo/Ice/value/config
+++ b/cpp/demo/Ice/value/config
@@ -10,4 +10,4 @@ Glacier.Trace.Client=2
Glacier.Trace.RoutingTable=1
# Uncomment the following lines if you want to run this demo with Glacier
-#Ice.DefaultRouter=router:default -p 10005
+#Ice.DefaultRouter=Glacier#router:default -p 10005
diff --git a/cpp/doc/Properties.sgml b/cpp/doc/Properties.sgml
index 4638703ebe4..140d1daf71e 100644
--- a/cpp/doc/Properties.sgml
+++ b/cpp/doc/Properties.sgml
@@ -711,6 +711,25 @@ default value <literal>router</literal> is used.
</section>
</section>
+<section><title>Glacier.Router.PrintProxyOnFd</title>
+<section><title>Synopsis</title>
+<synopsis>
+Glacier.Router.PrintProxyOnFd=<replaceable>fd</replaceable>
+</synopsis>
+</section>
+<section>
+<title>Description</title>
+<para>
+If set, print the stringified router proxy on the filedescriptor
+<replaceable>fd</replaceable>, and close this filedescriptor. (Unix
+only.)
+<note><para> This operation is intended to be used by the &Glacier;
+router starter only. It should not be set manually.
+</para></note>
+</para>
+</section>
+</section>
+
<section><title>Glacier.Trace.Client</title>
<section><title>Synopsis</title>
<synopsis>
diff --git a/cpp/slice/Ice/ObjectAdapter.ice b/cpp/slice/Ice/ObjectAdapter.ice
index 5c970b1f4e2..e6c854adaa0 100644
--- a/cpp/slice/Ice/ObjectAdapter.ice
+++ b/cpp/slice/Ice/ObjectAdapter.ice
@@ -300,8 +300,8 @@ local interface ObjectAdapter
*
* <note><para> Like the [Router] interface, this operation is
* intended to be used by router implementations. Regular user
- * code should not attempt to use this operation
- * directly. </para></note>
+ * code should not attempt to use this operation.
+ * </para></note>
*
* @param identity The identity for which a Proxy is to be created.
*
diff --git a/cpp/slice/Ice/Properties.ice b/cpp/slice/Ice/Properties.ice
index 0d2f67614cd..fcfaa7531a0 100644
--- a/cpp/slice/Ice/Properties.ice
+++ b/cpp/slice/Ice/Properties.ice
@@ -11,6 +11,8 @@
#ifndef ICE_PROPERTIES_ICE
#define ICE_PROPERTIES_ICE
+#include <Ice/BuiltinSequences.ice>
+
module Ice
{
@@ -52,6 +54,16 @@ local interface Properties
/**
*
+ * Get a sequence of command line options that is equivalent to
+ * this property set.
+ *
+ * @return The command line options for this property set.
+ *
+ **/
+ StringSeq getCommandLineOptions();
+
+ /**
+ *
* Create a copy of this property set.
*
* @return A copy of this property set.
diff --git a/cpp/src/Glacier/GlacierRouter.cpp b/cpp/src/Glacier/GlacierRouter.cpp
index 28435a3b86e..0bff2e2ea77 100644
--- a/cpp/src/Glacier/GlacierRouter.cpp
+++ b/cpp/src/Glacier/GlacierRouter.cpp
@@ -180,7 +180,7 @@ Glacier::Router::run(int argc, char* argv[])
string routerIdentity = properties->getProperty(routerIdentityProperty);
if (routerIdentity.empty())
{
- routerIdentity = "router";
+ routerIdentity = "Glacier#router";
}
ObjectAdapterPtr routerAdapter =
@@ -189,11 +189,33 @@ Glacier::Router::run(int argc, char* argv[])
routerAdapter->add(router, stringToIdentity(routerIdentity));
routerAdapter->activate();
+#ifndef WIN32
+ //
+ // Print the stringified router proxy on a filedescriptor
+ // specified in the properties, if so requested.
+ //
+ string outputFd = properties->getProperty("Glacier.Router.PrintProxyOnFd");
+ if (!outputFd.empty())
+ {
+ int fd = atoi(outputFd.c_str());
+ string ref = communicator()->proxyToString(routerAdapter->createProxy(stringToIdentity(routerIdentity)));
+ ref += "\n";
+ string::size_type sz = static_cast<string::size_type>(write(fd, ref.c_str(), ref.length()));
+ if (sz != ref.length())
+ {
+ cerr << appName() << ": cannot write stringified router proxy to filedescriptor " << fd << ": "
+ << strerror(errno) << endl;
+ return EXIT_FAILURE;
+ }
+
+ close(fd);
+ }
+#endif
+
//
// We're done, let's wait for shutdown.
//
communicator()->waitForShutdown();
- return EXIT_SUCCESS;
//
// Destroy the router. The client and server blobjects get
@@ -202,6 +224,8 @@ Glacier::Router::run(int argc, char* argv[])
RouterI* rtr = dynamic_cast<RouterI*>(router.get());
assert(rtr);
rtr->destroy();
+
+ return EXIT_SUCCESS;
}
int
diff --git a/cpp/src/Glacier/GlacierStarter.cpp b/cpp/src/Glacier/GlacierStarter.cpp
index a063b6ade8b..ddc9a00ef3a 100644
--- a/cpp/src/Glacier/GlacierStarter.cpp
+++ b/cpp/src/Glacier/GlacierStarter.cpp
@@ -9,6 +9,7 @@
// **********************************************************************
#include <Ice/Application.h>
+#include <Glacier/GlacierI.h>
using namespace std;
using namespace Ice;
@@ -76,6 +77,8 @@ Glacier::Router::run(int argc, char* argv[])
ObjectAdapterPtr starterAdapter = communicator()->createObjectAdapterFromProperty("Starter",
starterEndpointsProperty);
+ StarterPtr starter = new StarterI;
+ starterAdapter->add(starter, stringToIdentity("Glacier#starter"));
starterAdapter->activate();
//
diff --git a/cpp/src/Glacier/Makefile b/cpp/src/Glacier/Makefile
index fc4e4f68526..c8b4e3b92ef 100644
--- a/cpp/src/Glacier/Makefile
+++ b/cpp/src/Glacier/Makefile
@@ -19,7 +19,7 @@ VERSIONED_NAME = $(top_srcdir)/lib/$(VERSIONED_BASE)
ROUTER = $(top_srcdir)/bin/glacier
STARTER = $(top_srcdir)/bin/glacierstarter
-TARGETS = $(NAME) $(VERSIONED_NAME) $(ROUTER) $(STARTER)
+TARGETS = $(NAME) $(VERSIONED_NAME) $(ROUTER) #$(STARTER)
OBJS = Glacier.o
@@ -28,7 +28,8 @@ ROBJS = GlacierRouter.o \
ClientBlobject.o \
ServerBlobject.o
-SOBJS = GlacierStarter.o
+SOBJS = GlacierStarter.o \
+ GlacierI.o
SRCS = $(OBJS:.o=.cpp) \
$(ROBJS:.o=.cpp) \
@@ -56,7 +57,7 @@ $(ROUTER): $(ROBJS)
$(STARTER): $(SOBJS)
rm -f $@
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(SOBJS) $(LIBS)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(SOBJS) -lGlacier $(LIBS)
$(HDIR)/Glacier.h Glacier.cpp: $(SDIR)/Glacier.ice $(SLICE2CPP)
rm -f $(HDIR)/Glacier.h Glacier.cpp
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index 156278b92ab..06e13051d4e 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -38,6 +38,19 @@ Ice::PropertiesI::setProperty(const string& key, const string& value)
_properties[key] = value;
}
+StringSeq
+Ice::PropertiesI::getCommandLineOptions()
+{
+ StringSeq result;
+ result.reserve(_properties.size());
+ map<string, string>::const_iterator p;
+ for (p = _properties.begin(); p != _properties.end(); ++p)
+ {
+ result.push_back("--" + p->first + "=" + p->second);
+ }
+ return result;
+}
+
PropertiesPtr
Ice::PropertiesI::clone()
{
diff --git a/cpp/src/Ice/PropertiesI.h b/cpp/src/Ice/PropertiesI.h
index 255f7f0fb46..2d01fe55a2f 100644
--- a/cpp/src/Ice/PropertiesI.h
+++ b/cpp/src/Ice/PropertiesI.h
@@ -23,6 +23,7 @@ public:
virtual std::string getProperty(const std::string&);
virtual void setProperty(const std::string&, const std::string&);
+ virtual StringSeq getCommandLineOptions();
virtual PropertiesPtr clone();
static void addArgumentPrefix(const std::string&);
diff --git a/cpp/src/IcePack/Activator.cpp b/cpp/src/IcePack/Activator.cpp
index 34bc371e519..c16b82e186a 100644
--- a/cpp/src/IcePack/Activator.cpp
+++ b/cpp/src/IcePack/Activator.cpp
@@ -136,8 +136,6 @@ IcePack::Activator::activate(const ServerDescription& desc)
}
if (pid == 0) // Child process
{
- close(fds[0]);
-
//
// Close all filedescriptors, except for standard input,
// standard output, standard error output, and the write side