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

Diff for /pegasus/src/Pegasus/Listener/CIMListenerIndicationDispatcher.cpp between version 1.1 and 1.3

version 1.1, 2003/08/15 14:10:29 version 1.3, 2003/08/16 14:52:27
Line 39 
Line 39 
  
 #include <Pegasus/Listener/List.h> #include <Pegasus/Listener/List.h>
 #include <Pegasus/Consumer/CIMIndicationConsumer.h> #include <Pegasus/Consumer/CIMIndicationConsumer.h>
   #include <Pegasus/Common/ContentLanguages.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 48 
Line 49 
 class CIMListenerIndicationDispatchEvent class CIMListenerIndicationDispatchEvent
 { {
 public: public:
         CIMListenerIndicationDispatchEvent(CIMIndicationConsumer* consumer, String url, CIMInstance instance);          CIMListenerIndicationDispatchEvent(CIMIndicationConsumer* consumer,
                                              String url,
                                              CIMInstance instance,
                                              ContentLanguages contentLangs);
         ~CIMListenerIndicationDispatchEvent();         ~CIMListenerIndicationDispatchEvent();
  
         CIMIndicationConsumer* getConsumer() const;         CIMIndicationConsumer* getConsumer() const;
  
         String getURL() const;         String getURL() const;
         CIMInstance getIndicationInstance() const;         CIMInstance getIndicationInstance() const;
           ContentLanguages getContentLanguages() const;
  
 private: private:
         CIMIndicationConsumer*  _consumer;         CIMIndicationConsumer*  _consumer;
         String                                                                  _url;         String                                                                  _url;
         CIMInstance                                                     _instance;         CIMInstance                                                     _instance;
           ContentLanguages                    _contentLangs;
 }; };
  
 CIMListenerIndicationDispatchEvent::CIMListenerIndicationDispatchEvent(CIMIndicationConsumer* consumer, String url, CIMInstance instance)  CIMListenerIndicationDispatchEvent::CIMListenerIndicationDispatchEvent(CIMIndicationConsumer* consumer,
 :_consumer(consumer),_url(url),_instance(instance)                                                                         String url,
                                                                          CIMInstance instance,
                                                                          ContentLanguages contentLangs)
   :_consumer(consumer),_url(url),_instance(instance), _contentLangs(contentLangs)
 { {
 } }
 CIMListenerIndicationDispatchEvent::~CIMListenerIndicationDispatchEvent() CIMListenerIndicationDispatchEvent::~CIMListenerIndicationDispatchEvent()
Line 81 
Line 90 
 { {
         return _instance;         return _instance;
 } }
   ContentLanguages CIMListenerIndicationDispatchEvent::getContentLanguages() const
   {
           return _contentLangs;
   }
  
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
 // CIMListenerIndicationDispatcherRep // CIMListenerIndicationDispatcherRep
Line 100 
Line 113 
         static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL deliver_routine(void *param);         static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL deliver_routine(void *param);
  
 private: private:
         void    deliverIndication(String url, CIMInstance instance);          void    deliverIndication(String url, CIMInstance instance, ContentLanguages contentLangs);
  
         ThreadPool* _thread_pool;         ThreadPool* _thread_pool;
         PtrList*                _consumers;         PtrList*                _consumers;
Line 146 
Line 159 
  
         CIMInstance instance = request->indicationInstance;         CIMInstance instance = request->indicationInstance;
         String                  url = request->destinationPath;         String                  url = request->destinationPath;
           ContentLanguages contentLangs = request->contentLanguages;
  
         deliverIndication(url,instance);          deliverIndication(url,instance,contentLangs);
  
         // compose a response message         // compose a response message
         CIMException cimException;         CIMException cimException;
Line 164 
Line 178 
         return response;         return response;
 } }
  
 void CIMListenerIndicationDispatcherRep::deliverIndication(String url, CIMInstance instance)  void CIMListenerIndicationDispatcherRep::deliverIndication(String url,
                                                              CIMInstance instance,
                                                              ContentLanguages contentLangs)
 { {
         // go thru all consumers and broadcast the result; should be run in seperate thread         // go thru all consumers and broadcast the result; should be run in seperate thread
         Iterator* it = _consumers->iterator();         Iterator* it = _consumers->iterator();
         while(it->hasNext()==true)         while(it->hasNext()==true)
         {         {
                 CIMIndicationConsumer* consumer = static_cast<CIMIndicationConsumer*>(it->next());                 CIMIndicationConsumer* consumer = static_cast<CIMIndicationConsumer*>(it->next());
                 CIMListenerIndicationDispatchEvent* event = new CIMListenerIndicationDispatchEvent(consumer,url,instance);                  CIMListenerIndicationDispatchEvent* event = new CIMListenerIndicationDispatchEvent(
                                                                                        consumer,
                                                                                        url,
                                                                                        instance,
                                                                                        contentLangs);
                 _thread_pool->allocate_and_awaken(event,deliver_routine);                 _thread_pool->allocate_and_awaken(event,deliver_routine);
         }         }
 } }
Line 183 
Line 203 
         {         {
                 CIMIndicationConsumer* consumer = event->getConsumer();                 CIMIndicationConsumer* consumer = event->getConsumer();
                 OperationContext context;                 OperationContext context;
                   context.insert(ContentLanguageListContainer(event->getContentLanguages()));
                 if(consumer)                 if(consumer)
                 {                 {
                         consumer->consumeIndication(context,event->getURL(),event->getIndicationInstance());                         consumer->consumeIndication(context,event->getURL(),event->getIndicationInstance());
Line 205 
Line 226 
 CIMListenerIndicationDispatcher::~CIMListenerIndicationDispatcher() CIMListenerIndicationDispatcher::~CIMListenerIndicationDispatcher()
 { {
         if(_rep!=NULL)         if(_rep!=NULL)
                 delete _rep;                  delete static_cast<CIMListenerIndicationDispatcherRep*>(_rep);
  
         _rep=NULL;         _rep=NULL;
 } }


Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2