(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.17 and 1.21.4.1

version 1.17, 2005/04/18 20:35:29 version 1.21.4.1, 2006/01/18 17:38:08
Line 112 
Line 112 
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
 #include <Pegasus/Common/Constants.h> #include <Pegasus/Common/Constants.h>
 #include <iostream> #include <iostream>
 #include <cassert>  #include <Pegasus/Common/PegasusAssert.h>
 #include <cstdlib> #include <cstdlib>
 #include <fstream> #include <fstream>
 #include <Pegasus/Common/FileSystem.h> #include <Pegasus/Common/FileSystem.h>
Line 121 
Line 121 
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
   #include <Pegasus/Common/LanguageParser.h>
 #include <Pegasus/Config/ConfigManager.h> #include <Pegasus/Config/ConfigManager.h>
 #include <Pegasus/Client/CIMClient.h> #include <Pegasus/Client/CIMClient.h>
 #include <Pegasus/Server/ShutdownService.h> #include <Pegasus/Server/ShutdownService.h>
Line 199 
Line 200 
  
 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 333 
Line 335 
         delete _cimServer;         delete _cimServer;
         _cimServer = 0;         _cimServer = 0;
     }     }
   
           if (_monitor)
           {
                   delete _monitor;
           }
 } }
  
 // l10n // l10n
Line 530 
Line 537 
 #endif #endif
  
 #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \
 || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) \  || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_SOLARIS) \
 || defined (PEGASUS_OS_VMS) || defined (PEGASUS_OS_VMS)
         if (kill_rc != -1)         if (kill_rc != -1)
             {             {
Line 1018 
Line 1025 
             portNumberHttps = strtol(portString, &end, 10);             portNumberHttps = strtol(portString, &end, 10);
             if(!(end != 0 && *end == '\0'))             if(!(end != 0 && *end == '\0'))
             {             {
                 PEGASUS_STD(cerr) << "Bad HTTPS Port Value" << PEGASUS_STD(endl);                  InvalidPropertyValue e("httpsPort", httpsPort);
                   cerr << e.getMessage() << endl;
                 exit(1);                 exit(1);
             }             }
         }         }
Line 1044 
Line 1052 
             portNumberHttp = strtol(portString, &end, 10);             portNumberHttp = strtol(portString, &end, 10);
             if(!(end != 0 && *end == '\0'))             if(!(end != 0 && *end == '\0'))
             {             {
                 PEGASUS_STD(cerr) << "Bad HTTP Port Value" << PEGASUS_STD(endl);                  InvalidPropertyValue e("httpPort", httpPort);
                   cerr << e.getMessage() << endl;
                 exit(1);                 exit(1);
             }             }
         }         }
Line 1120 
Line 1129 
 // l10n // l10n
     // Now we are after the fork...     // Now we are after the fork...
     // Create a dummy Thread object that can be used to store the     // Create a dummy Thread object that can be used to store the
     // AcceptLanguages object for CIM requests that are serviced      // AcceptLanguageList object for CIM requests that are serviced
     // by this thread (initial thread of server).  Need to do this     // by this thread (initial thread of server).  Need to do this
     // because this thread is not in a ThreadPool, but is used     // because this thread is not in a ThreadPool, but is used
     // to service CIM requests.     // to service CIM requests.
     // The run function for the dummy Thread should never be called,     // The run function for the dummy Thread should never be called,
     Thread *dummyInitialThread = new Thread(dummyThreadFunc, NULL, false);     Thread *dummyInitialThread = new Thread(dummyThreadFunc, NULL, false);
     Thread::setCurrent(dummyInitialThread);     Thread::setCurrent(dummyInitialThread);
     AcceptLanguages default_al;      AcceptLanguageList default_al;
     try{     try{
          default_al = AcceptLanguages::getDefaultAcceptLanguages();           default_al = LanguageParser::getDefaultAcceptLanguages();
          Thread::setLanguages(new AcceptLanguages(default_al));           Thread::setLanguages(new AcceptLanguageList(default_al));
     }catch(InvalidAcceptLanguageHeader& e){     }catch(InvalidAcceptLanguageHeader& e){
           Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,           Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
                   "src.Server.cimserver.FAILED_TO_SET_PROCESS_LOCALE",                   "src.Server.cimserver.FAILED_TO_SET_PROCESS_LOCALE",
Line 1159 
Line 1168 
  
 #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \
 || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \ || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \
 || defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) || defined (PEGASUS_OS_VMS)  || defined(PEGASUS_OS_SOLARIS) || defined (PEGASUS_OS_VMS)
     umask(S_IWGRP|S_IWOTH);     umask(S_IWGRP|S_IWOTH);
  
     //     //
Line 1191 
Line 1200 
     try     try
     {     {
  
     Monitor monitor;      _monitor  = new Monitor();
     //PEP#222     //PEP#222
     //CIMServer server(&monitor);     //CIMServer server(&monitor);
     //CimserverHolder cimserverHolder( &server );     //CimserverHolder cimserverHolder( &server );
     _cimServer = new CIMServer(&monitor);      _cimServer = new CIMServer(_monitor);
  
  
         if (enableHttpConnection)         if (enableHttpConnection)
Line 1273 
Line 1282 
 #endif #endif
  
         // bind throws an exception if the bind fails         // bind throws an exception if the bind fails
           try {
         _cimServer->bind();         _cimServer->bind();
           } catch (const BindFailedException &e)
           {
   #ifdef PEGASUS_DEBUG
           MessageLoaderParms parms("src.Server.cimserver.BIND_FAILED",
                    "Could not bind: $0.", e.getMessage());
           cout << MessageLoader::getMessage(parms) << endl;
   #endif
           Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
               "src.Server.cimserver.BIND.FAILED",
               "Could not bind:  $0", e.getMessage());
  
              deleteCIMServer();
              return 1;
           }
     // notify parent process (if there is a parent process) to terminate     // notify parent process (if there is a parent process) to terminate
         // so user knows that there is cimserver ready to serve CIM requests.         // so user knows that there is cimserver ready to serve CIM requests.
     if (daemonOption)     if (daemonOption)
Line 1283 
Line 1306 
     time_t last = 0;     time_t last = 0;
  
 #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_LINUX) || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) \ #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_LINUX) || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) \
     || defined(PEGASUS_OS_AIX) || defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) \      || defined(PEGASUS_OS_AIX) || defined(PEGASUS_OS_SOLARIS) \
     || defined(PEGASUS_OS_VMS)     || defined(PEGASUS_OS_VMS)
         //         //
         // create a file to indicate that the cimserver has started and         // create a file to indicate that the cimserver has started and
Line 1336 
Line 1359 
  
 #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \
 || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \ || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \
 || defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) || defined(PEGASUS_OS_VMS)  || defined(PEGASUS_OS_SOLARIS) || defined(PEGASUS_OS_VMS)
         //         //
         // close the file created at startup time to indicate that the         // close the file created at startup time to indicate that the
         // cimserver has terminated normally.         // cimserver has terminated normally.


Legend:
Removed from v.1.17  
changed lines
  Added in v.1.21.4.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2