(file) Return to cimserver.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / WMIMapper / WMIServer

Diff for /pegasus/src/WMIMapper/WMIServer/cimserver.cpp between version 1.31 and 1.35

version 1.31, 2007/06/05 10:25:03 version 1.35, 2007/07/02 01:47:05
Line 85 
Line 85 
 #include <Pegasus/Common/PegasusAssert.h> #include <Pegasus/Common/PegasusAssert.h>
 #include <fstream> #include <fstream>
 #include <Pegasus/Common/FileSystem.h> #include <Pegasus/Common/FileSystem.h>
 #include <Pegasus/Common/Monitor.h>  
 #include <Pegasus/Common/PegasusVersion.h> #include <Pegasus/Common/PegasusVersion.h>
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
Line 152 
Line 151 
         return PEGASUS_PROCESS_NAME;         return PEGASUS_PROCESS_NAME;
     }     }
  
     //defined in Constants.h      int cimserver_run(
     virtual const char* getPIDFileName() const          int argc,
     {          char** argv,
         return PEGASUS_CIMSERVER_START_FILE;          Boolean shutdownOption,
     }          Boolean debugOutputOption);
   
     int cimserver_run(int argc, char** argv, bool shutdownOption);  
  
     void cimserver_stop(void);     void cimserver_stop(void);
 }; };
Line 167 
Line 164 
     PEGASUS_PROCESS_NAME, PEGASUS_CIMSERVER_START_FILE);     PEGASUS_PROCESS_NAME, PEGASUS_CIMSERVER_START_FILE);
 AutoPtr<CIMServerProcess> _cimServerProcess(new CIMServerProcess()); AutoPtr<CIMServerProcess> _cimServerProcess(new CIMServerProcess());
 static CIMServer* _cimServer = 0; static CIMServer* _cimServer = 0;
 static Monitor* _monitor = 0;  
  
 // //
 //  The command name. //  The command name.
