diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-11-17 15:04:28 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-11-17 15:04:28 +0000 |
commit | aacea143855a7a09e4ba53d09150ed71c7df2a67 (patch) | |
tree | b9b291727307d586d74e5c4204decdc02c77369d /cpp/src/IceGrid/InternalRegistryI.cpp | |
parent | Fixed depends Some Makefile cleanup (diff) | |
download | ice-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.cpp | 31 |
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); +} |