summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/InternalRegistryI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-11-17 15:04:28 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-11-17 15:04:28 +0000
commitaacea143855a7a09e4ba53d09150ed71c7df2a67 (patch)
treeb9b291727307d586d74e5c4204decdc02c77369d /cpp/src/IceGrid/InternalRegistryI.cpp
parentFixed depends Some Makefile cleanup (diff)
downloadice-aacea143855a7a09e4ba53d09150ed71c7df2a67.tar.bz2
ice-aacea143855a7a09e4ba53d09150ed71c7df2a67.tar.xz
ice-aacea143855a7a09e4ba53d09150ed71c7df2a67.zip
Added support for viewing stderr/stdout files from nodes, registries,
servers.
Diffstat (limited to 'cpp/src/IceGrid/InternalRegistryI.cpp')
-rw-r--r--cpp/src/IceGrid/InternalRegistryI.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/InternalRegistryI.cpp b/cpp/src/IceGrid/InternalRegistryI.cpp
index bdf24718a8f..4a6d55347fd 100644
--- a/cpp/src/IceGrid/InternalRegistryI.cpp
+++ b/cpp/src/IceGrid/InternalRegistryI.cpp
@@ -18,6 +18,7 @@
#include <IceGrid/NodeSessionI.h>
#include <IceGrid/ReplicaSessionI.h>
#include <IceGrid/ReplicaSessionManager.h>
+#include <IceGrid/FileCache.h>
using namespace std;
using namespace IceGrid;
@@ -98,6 +99,7 @@ InternalRegistryI::InternalRegistryI(const RegistryIPtr& registry,
_database(database),
_reaper(reaper),
_wellKnownObjects(wellKnownObjects),
+ _fileCache(new FileCache()),
_session(session)
{
Ice::PropertiesPtr properties = database->getCommunicator()->getProperties();
@@ -183,3 +185,32 @@ InternalRegistryI::shutdown(const Ice::Current& current) const
{
_registry->shutdown();
}
+
+Ice::StringSeq
+InternalRegistryI::readLines(const string& filename, Ice::Long pos, int count, Ice::Long& newPos,
+ const Ice::Current&) const
+{
+ string file;
+ if(filename == "stderr")
+ {
+ file = _database->getCommunicator()->getProperties()->getProperty("Ice.StdErr");
+ if(file.empty())
+ {
+ throw FileNotAvailableException("Ice.StdErr configuration property is not set");
+ }
+ }
+ else if(filename == "stdout")
+ {
+ file = _database->getCommunicator()->getProperties()->getProperty("Ice.StdOut");
+ if(file.empty())
+ {
+ throw FileNotAvailableException("Ice.StdOut configuration property is not set");
+ }
+ }
+ else
+ {
+ throw FileNotAvailableException("unknown file");
+ }
+
+ return _fileCache->read(file, pos, count, newPos);
+}