Line 198 
Line 194 
 static const char OPTION_BINDVERBOSE = 'X'; static const char OPTION_BINDVERBOSE = 'X';
 #endif #endif
  
 static const String PROPERTY_TIMEOUT = "shutdownTimeout";  
   
 ConfigManager*    configManager;  
   
 /** GetOptions function - This function defines the Options Table /** GetOptions function - This function defines the Options Table
     and sets up the options from that table using the config manager.     and sets up the options from that table using the config manager.
  
Line 269 
Line 261 
 //We need to delete the _cimServer reference on exit in order for the destructors to get called. //We need to delete the _cimServer reference on exit in order for the destructors to get called.
 void deleteCIMServer() void deleteCIMServer()
 { {
     if (_cimServer)  
     {  
         delete _cimServer;         delete _cimServer;
         _cimServer = 0;         _cimServer = 0;
     }     }
  
         if (_monitor)  
         {  
                 delete _monitor;  
         }  
 }  
   
 // l10n // l10n
 // //
 // Dummy function for the Thread object associated with the initial thread. // Dummy function for the Thread object associated with the initial thread.
Line 301 
Line 285 
 { {
     String pegasusHome;     String pegasusHome;
     Boolean shutdownOption = false;     Boolean shutdownOption = false;
       Boolean debugOutputOption = false;
  
 //l10n //l10n
 // Set Message loading to process locale // Set Message loading to process locale
Line 459 
Line 444 
     // Do the plaform specific run     // Do the plaform specific run
     //     //
  
     return _cimServerProcess->platform_run( argc, argv, shutdownOption );      return _cimServerProcess->platform_run(
           argc, argv, shutdownOption, debugOutputOption);
 } }
  
 void CIMServerProcess::cimserver_stop() void CIMServerProcess::cimserver_stop()
Line 480 
Line 466 
 // specific runs may need to deal with bettter (instead of exit(), etc). // specific runs may need to deal with bettter (instead of exit(), etc).
 // //
  
 int CIMServerProcess::cimserver_run( int argc, char** argv, Boolean shutdownOption )  int CIMServerProcess::cimserver_run(
       int argc,
       char** argv,
       Boolean shutdownOption,
       Boolean debugOutputOption)
 { {
     String logsDirectory;     String logsDirectory;
     Boolean daemonOption = false;     Boolean daemonOption = false;
Line 488 
Line 478 
     //     //
     // Get an instance of the Config Manager.     // Get an instance of the Config Manager.
     //     //
     configManager = ConfigManager::getInstance();      ConfigManager* configManager = ConfigManager::getInstance();
     configManager->useConfigFiles = true;     configManager->useConfigFiles = true;
  
     //     //
Line 531 
Line 521 
 #ifdef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET #ifdef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET
     if (!enableHttpConnection && !enableHttpsConnection)     if (!enableHttpConnection && !enableHttpsConnection)
     {     {
         //l10n  
         //Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,  
             //"Neither HTTP nor HTTPS connection is enabled.  "  
             //"CIMServer will not be started.");  
         Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,         Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,
             "src.Server.cimserver.HTTP_NOT_ENABLED_SERVER_NOT_STARTING",             "src.Server.cimserver.HTTP_NOT_ENABLED_SERVER_NOT_STARTING",
             "Neither HTTP nor HTTPS connection is enabled.  CIMServer will not be started.");              "Neither HTTP nor HTTPS connection is enabled.");
         //cerr << "Neither HTTP nor HTTPS connection is enabled.  "          MessageLoaderParms parms(
             //"CIMServer will not be started." << endl;              "src.Server.cimserver.HTTP_NOT_ENABLED_SERVER_NOT_STARTING",
         MessageLoaderParms parms("src.Server.cimserver.HTTP_NOT_ENABLED_SERVER_NOT_STARTING",              "Neither HTTP nor HTTPS connection is enabled.");
                                  "Neither HTTP nor HTTPS connection is enabled.  CIMServer will not be started.");  
         cerr << MessageLoader::getMessage(parms) << endl;         cerr << MessageLoader::getMessage(parms) << endl;
         return(1);          return 1;
     }     }
 #endif #endif
  
Line 671 
Line 656 
  
 #if defined(PEGASUS_DEBUG) #if defined(PEGASUS_DEBUG)
     // Put out startup up message.     // Put out startup up message.
     cout << _cimServerProcess->getProductName() << " " << _cimServerProcess->getVersion() << endl;      cout << _cimServerProcess->getProductName() << " " <<
     //l10n          _cimServerProcess->getVersion() << endl;
     //cout << "Built " << __DATE__ << " " << __TIME__ << endl;  
     //cout <<"Starting..."  
     MessageLoaderParms parms("src.Server.cimserver.STARTUP_MESSAGE",  
                              "Built $0 $1\nStarting...",  
                              __DATE__,  
                              __TIME__);  
 #endif #endif
  
 //l10n  
 // reset message loading to NON-process locale // reset message loading to NON-process locale
 MessageLoader::_useProcessLocale = false; MessageLoader::_useProcessLocale = false;
 //l10n  
  
     // Get the parent's PID before forking     // Get the parent's PID before forking
     _serverRunStatus.setParentPid(System::getPID());     _serverRunStatus.setParentPid(System::getPID());
Line 754 
Line 731 
     // try loop to bind the address, and run the server     // try loop to bind the address, and run the server
     try     try
     {     {
         _monitor  = new Monitor();          _cimServer = new CIMServer();
         _cimServer = new CIMServer(_monitor);  
  
  
         if (enableHttpConnection)         if (enableHttpConnection)
         {         {
             _cimServer->addAcceptor(false, portNumberHttp, false, false);  #ifdef PEGASUS_ENABLE_IPV6
               _cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION,
                   portNumberHttp, false);
   #endif
   
   #if !defined (PEGASUS_ENABLE_IPV6) || defined (PEGASUS_OS_TYPE_WINDOWS)
               _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION,
                   portNumberHttp, false);
   #endif
  
             Logger::put_l(             Logger::put_l(
                 Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,                 Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
Line 770 
Line 754 
  
         if (enableHttpsConnection)         if (enableHttpsConnection)
         {         {
             _cimServer->addAcceptor(false, portNumberHttps, true, false);  #ifdef PEGASUS_ENABLE_IPV6
               _cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION,
                   portNumberHttps, true);
   #endif
   
   #if !defined (PEGASUS_ENABLE_IPV6) || defined (PEGASUS_OS_TYPE_WINDOWS)
               _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION,
                   portNumberHttps, true);
   #endif
  
             Logger::put_l(             Logger::put_l(
                 Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,                 Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
Line 779 
Line 771 
         }         }
  
 #ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET #ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET
         _cimServer->addAcceptor(true, 0, false, false);          _cimServer->addAcceptor(HTTPAcceptor::LOCAL_CONNECTION, 0, false);
   
         Logger::put_l(         Logger::put_l(
             Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,             Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
             "src.Server.cimserver.LISTENING_ON_LOCAL",             "src.Server.cimserver.LISTENING_ON_LOCAL",
Line 878 
Line 871 
         Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER,         Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER,
             Logger::INFORMATION, "src.Server.cimserver.STOPPED",             Logger::INFORMATION, "src.Server.cimserver.STOPPED",
             "$0 stopped.", _cimServerProcess->getProductName());             "$0 stopped.", _cimServerProcess->getProductName());
   
 #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \  
 || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \  
 || defined(PEGASUS_OS_SOLARIS) || defined(PEGASUS_OS_VMS)  
         //  
         // close the file created at startup time to indicate that the  
         // cimserver has terminated normally.  
         //  
         FileSystem::removeFile(_cimServerProcess->getPIDFileName());  
 #endif  
     }     }
     catch(Exception& e)     catch(Exception& e)
     {     {
   
     //l10n  
     //Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,  
             //"Error: $0", e.getMessage());  
     Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,     Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,
             "src.Server.cimserver.ERROR",             "src.Server.cimserver.ERROR",
             "Error: $0", e.getMessage());             "Error: $0", e.getMessage());
  
     //l10n  
     //PEGASUS_STD(cerr) << "Error: " << e.getMessage() << PEGASUS_STD(endl);  
     MessageLoaderParms parms("src.Server.cimserver.ERROR",     MessageLoaderParms parms("src.Server.cimserver.ERROR",
                              "Error: $0", e.getMessage());                              "Error: $0", e.getMessage());
     PEGASUS_STD(cerr) << MessageLoader::getMessage(parms) << PEGASUS_STD(endl);          PEGASUS_STD(cerr) << MessageLoader::getMessage(parms) <<
               PEGASUS_STD(endl);
  
     //     //
         // notify parent process (if there is a parent process) to terminate         // notify parent process (if there is a parent process) to terminate


Legend:
Removed from v.1.31  
changed lines
  Added in v.1.35

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2