(file) Return to CIMListener.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Listener

  1 karl  1.40 //%2006////////////////////////////////////////////////////////////////////////
  2 kumpf 1.1  //
  3 karl  1.25 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
  4            // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
  5            // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
  6 karl  1.12 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.25 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9 karl  1.28 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 karl  1.40 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12            // EMC Corporation; Symantec Corporation; The Open Group.
 13 kumpf 1.1  //
 14            // Permission is hereby granted, free of charge, to any person obtaining a copy
 15            // of this software and associated documentation files (the "Software"), to
 16            // deal in the Software without restriction, including without limitation the
 17            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 18            // sell copies of the Software, and to permit persons to whom the Software is
 19            // furnished to do so, subject to the following conditions:
 20 karl  1.40 // 
 21 kumpf 1.1  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22            // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 23            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 24            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 25            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 26            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 27            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 28            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 29            //
 30            //==============================================================================
 31            //
 32 tony  1.8  // Author: Dong Xiang, EMC Corporation (xiang_dong@emc.com)
 33 kumpf 1.1  //
 34 dj.gorey 1.14 // Modified By:   Dan Gorey (djgorey@us.ibm.com)
 35 a.arora  1.21 //                Amit K Arora, IBM (amita@in.ibm.com) for PEP#183
 36 kumpf    1.26 //                Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 37 david.dillard 1.31 //                David Dillard, VERITAS Software Corp.
 38                    //                    (david.dillard@veritas.com)
 39 vijay.eli     1.33 //                Vijay Eli, IBM (vijay.eli@in.ibm.com) for bug#3425
 40 aruran.ms     1.35 //                Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3604
 41 kumpf         1.1  //
 42                    //%/////////////////////////////////////////////////////////////////////////////
 43                    
 44 tony          1.8  #include "CIMListener.h"
 45                    #include <Pegasus/Common/Exception.h>
 46                    #include <Pegasus/Common/SSLContext.h>
 47                    #include <Pegasus/Common/Monitor.h>
 48 kumpf         1.1  #include <Pegasus/Common/HTTPAcceptor.h>
 49 kumpf         1.11 #include <Pegasus/Common/PegasusVersion.h>
 50 konrad.r      1.38 #include <Pegasus/Common/MessageLoader.h>
 51 kumpf         1.1  #include <Pegasus/ExportServer/CIMExportResponseEncoder.h>
 52                    #include <Pegasus/ExportServer/CIMExportRequestDecoder.h>
 53 tony          1.8  #include <Pegasus/Consumer/CIMIndicationConsumer.h>
 54                    #include <Pegasus/Listener/CIMListenerIndicationDispatcher.h>
 55                    
 56                    PEGASUS_NAMESPACE_BEGIN
 57 mike          1.41 
 58                    ////////////////////////////////////////////////////////////////////////////////
 59                    //
 60 tony          1.8  // CIMListenerService
 61 mike          1.41 //
 62                    ////////////////////////////////////////////////////////////////////////////////
 63                    
 64 tony          1.8  class CIMListenerService
 65                    {
 66                    public:
 67 mike          1.41     CIMListenerService(Uint32 portNumber, SSLContext * sslContext = NULL);
 68                        CIMListenerService(CIMListenerService & svc);
 69                        ~CIMListenerService();
 70                    
 71                        void init();
 72                    
 73                        /** bind to the port
 74                        */
 75                        void bind();
 76                    
 77                        /** runForever Main runloop for the server.
 78                        */
 79                        void runForever();
 80                    
 81                        /** Call to gracefully shutdown the server.  The server connection socket
 82                            will be closed to disable new connections from clients.
 83                        */
 84                        void stopClientConnection();
 85                    
 86                        /** Call to gracefully shutdown the server.  It is called when the server
 87                            has been stopped and is ready to be shutdown.  Next time runForever()
 88 mike          1.41         is called, the server shuts down.
 89                        */
 90                        void shutdown();
 91                    
 92                        /** Return true if the server has shutdown, false otherwise.
 93                        */
 94                        Boolean terminated() const
 95                        {
 96                            return _dieNow;
 97                        };
 98 david.dillard 1.34 
 99 mike          1.41     /** Call to resume the sever.
100                        */
101                        void resume();
102                    
103                        /** Call to set the CIMServer state.  Also inform the appropriate
104                            message queues about the current state of the CIMServer.
105                        */
106                        void setState(Uint32 state);
107                    
108                        Uint32 getOutstandingRequestCount();
109                    
110                        /** Returns the indication listener dispatcher
111                        */
112                        CIMListenerIndicationDispatcher *getIndicationDispatcher() const;
113                    
114                        /** Returns the indication listener dispatcher
115                        */
116                        void setIndicationDispatcher(CIMListenerIndicationDispatcher* dispatcher);
117                    
118                        /** Returns the port number being used.
119                        */
120 mike          1.41     Uint32 getPortNumber() const;
121                    
122 mike          1.41.2.1     static ThreadReturnType PEGASUS_THREAD_CDECL 
123 mike          1.41         _listener_routine(void *param);
124 tony          1.8      
125                        private:
126 mike          1.41         Uint32 _portNumber;
127                            SSLContext *_sslContext;
128                            Monitor *_monitor;
129                            Mutex _monitorMutex;
130                            HTTPAcceptor *_acceptor;
131                            Boolean _dieNow;
132                            CIMListenerIndicationDispatcher *_dispatcher;
133                            CIMExportResponseEncoder *_responseEncoder;
134                            CIMExportRequestDecoder *_requestDecoder;
135 tony          1.8      };
136                        
137 mike          1.41     CIMListenerService::CIMListenerService(
138                            Uint32 portNumber, 
139                            SSLContext * sslContext)
140                            :
141                            _portNumber(portNumber), 
142                            _sslContext(sslContext), 
143                            _monitor(NULL),
144                            _acceptor(NULL), 
145                            _dieNow(false), 
146                            _dispatcher(NULL), 
147                            _responseEncoder(NULL),
148                            _requestDecoder(NULL)
149 tony          1.8      {
150                        }
151                        
152 mike          1.41     CIMListenerService::CIMListenerService(CIMListenerService & svc) :
153                            _portNumber(svc._portNumber), 
154                            _sslContext(svc._sslContext), 
155                            _monitor(NULL),
156                            _acceptor(NULL), 
157                            _dieNow(svc._dieNow), 
158                            _dispatcher(NULL),
159                            _responseEncoder(NULL), 
160                            _requestDecoder(NULL)
161 tony          1.8      {
162                        }
163 mike          1.41     
164 tony          1.8      CIMListenerService::~CIMListenerService()
165                        {
166 kumpf         1.36         delete _responseEncoder;
167                            delete _requestDecoder;
168                            delete _acceptor;
169                            delete _monitor;
170 tony          1.8      }
171 kumpf         1.1      
172 tony          1.8      void CIMListenerService::init()
173 kumpf         1.1      {
174 mike          1.41         PEG_METHOD_ENTER(TRC_LISTENER, "CIMListenerService::init");
175 kumpf         1.1      
176 mike          1.41         if (NULL == _monitor)
177                                _monitor = new Monitor();
178 david.dillard 1.31     
179 mike          1.41         // _dispatcher = new CIMListenerIndicationDispatcher();
180 kumpf         1.1      
181 mike          1.41         if (NULL == _responseEncoder)
182                                _responseEncoder = new CIMExportResponseEncoder();
183 tony          1.8      
184 mike          1.41         if (NULL == _requestDecoder)
185                            {
186                                _requestDecoder = new CIMExportRequestDecoder(
187                                    _dispatcher, _responseEncoder->getQueueId());
188                            }
189 kumpf         1.1      
190 mike          1.41         if (NULL == _acceptor)
191                            {
192                                _acceptor = new HTTPAcceptor(
193                                    _monitor, _requestDecoder, false, _portNumber, _sslContext, false);
194                            }
195 kumpf         1.1      
196 mike          1.41         bind();
197                        
198                            PEG_METHOD_EXIT();
199 tony          1.8      }
200 david.dillard 1.34     
201 tony          1.8      void CIMListenerService::bind()
202                        {
203 mike          1.41         if (_acceptor != NULL)
204                            {
205                                _acceptor->bind();
206 kumpf         1.1      
207 mike          1.41             Logger::put(
208                                    Logger::STANDARD_LOG, 
209                                    System::CIMLISTENER,
210                                    Logger::INFORMATION, 
211                                    "Listening on HTTP port $0.",
212                                    _portNumber);
213 chuck         1.20         }
214 tony          1.8      }
215 chuck         1.20     
216 tony          1.8      void CIMListenerService::runForever()
217                        {
218 mike          1.41         static int modulator = 0;
219 kumpf         1.1      
220 mike          1.41         if (!_dieNow)
221 dj.gorey      1.14         {
222 mike          1.41             if (false == _monitor->run(500000))
223                                {
224                                    modulator++;
225                                    try
226                                    {
227                                        MessageQueueService::get_thread_pool()->cleanupIdleThreads();
228                                    }
229                                    catch(...)
230                                    {
231                                        // Ignore!
232                                    }
233                                }
234 chuck         1.20         }
235 tony          1.8      }
236 kumpf         1.1      
237 tony          1.8      void CIMListenerService::shutdown()
238                        {
239                            PEG_METHOD_ENTER(TRC_LISTENER, "CIMListenerService::shutdown()");
240 kumpf         1.1      
241 mike          1.41         // This logic signals the thread currently executing _listener_routine()
242                            // to exit. That function deletes this instance of CIMListenerService, 
243                            // which deletes the _monitor member. We use a mutex to keep it from 
244                            // deleting the monitor until after tickle has been called.
245                            {
246                                AutoMutex am(_monitorMutex);
247                                _dieNow = true;
248                                _monitor->tickle();
249                            }
250 kumpf         1.1      
251 kumpf         1.4          PEG_METHOD_EXIT();
252 kumpf         1.1      }
253                        
254 tony          1.8      void CIMListenerService::resume()
255 kumpf         1.1      {
256 tony          1.8          PEG_METHOD_ENTER(TRC_LISTENER, "CIMListenerService::resume()");
257 kumpf         1.1      
258 mike          1.41         if (_acceptor != NULL)
259 tony          1.8              _acceptor->reopenConnectionSocket();
260 kumpf         1.1      
261 kumpf         1.4          PEG_METHOD_EXIT();
262 kumpf         1.1      }
263                        
264 tony          1.8      void CIMListenerService::stopClientConnection()
265 kumpf         1.1      {
266 mike          1.41         PEG_METHOD_ENTER(
267                                TRC_LISTENER,
268                                "CIMListenerService::stopClientConnection()");
269 kumpf         1.1      
270 kumpf         1.10         // tell Monitor to stop listening for client connections
271 chuck         1.22         _monitor->stopListeningForConnections(true);
272 kumpf         1.10     
273 mike          1.41         if (_acceptor != NULL)
274                                _acceptor->closeConnectionSocket();
275 kumpf         1.1      
276 kumpf         1.4          PEG_METHOD_EXIT();
277 kumpf         1.1      }
278                        
279 chuck         1.23     Uint32 CIMListenerService::getOutstandingRequestCount()
280                        {
281                            return _acceptor->getOutstandingRequestCount();
282                        }
283 tony          1.8      
284 mike          1.41     CIMListenerIndicationDispatcher* 
285                        CIMListenerService::getIndicationDispatcher() const
286 kumpf         1.1      {
287 david.dillard 1.32         return _dispatcher;
288 tony          1.8      }
289 david.dillard 1.34     
290 mike          1.41     void CIMListenerService::setIndicationDispatcher(
291                            CIMListenerIndicationDispatcher* dispatcher)
292 tony          1.8      {
293 david.dillard 1.32         _dispatcher = dispatcher;
294 kumpf         1.1      }
295                        
296 david.dillard 1.34     Uint32 CIMListenerService::getPortNumber() const
297                        {
298                            Uint32 portNumber = _portNumber;
299                        
300 mike          1.41         if ((portNumber == 0) && (_acceptor != 0))
301 david.dillard 1.34         {
302                                portNumber = _acceptor->getPortNumber();
303                            }
304                        
305 mike          1.41         return (portNumber);
306 david.dillard 1.34     }
307                        
308 mike          1.41.2.1 ThreadReturnType PEGASUS_THREAD_CDECL 
309 mike          1.41     CIMListenerService::_listener_routine(void *param)
310 kumpf         1.1      {
311 mike          1.41         CIMListenerService *svc = reinterpret_cast < CIMListenerService * >(param);
312 kumpf         1.1      
313 mike          1.41         try
314 david.dillard 1.32         {
315 mike          1.41             // svc->init(); bug 1394
316                                while (!svc->terminated())
317                                {
318 chuck         1.20     #if defined(PEGASUS_PLATFORM_DARWIN_PPC_GNU)
319 mike          1.41                 pthread_testcancel();
320 chuck         1.20     #endif
321 mike          1.41                 svc->runForever();
322                                }
323 david.dillard 1.32         }
324 mike          1.41         catch(...)
325                            {
326 konrad.r      1.37             Tracer::trace(TRC_SERVER, Tracer::LEVEL2,
327 mike          1.41                           "Unknown exception thrown in _listener_routine.");
328                            }
329                        
330                            // CAUTION: deleting the service also deletes the monitor whose tickle()
331                            // method may still be executing in another thread. This line of code was
332                            // most likely reached when the CIMListenerService::shutdown() method set
333                            // _dieNow to true and called Monitor::tickle(). We must wait until we
334                            // can obtain the _monitorMutex, indicating that we are no longer inside
335                            // Monitor::tickle().
336 mike          1.41.2.1     svc->_monitorMutex.lock(Threads::self());
337 mike          1.41         svc->_monitorMutex.unlock();
338                            delete svc;
339                        
340 david.dillard 1.32         return 0;
341 tony          1.8      }
342                        
343 mike          1.41     ////////////////////////////////////////////////////////////////////////////////
344                        //
345 tony          1.8      // CIMListenerRep
346 mike          1.41     //
347                        ////////////////////////////////////////////////////////////////////////////////
348                        
349 tony          1.8      class CIMListenerRep
350                        {
351                        public:
352 mike          1.41         CIMListenerRep(Uint32 portNumber, SSLContext * sslContext = NULL);
353                            ~CIMListenerRep();
354 tony          1.8      
355 mike          1.41         Uint32 getPortNumber() const;
356 tony          1.8      
357 mike          1.41         SSLContext *getSSLContext() const;
358                            void setSSLContext(SSLContext * sslContext);
359 david.dillard 1.31     
360 mike          1.41         void start();
361                            void stop();
362 tony          1.8      
363 mike          1.41         Boolean isAlive();
364 tony          1.8      
365 mike          1.41         Boolean addConsumer(CIMIndicationConsumer * consumer);
366                            Boolean removeConsumer(CIMIndicationConsumer * consumer);
367 tony          1.8      
368                        private:
369 mike          1.41         Boolean waitForPendingRequests(Uint32 shutdownTimeout);
370 chuck         1.23     
371 mike          1.41         Uint32 _portNumber;
372                            SSLContext *_sslContext;
373 tony          1.8      
374 mike          1.41         CIMListenerIndicationDispatcher *_dispatcher;
375                            ThreadPool *_thread_pool;
376                            CIMListenerService *_svc;
377                            Semaphore *_listener_sem;
378 tony          1.8      };
379                        
380 mike          1.41     CIMListenerRep::CIMListenerRep(
381                            Uint32 portNumber, 
382                            SSLContext * sslContext)
383                            :
384                            _portNumber(portNumber), 
385                            _sslContext(sslContext),
386                            _dispatcher(new CIMListenerIndicationDispatcher()), 
387                            _thread_pool(NULL),
388                            _svc(NULL), 
389                            _listener_sem(NULL)
390 tony          1.8      {
391                        }
392 david.dillard 1.31     
393 tony          1.8      CIMListenerRep::~CIMListenerRep()
394                        {
395 david.dillard 1.31         // if port is alive, clean up the port
396                            if (_thread_pool != 0)
397                            {
398                                // Block incoming export requests and unbind the port
399                                _svc->stopClientConnection();
400                        
401                                // Wait until pending export requests in the server are done.
402                                waitForPendingRequests(10);
403 chuck         1.23     
404 david.dillard 1.31             // Shutdown the CIMListenerService
405                                _svc->shutdown();
406                            }
407 chuck         1.20     
408                            delete _sslContext;
409                            delete _dispatcher;
410                            delete _thread_pool;
411                            delete _listener_sem;
412 tony          1.8      
413 mike          1.41         // don't delete _svc, this is deleted by _listener_routine
414 tony          1.8      }
415                        
416                        Uint32 CIMListenerRep::getPortNumber() const
417                        {
418 david.dillard 1.34         Uint32 portNumber;
419                        
420 mike          1.41         if (_svc == 0)
421 david.dillard 1.34             portNumber = _portNumber;
422 mike          1.41         else
423                                portNumber = _svc->getPortNumber();
424 david.dillard 1.34     
425                            return portNumber;
426 tony          1.8      }
427 kumpf         1.1      
428 mike          1.41     SSLContext *CIMListenerRep::getSSLContext() const
429 tony          1.8      {
430 david.dillard 1.31         return _sslContext;
431 kumpf         1.1      }
432 david.dillard 1.31     
433 mike          1.41     void CIMListenerRep::setSSLContext(SSLContext * sslContext)
434 tony          1.8      {
435 david.dillard 1.31         delete _sslContext;
436                            _sslContext = sslContext;
437                        }
438 kumpf         1.1      
439 tony          1.8      void CIMListenerRep::start()
440 kumpf         1.1      {
441 david.dillard 1.31         // spawn a thread to do this
442 mike          1.41         if (_thread_pool == 0)
443 chuck         1.20         {
444 mike          1.41             AutoPtr < CIMListenerService >
445                                    svc(new CIMListenerService(_portNumber, _sslContext));
446 chuck         1.20     
447 david.dillard 1.31             svc->setIndicationDispatcher(_dispatcher);
448                                svc->init();
449 chuck         1.20     
450 mike          1.41             struct timeval deallocateWait = { 15, 0 };
451                                AutoPtr < ThreadPool >
452                                    threadPool(new ThreadPool(0, "Listener", 0, 1, deallocateWait));
453                                AutoPtr < Semaphore > sem(new Semaphore(0));
454                        
455                                if (threadPool->allocate_and_awaken(
456                                    svc.get(), CIMListenerService::_listener_routine, sem.get()) 
457                                    != PEGASUS_THREAD_OK)
458                                {
459                                    Logger::put(
460                                        Logger::STANDARD_LOG, System::CIMSERVER,
461                                        Logger::TRACE,
462                                        "Not enough threads to start CIMListernerService.");
463                        
464                                    Tracer::trace(
465                                        TRC_SERVER, 
466                                        Tracer::LEVEL2,
467                                        "Could not allocate thread for "
468                                        "CIMListenerService::_listener_routine.");
469                                    throw
470                                        Exception(MessageLoaderParms(
471 mike          1.41                         "Listener.CIMListener.CANNOT_ALLOCATE_THREAD",
472                                            "Could not allocate thread."));
473 konrad.r      1.38             }
474 mike          1.41     
475                                Logger::put(
476                                    Logger::STANDARD_LOG, 
477                                    System::CIMLISTENER,
478                                    Logger::INFORMATION, 
479                                    "CIMListener started");
480 david.dillard 1.31     
481                                _svc = svc.release();
482                                _thread_pool = threadPool.release();
483                                _listener_sem = sem.release();
484                            }
485 tony          1.8      }
486 kumpf         1.1      
487 tony          1.8      void CIMListenerRep::stop()
488                        {
489 mike          1.41         if (_thread_pool != NULL)
490 chuck         1.20         {
491 mike          1.41             // 
492                                // Graceful shutdown of the listener service
493                                // 
494                        
495                                // Block incoming export requests and unbind the port
496                                _svc->stopClientConnection();
497                        
498                                // Wait until pending export requests in the server are done.
499                                waitForPendingRequests(10);
500                        
501                                // Shutdown the CIMListenerService
502                                _svc->shutdown();
503 chuck         1.20     
504 mike          1.41             // Wait for the _listener_routine thread to exit.
505                                // The thread could be delivering an export, so give it 3sec.
506                                // Note that _listener_routine deletes the CIMListenerService,
507                                // so no need to delete _svc.
508                                try
509                                {
510                                    _listener_sem->time_wait(3000);
511                                }
512                                catch(const TimeOut &)
513                                {
514                                    // No need to do anything, the thread pool will be deleted below
515                                    // to cancel the _listener_routine thread if it is still running.
516                                }
517 david.dillard 1.31     
518 mike          1.41             delete _listener_sem;
519                                _listener_sem = NULL;
520 chuck         1.20     
521 mike          1.41             // Delete the thread pool.  This cancels the listener thread if it is 
522                                // still
523                                // running.
524                                delete _thread_pool;
525                                _thread_pool = NULL;
526                        
527                                Logger::put(
528                                    Logger::STANDARD_LOG, System::CIMLISTENER,
529                                    Logger::INFORMATION, "CIMListener stopped");
530                            }
531 kumpf         1.1      }
532                        
533 tony          1.8      Boolean CIMListenerRep::isAlive()
534 kumpf         1.1      {
535 mike          1.41         return (_thread_pool != NULL) ? true : false;
536 tony          1.8      }
537 kumpf         1.1      
538 mike          1.41     Boolean CIMListenerRep::addConsumer(CIMIndicationConsumer * consumer)
539 tony          1.8      {
540 mike          1.41         return _dispatcher->addConsumer(consumer);
541 tony          1.8      }
542 mike          1.41     
543                        Boolean CIMListenerRep::removeConsumer(CIMIndicationConsumer * consumer)
544 tony          1.8      {
545 mike          1.41         return _dispatcher->removeConsumer(consumer);
546 tony          1.8      }
547 kumpf         1.1      
548 chuck         1.23     Boolean CIMListenerRep::waitForPendingRequests(Uint32 shutdownTimeout)
549                        {
550 mike          1.41         // Wait for 10 sec max
551                            Uint32 reqCount;
552                            Uint32 countDown = shutdownTimeout * 10;
553                        
554                            for (; countDown > 0; countDown--)
555                            {
556                                reqCount = _svc->getOutstandingRequestCount();
557                                if (reqCount > 0)
558 mike          1.41.2.1             Threads::sleep(100);
559 mike          1.41             else
560                                    return true;
561                            }
562 david.dillard 1.31     
563 mike          1.41         return false;
564 david.dillard 1.31     }
565 chuck         1.23     
566 tony          1.8      /////////////////////////////////////////////////////////////////////////////
567 mike          1.41     //
568 tony          1.8      // CIMListener
569 mike          1.41     //
570 tony          1.8      /////////////////////////////////////////////////////////////////////////////
571 mike          1.41     
572                        CIMListener::CIMListener(
573                            Uint32 portNumber, 
574                            SSLContext * sslContext) 
575                            :
576                            _rep(new CIMListenerRep(portNumber, sslContext))
577 tony          1.8      {
578                        }
579 mike          1.41     
580 tony          1.8      CIMListener::~CIMListener()
581                        {
582 mike          1.41         if (_rep != NULL)
583                                delete static_cast < CIMListenerRep * >(_rep);
584                            _rep = NULL;
585 tony          1.8      }
586 david.dillard 1.31     
587 tony          1.8      Uint32 CIMListener::getPortNumber() const
588                        {
589 mike          1.41         return static_cast < CIMListenerRep * >(_rep)->getPortNumber();
590 kumpf         1.1      }
591                        
592 mike          1.41     SSLContext *CIMListener::getSSLContext() const
593 tony          1.8      {
594 mike          1.41         return static_cast < CIMListenerRep * >(_rep)->getSSLContext();
595 tony          1.8      }
596 mike          1.41     
597                        void CIMListener::setSSLContext(SSLContext * sslContext)
598 tony          1.8      {
599 mike          1.41         static_cast < CIMListenerRep * >(_rep)->setSSLContext(sslContext);
600 tony          1.8      }
601 mike          1.41     
602 tony          1.8      void CIMListener::start()
603 kumpf         1.1      {
604 mike          1.41         static_cast < CIMListenerRep * >(_rep)->start();
605 tony          1.8      }
606 mike          1.41     
607 tony          1.8      void CIMListener::stop()
608                        {
609 mike          1.41         static_cast < CIMListenerRep * >(_rep)->stop();
610 tony          1.8      }
611 kumpf         1.1      
612 aruran.ms     1.35     Boolean CIMListener::isAlive() const
613 tony          1.8      {
614 mike          1.41         return static_cast < CIMListenerRep * >(_rep)->isAlive();
615 tony          1.8      }
616 kumpf         1.1      
617 mike          1.41     Boolean CIMListener::addConsumer(CIMIndicationConsumer * consumer)
618 tony          1.8      {
619 mike          1.41         return static_cast < CIMListenerRep * >(_rep)->addConsumer(consumer);
620 tony          1.8      }
621 mike          1.41     
622                        Boolean CIMListener::removeConsumer(CIMIndicationConsumer * consumer)
623 tony          1.8      {
624 mike          1.41         return static_cast < CIMListenerRep * >(_rep)->removeConsumer(consumer);
625 kumpf         1.1      }
626                        
627                        PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2