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

  1 a.dunfey 1.39.8.1 //%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 a.dunfey 1.39.8.1 // 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 a.dunfey 1.39.8.1 // 
 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 kumpf         1.1      
 46 tony          1.8      #include <Pegasus/Common/Exception.h>
 47                        #include <Pegasus/Common/SSLContext.h>
 48                        #include <Pegasus/Common/Monitor.h>
 49 kumpf         1.1      #include <Pegasus/Common/HTTPAcceptor.h>
 50 kumpf         1.11     #include <Pegasus/Common/PegasusVersion.h>
 51 konrad.r      1.38     #include <Pegasus/Common/MessageLoader.h>
 52 kumpf         1.2      
 53 kumpf         1.1      #include <Pegasus/ExportServer/CIMExportResponseEncoder.h>
 54                        #include <Pegasus/ExportServer/CIMExportRequestDecoder.h>
 55                        
 56 tony          1.8      #include <Pegasus/Consumer/CIMIndicationConsumer.h>
 57                        #include <Pegasus/Listener/CIMListenerIndicationDispatcher.h>
 58                        
 59                        PEGASUS_NAMESPACE_BEGIN
 60                        /////////////////////////////////////////////////////////////////////////////
 61                        // CIMListenerService
 62                        /////////////////////////////////////////////////////////////////////////////
 63                        class CIMListenerService
 64                        {
 65                        public:
 66                        	CIMListenerService(Uint32 portNumber, SSLContext* sslContext=NULL);
 67                        	CIMListenerService(CIMListenerService& svc);
 68                          ~CIMListenerService();
 69                        
 70                        	void				init();
 71                        	/** bind to the port
 72                        	*/
 73                        	void				bind();
 74                        	/** runForever Main runloop for the server.
 75                        	*/
 76                        	void runForever();
 77 david.dillard 1.31     
 78 tony          1.8      	/** Call to gracefully shutdown the server.  The server connection socket
 79                        	will be closed to disable new connections from clients.
 80                        	*/
 81                        	void stopClientConnection();
 82 david.dillard 1.31     
 83 tony          1.8      	/** Call to gracefully shutdown the server.  It is called when the server
 84                        	has been stopped and is ready to be shutdown.  Next time runForever()
 85                        	is called, the server shuts down.
 86                        	*/
 87                        	void shutdown();
 88 david.dillard 1.31     
 89 tony          1.8      	/** Return true if the server has shutdown, false otherwise.
 90                        	*/
 91 david.dillard 1.34     	Boolean terminated() const { return _dieNow; };
 92 david.dillard 1.31     
 93 tony          1.8      	/** Call to resume the sever.
 94                        	*/
 95                        	void resume();
 96 david.dillard 1.31     
 97 tony          1.8      	/** Call to set the CIMServer state.  Also inform the appropriate
 98                        	message queues about the current state of the CIMServer.
 99                        	*/
100                        	void setState(Uint32 state);
101 david.dillard 1.31     
102 tony          1.8      	Uint32 getOutstandingRequestCount();
103                        
104                        	/** Returns the indication listener dispatcher
105                        	 */
106                        	CIMListenerIndicationDispatcher* getIndicationDispatcher() const;
107                        
108 david.dillard 1.34     	/** Returns the indication listener dispatcher
109 tony          1.8      	 */
110                        	void setIndicationDispatcher(CIMListenerIndicationDispatcher* dispatcher);
111                        
112 david.dillard 1.34     	/** Returns the port number being used.
113                        	 */
114                        	Uint32 getPortNumber() const;
115                        
116 tony          1.8      	static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL _listener_routine(void *param);
117                        
118                        private:
119 david.dillard 1.34     	Uint32 _portNumber;
120 tony          1.8      	SSLContext* _sslContext;
121 david.dillard 1.34     	Monitor* _monitor;
122                        	HTTPAcceptor* _acceptor;
123 dj.gorey      1.14     
124                          Boolean					_dieNow;
125 tony          1.8      
126                          CIMListenerIndicationDispatcher* _dispatcher;
127                        
128                          CIMExportResponseEncoder* _responseEncoder;
129                          CIMExportRequestDecoder*  _requestDecoder;
130                        
131                        };
132                        
133                        CIMListenerService::CIMListenerService(Uint32 portNumber, SSLContext* sslContext)
134                        :_portNumber(portNumber)
135                        ,_sslContext(sslContext)
136                        ,_monitor(NULL)
137                        ,_acceptor(NULL)
138                        ,_dieNow(false)
139                        ,_dispatcher(NULL)
140                        ,_responseEncoder(NULL)
141                        ,_requestDecoder(NULL)
142                        {
143                        }
144                        
145                        CIMListenerService::CIMListenerService(CIMListenerService& svc)
146 tony          1.8      :_portNumber(svc._portNumber)
147                        ,_sslContext(svc._sslContext)
148                        ,_monitor(NULL)
149                        ,_acceptor(NULL)
150                        ,_dieNow(svc._dieNow)
151                        ,_dispatcher(NULL)
152                        ,_responseEncoder(NULL)
153                        ,_requestDecoder(NULL)
154                        {
155                        }
156                        CIMListenerService::~CIMListenerService()
157                        {
158 kumpf         1.36         // if port is alive, clean up the port
159                            //delete _sslContext;
160 tony          1.8      
161 kumpf         1.36         delete _responseEncoder;
162 tony          1.8      
163 kumpf         1.36         delete _requestDecoder;
164 kumpf         1.1      
165 kumpf         1.36         //delete _dispatcher;
166 kumpf         1.1      
167 kumpf         1.36         delete _acceptor;
168 kumpf         1.1      
169 kumpf         1.36         delete _monitor;
170 tony          1.8      }
171 kumpf         1.1      
172 tony          1.8      void CIMListenerService::init()
173 kumpf         1.1      {
174 tony          1.8      	PEG_METHOD_ENTER(TRC_LISTENER, "CIMListenerService::init");
175 kumpf         1.1      
176 vijay.eli     1.33       if(NULL == _monitor) _monitor = new Monitor();
177 david.dillard 1.31     
178 tony          1.8      	//_dispatcher = new CIMListenerIndicationDispatcher();
179 kumpf         1.1      
180 vijay.eli     1.33       if(NULL == _responseEncoder) _responseEncoder = new CIMExportResponseEncoder();
181                          if(NULL == _requestDecoder) _requestDecoder = new CIMExportRequestDecoder(
182                                                              _dispatcher,_responseEncoder->getQueueId());
183 tony          1.8      
184 vijay.eli     1.33       if(NULL == _acceptor) _acceptor = new HTTPAcceptor(
185 david.dillard 1.31     		 _monitor,
186                        		 _requestDecoder,
187                        		 false,
188                        		 _portNumber,
189 kumpf         1.19     		 _sslContext,
190                                         false);
191 kumpf         1.1      
192 chuck         1.20       bind();
193 kumpf         1.1      
194 chuck         1.20       PEG_METHOD_EXIT();
195 tony          1.8      }
196 david.dillard 1.34     
197 tony          1.8      void CIMListenerService::bind()
198                        {
199 chuck         1.20       if(_acceptor!=NULL)
200                            { // Bind to the port
201                              _acceptor->bind();
202 tony          1.8      
203 chuck         1.20           //listener.addAcceptor(false, portNumberHttp, false);
204                              Logger::put(Logger::STANDARD_LOG, System::CIMLISTENER, Logger::INFORMATION,
205 tony          1.8                              "Listening on HTTP port $0.", _portNumber);
206 kumpf         1.1      
207 chuck         1.20         }
208 tony          1.8      }
209 chuck         1.20     
210 tony          1.8      void CIMListenerService::runForever()
211                        {
212 chuck         1.20       static int modulator = 0;
213 kumpf         1.1      
214 chuck         1.20       if(!_dieNow)
215 dj.gorey      1.14         {
216 david.dillard 1.31           if(false == _monitor->run(500000))
217                        	{
218 chuck         1.20     	  modulator++;
219 david.dillard 1.31           try
220 a.arora       1.21           {
221                        	     //MessageQueueService::_check_idle_flag = 1;
222                        		 //MessageQueueService::_polling_sem.signal();
223 kumpf         1.30     		 MessageQueueService::get_thread_pool()->cleanupIdleThreads();
224 a.arora       1.21           }
225                        	  catch(...)
226                              {
227                              }
228 chuck         1.20     	}
229                        /*
230                              if (handleShutdownSignal)
231                              {
232                                Tracer::trace(TRC_SERVER, Tracer::LEVEL3,
233                        	"CIMServer::runForever - signal received.  Shutting down.");
234                        
235                        	ShutdownService::getInstance(this)->shutdown(true, 10, false);
236                        	handleShutdownSignal = false;
237                              }
238 tony          1.8      */
239 chuck         1.20         }
240 tony          1.8      }
241 kumpf         1.1      
242 tony          1.8      void CIMListenerService::shutdown()
243                        {
244                            PEG_METHOD_ENTER(TRC_LISTENER, "CIMListenerService::shutdown()");
245 kumpf         1.1      
246 tony          1.8          _dieNow = true;
247 a.arora       1.21         _monitor->tickle();
248 kumpf         1.1      
249 kumpf         1.4          PEG_METHOD_EXIT();
250 kumpf         1.1      }
251                        
252 tony          1.8      void CIMListenerService::resume()
253 kumpf         1.1      {
254 tony          1.8          PEG_METHOD_ENTER(TRC_LISTENER, "CIMListenerService::resume()");
255 kumpf         1.1      
256 tony          1.8          if(_acceptor!=NULL)
257                                _acceptor->reopenConnectionSocket();
258 kumpf         1.1      
259 kumpf         1.4          PEG_METHOD_EXIT();
260 kumpf         1.1      }
261                        
262 tony          1.8      void CIMListenerService::stopClientConnection()
263 kumpf         1.1      {
264 tony          1.8          PEG_METHOD_ENTER(TRC_LISTENER, "CIMListenerService::stopClientConnection()");
265 kumpf         1.1      
266 kumpf         1.10         // tell Monitor to stop listening for client connections
267 chuck         1.22         _monitor->stopListeningForConnections(true);
268 kumpf         1.10     
269                            //
270                            // Wait 150 milliseconds to allow time for the Monitor to stop
271                            // listening for client connections.
272                            //
273                            // This wait time is the timeout value for the select() call
274                            // in the Monitor's run() method (currently set to 100
275                            // milliseconds) plus a delta of 50 milliseconds.  The reason
276                            // for the wait here is to make sure that the Monitor entries
277                            // are updated before closing the connection sockets.
278                            //
279 a.arora       1.21         // pegasus_sleep(150); Not needed now due to the semaphore in the Monitor
280 david.dillard 1.31     
281 tony          1.8          if(_acceptor!=NULL)
282                            _acceptor->closeConnectionSocket();
283 kumpf         1.1      
284 kumpf         1.4          PEG_METHOD_EXIT();
285 kumpf         1.1      }
286                        
287 chuck         1.23     Uint32 CIMListenerService::getOutstandingRequestCount()
288                        {
289                            return _acceptor->getOutstandingRequestCount();
290                        }
291 tony          1.8      
292                        CIMListenerIndicationDispatcher* CIMListenerService::getIndicationDispatcher() const
293 kumpf         1.1      {
294 david.dillard 1.32         return _dispatcher;
295 tony          1.8      }
296 david.dillard 1.34     
297 tony          1.8      void CIMListenerService::setIndicationDispatcher(CIMListenerIndicationDispatcher* dispatcher)
298                        {
299 david.dillard 1.32         _dispatcher = dispatcher;
300 kumpf         1.1      }
301                        
302 david.dillard 1.34     Uint32 CIMListenerService::getPortNumber() const
303                        {
304                        
305                            Uint32 portNumber = _portNumber;
306                        
307                            if (( portNumber == 0 ) && ( _acceptor != 0 ))
308                            {
309                                portNumber = _acceptor->getPortNumber();
310                            }
311                        
312                            return(portNumber);
313                        }
314                        
315 tony          1.8      PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL CIMListenerService::_listener_routine(void *param)
316 kumpf         1.1      {
317 konrad.r      1.37       try { 
318 david.dillard 1.32         AutoPtr<CIMListenerService> svc(reinterpret_cast<CIMListenerService *>(param));
319 kumpf         1.1      
320 david.dillard 1.32         //svc->init(); bug 1394
321                            while(!svc->terminated())
322                            {
323 chuck         1.20     #if defined(PEGASUS_PLATFORM_DARWIN_PPC_GNU)
324 david.dillard 1.32             pthread_testcancel();
325 chuck         1.20     #endif
326 david.dillard 1.32             svc->runForever();
327                            }
328 konrad.r      1.37       } catch (...) 
329                          { 
330                                Tracer::trace(TRC_SERVER, Tracer::LEVEL2,
331                        			"Unknown exception thrown in _listener_routine.");
332                          }
333 david.dillard 1.32         return 0;
334 tony          1.8      }
335                        
336                        /////////////////////////////////////////////////////////////////////////////
337                        // CIMListenerRep
338                        /////////////////////////////////////////////////////////////////////////////
339                        class CIMListenerRep
340                        {
341                        public:
342                        	CIMListenerRep(Uint32 portNumber, SSLContext* sslContext=NULL);
343                          ~CIMListenerRep();
344                        
345                        	Uint32 getPortNumber() const;
346                        
347                        	SSLContext* getSSLContext() const;
348                        	void setSSLContext(SSLContext* sslContext);
349 david.dillard 1.31     
350 tony          1.8      	void start();
351                        	void stop();
352                        
353                        	Boolean isAlive();
354                        
355                        	Boolean addConsumer(CIMIndicationConsumer* consumer);
356                        	Boolean removeConsumer(CIMIndicationConsumer* consumer);
357                        
358                        private:
359 chuck         1.23       Boolean waitForPendingRequests(Uint32 shutdownTimeout);
360                        
361                          Uint32 _portNumber;
362                          SSLContext* _sslContext;
363 tony          1.8      
364                          CIMListenerIndicationDispatcher* _dispatcher;
365 chuck         1.23       ThreadPool* _thread_pool;
366 david.dillard 1.31       CIMListenerService* _svc;
367 chuck         1.20       Semaphore *_listener_sem;
368 tony          1.8      };
369                        
370                        CIMListenerRep::CIMListenerRep(Uint32 portNumber, SSLContext* sslContext)
371                        :_portNumber(portNumber)
372                        ,_sslContext(sslContext)
373                        ,_dispatcher(new CIMListenerIndicationDispatcher())
374                        ,_thread_pool(NULL)
375 chuck         1.20     ,_svc(NULL)
376                        ,_listener_sem(NULL)
377 tony          1.8      {
378                        }
379 david.dillard 1.31     
380 tony          1.8      CIMListenerRep::~CIMListenerRep()
381                        {
382 david.dillard 1.31         // if port is alive, clean up the port
383                            if (_thread_pool != 0)
384                            {
385                                // Block incoming export requests and unbind the port
386                                _svc->stopClientConnection();
387                        
388                                // Wait until pending export requests in the server are done.
389                                waitForPendingRequests(10);
390 chuck         1.23     
391 david.dillard 1.31             // Shutdown the CIMListenerService
392                                _svc->shutdown();
393                            }
394 chuck         1.20     
395                            delete _sslContext;
396                            delete _dispatcher;
397                            delete _thread_pool;
398                            delete _listener_sem;
399 tony          1.8      
400 chuck         1.20       // don't delete _svc, this is deleted by _listener_routine
401 tony          1.8      }
402                        
403                        Uint32 CIMListenerRep::getPortNumber() const
404                        {
405 david.dillard 1.34         Uint32 portNumber;
406                        
407                            if ( _svc == 0 )
408                            {
409                                portNumber = _portNumber;
410                            }
411                            else portNumber = _svc->getPortNumber();
412                        
413                            return portNumber;
414 tony          1.8      }
415 kumpf         1.1      
416 tony          1.8      SSLContext* CIMListenerRep::getSSLContext() const
417                        {
418 david.dillard 1.31         return _sslContext;
419 kumpf         1.1      }
420 david.dillard 1.31     
421 tony          1.8      void CIMListenerRep::setSSLContext(SSLContext* sslContext)
422                        {
423 david.dillard 1.31         delete _sslContext;
424                            _sslContext = sslContext;
425                        }
426 kumpf         1.1      
427 tony          1.8      void CIMListenerRep::start()
428 kumpf         1.1      {
429 david.dillard 1.31         // spawn a thread to do this
430                            if(_thread_pool==0)
431 chuck         1.20         {
432 david.dillard 1.31             AutoPtr<CIMListenerService> svc(new CIMListenerService(_portNumber,_sslContext));
433 chuck         1.20     
434 david.dillard 1.31             svc->setIndicationDispatcher(_dispatcher);
435                                svc->init();
436 chuck         1.20     
437 david.dillard 1.31             struct timeval deallocateWait = {15, 0};
438                                AutoPtr<ThreadPool> threadPool(new ThreadPool(0, "Listener", 0, 1, deallocateWait));
439                                AutoPtr<Semaphore> sem(new Semaphore(0));
440 konrad.r      1.38             if (threadPool->allocate_and_awaken(svc.get(), CIMListenerService::_listener_routine, sem.get()) != PEGASUS_THREAD_OK)
441                            	{
442                        	    Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
443                        			"Not enough threads to start CIMListernerService.");
444                         
445                        	    Tracer::trace(TRC_SERVER, Tracer::LEVEL2,
446                        			"Could not allocate thread for CIMListenerService::_listener_routine."); 
447                        	    throw Exception(MessageLoaderParms("Listener.CIMListener.CANNOT_ALLOCATE_THREAD",
448                        				"Could not allocate thread."));
449                                }
450 david.dillard 1.31             Logger::put(Logger::STANDARD_LOG,System::CIMLISTENER, Logger::INFORMATION,
451                                                "CIMListener started");
452                        
453                                _svc = svc.release();
454                                _thread_pool = threadPool.release();
455                                _listener_sem = sem.release();
456                            }
457 tony          1.8      }
458 kumpf         1.1      
459 tony          1.8      void CIMListenerRep::stop()
460                        {
461 chuck         1.20       if(_thread_pool!=NULL)
462 david.dillard 1.31       {
463 chuck         1.20         //
464                            // Graceful shutdown of the listener service
465                            //
466                        
467                            // Block incoming export requests and unbind the port
468                            _svc->stopClientConnection();
469 chuck         1.23     
470                            // Wait until pending export requests in the server are done.
471 chuck         1.24         waitForPendingRequests(10);
472 david.dillard 1.31     
473 chuck         1.20         // Shutdown the CIMListenerService
474                            _svc->shutdown();
475                        
476                            // Wait for the _listener_routine thread to exit.
477                            // The thread could be delivering an export, so give it 3sec.
478                            // Note that _listener_routine deletes the CIMListenerService,
479                            // so no need to delete _svc.
480                            try
481                            {
482 david.dillard 1.31           _listener_sem->time_wait(3000);
483 chuck         1.20         }
484 david.dillard 1.34         catch (const TimeOut &)
485 chuck         1.20         {
486                              // No need to do anything, the thread pool will be deleted below
487                              // to cancel the _listener_routine thread if it is still running.
488                            }
489                        
490                            delete _listener_sem;
491                            _listener_sem = NULL;
492 david.dillard 1.31     
493 chuck         1.20         // Delete the thread pool.  This cancels the listener thread if it is still
494                            // running.
495                            delete _thread_pool;
496                            _thread_pool = NULL;
497                        
498                            Logger::put(Logger::STANDARD_LOG,System::CIMLISTENER,
499                        		Logger::INFORMATION,
500                        		"CIMListener stopped");
501                          }
502 kumpf         1.1      }
503                        
504 tony          1.8      Boolean CIMListenerRep::isAlive()
505 kumpf         1.1      {
506 tony          1.8      	return (_thread_pool!=NULL)?true:false;
507                        }
508 kumpf         1.1      
509 tony          1.8      Boolean CIMListenerRep::addConsumer(CIMIndicationConsumer* consumer)
510                        {
511                        	return _dispatcher->addConsumer(consumer);
512                        }
513                        Boolean CIMListenerRep::removeConsumer(CIMIndicationConsumer* consumer)
514                        {
515                        	return _dispatcher->removeConsumer(consumer);
516                        }
517 kumpf         1.1      
518 chuck         1.23     Boolean CIMListenerRep::waitForPendingRequests(Uint32 shutdownTimeout)
519                        {
520                          // Wait for 10 sec max
521                          Uint32 reqCount;
522                          Uint32 countDown = shutdownTimeout * 10;
523                          for (; countDown > 0; countDown--)
524                          {
525                            reqCount = _svc->getOutstandingRequestCount();
526                            if (reqCount > 0)
527                              pegasus_sleep(100);
528                            else
529                              return true;
530                          }
531 david.dillard 1.31     
532 chuck         1.23       return false;
533 david.dillard 1.31     }
534 chuck         1.23     
535 tony          1.8      /////////////////////////////////////////////////////////////////////////////
536                        // CIMListener
537                        /////////////////////////////////////////////////////////////////////////////
538                        CIMListener::CIMListener(Uint32 portNumber, SSLContext* sslContext)
539                        :_rep(new CIMListenerRep(portNumber,sslContext))
540                        {
541                        }
542                        CIMListener::~CIMListener()
543                        {
544                        	if(_rep!=NULL)
545 tony          1.9      		delete static_cast<CIMListenerRep*>(_rep);
546 tony          1.8      	_rep=NULL;
547                        }
548 david.dillard 1.31     
549 tony          1.8      Uint32 CIMListener::getPortNumber() const
550                        {
551                        	return static_cast<CIMListenerRep*>(_rep)->getPortNumber();
552 kumpf         1.1      }
553                        
554 tony          1.8      SSLContext* CIMListener::getSSLContext() const
555                        {
556                        	return static_cast<CIMListenerRep*>(_rep)->getSSLContext();
557                        }
558                        void CIMListener::setSSLContext(SSLContext* sslContext)
559                        {
560                        	static_cast<CIMListenerRep*>(_rep)->setSSLContext(sslContext);
561                        }
562                        void CIMListener::start()
563 kumpf         1.1      {
564 tony          1.8      	static_cast<CIMListenerRep*>(_rep)->start();
565                        }
566                        void CIMListener::stop()
567                        {
568                        	static_cast<CIMListenerRep*>(_rep)->stop();
569                        }
570 kumpf         1.1      
571 aruran.ms     1.35     Boolean CIMListener::isAlive() const
572 tony          1.8      {
573                        	return static_cast<CIMListenerRep*>(_rep)->isAlive();
574                        }
575 kumpf         1.1      
576 tony          1.8      Boolean CIMListener::addConsumer(CIMIndicationConsumer* consumer)
577                        {
578                        	return static_cast<CIMListenerRep*>(_rep)->addConsumer(consumer);
579                        }
580                        Boolean CIMListener::removeConsumer(CIMIndicationConsumer* consumer)
581                        {
582                        	return static_cast<CIMListenerRep*>(_rep)->removeConsumer(consumer);
583 kumpf         1.1      }
584                        
585                        PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2