(file) Return to ModuleController.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 martin 1.57 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.58 //
  3 martin 1.57 // Licensed to The Open Group (TOG) under one or more contributor license
  4             // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5             // this work for additional information regarding copyright ownership.
  6             // Each contributor licenses this file to you under the OpenPegasus Open
  7             // Source License; you may not use this file except in compliance with the
  8             // License.
  9 martin 1.58 //
 10 martin 1.57 // Permission is hereby granted, free of charge, to any person obtaining a
 11             // copy of this software and associated documentation files (the "Software"),
 12             // to deal in the Software without restriction, including without limitation
 13             // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14             // and/or sell copies of the Software, and to permit persons to whom the
 15             // Software is furnished to do so, subject to the following conditions:
 16 martin 1.58 //
 17 martin 1.57 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.58 //
 20 martin 1.57 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.58 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.57 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23             // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24             // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25             // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26             // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 martin 1.58 //
 28 martin 1.57 //////////////////////////////////////////////////////////////////////////
 29 mday   1.1  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32 kumpf  1.49 #ifndef Pegasus_ModuleController_h
 33             #define Pegasus_ModuleController_h
 34 mday   1.1  
 35             #include <Pegasus/Common/Config.h>
 36 kumpf  1.49 #include <Pegasus/Common/Linkage.h>
 37 mday   1.19 #include <Pegasus/Common/Constants.h>
 38 kumpf  1.49 #include <Pegasus/Common/List.h>
 39 mday   1.1  #include <Pegasus/Common/Message.h>
 40 venkat.puvvada 1.60 #include <Pegasus/Common/CIMMessage.h>
 41 kumpf          1.49 #include <Pegasus/Common/MessageQueueService.h>
 42 mday           1.1  #include <Pegasus/Common/AsyncOpNode.h>
 43 david.dillard  1.42 #include <Pegasus/Common/AutoPtr.h>
 44 venkat.puvvada 1.59 #include <Pegasus/Common/CIMMessage.h>
 45 mday           1.11 
 46 mday           1.1  PEGASUS_NAMESPACE_BEGIN
 47                     
 48 kumpf          1.49 class PEGASUS_COMMON_LINKAGE RegisteredModuleHandle : public Linkable
 49 mday           1.9  {
 50 david.dillard  1.42 public:
 51 kumpf          1.49     RegisteredModuleHandle(
 52                             const String& name,
 53                             void* module_address,
 54 venkat.puvvada 1.56         Message* (*receive_message)(Message *, void *));
 55 david.dillard  1.42 
 56 kumpf          1.49     virtual ~RegisteredModuleHandle();
 57 david.dillard  1.42 
 58 kumpf          1.51     const String& get_name() const;
 59 david.dillard  1.42 
 60                     private:
 61                     
 62 kumpf          1.49     RegisteredModuleHandle();
 63                         RegisteredModuleHandle(const RegisteredModuleHandle&);
 64                         RegisteredModuleHandle& operator=(const RegisteredModuleHandle&);
 65                     
 66                         Message* _receive_message(Message* msg);
 67                         String _name;
 68                         void* _module_address;
 69                         Message* (*_module_receive_message)(Message *, void *);
 70 david.dillard  1.42 
 71                         friend class ModuleController;
 72 mday           1.5  };
 73 mday           1.4  
 74                     
 75 mday           1.1  class PEGASUS_COMMON_LINKAGE ModuleController : public MessageQueueService
 76                     {
 77 david.dillard  1.42 public:
 78                         typedef MessageQueueService Base;
 79                         ModuleController(const char *name);
 80                     
 81                         ~ModuleController();
 82                     
 83 venkat.puvvada 1.56     void register_module(
 84 kumpf          1.49         const String& module_name,
 85                             void* module_address,
 86 venkat.puvvada 1.56         Message* (*receive_message)(Message *, void *));
 87 david.dillard  1.42 
 88 kumpf          1.47     static ModuleController* getModuleController();
 89 david.dillard  1.42 
 90 venkat.puvvada 1.59     static  void indicationCallback(
 91                             CIMProcessIndicationRequestMessage* request);
 92                     
 93 david.dillard  1.42     // send a message to another service
 94 kumpf          1.49     AsyncReply* ClientSendWait(
 95                             Uint32 destination_q,
 96                             AsyncRequest* request);
 97 david.dillard  1.42 
 98 kumpf          1.47     Boolean ClientSendForget(
 99 kumpf          1.49         Uint32 destination_q,
100                             AsyncRequest* message);
101 david.dillard  1.42 
102                     protected:
103                         // ATTN-RK-P2-20010322:  These methods are pure virtual in superclass
104                         virtual void handleEnqueue() {}
105 venkat.puvvada 1.60     virtual void handleEnqueue(Message *message);
106 david.dillard  1.42     virtual void _handle_async_request(AsyncRequest *rq);
107                         virtual void _handle_async_callback(AsyncOpNode *op);
108                     
109                     private:
110 venkat.puvvada 1.60     static void _indicationDeliveryRoutine(
111                             CIMProcessIndicationRequestMessage* request);
112 venkat.puvvada 1.56     typedef List<RegisteredModuleHandle, Mutex> RegisteredModulesList;
113                         RegisteredModulesList _modules;
114 mday           1.2  };
115 mday           1.35 
116 mday           1.1  PEGASUS_NAMESPACE_END
117                     
118 kumpf          1.49 #endif // Pegasus_ModuleController_h

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2