(file) Return to CMPILocalProviderManager.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2 / CMPI

  1 a.dunfey 1.11.8.1 //%2006////////////////////////////////////////////////////////////////////////
  2 schuur   1.1      //
  3 karl     1.7      // 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                   // IBM Corp.; EMC Corporation, The Open Group.
  7                   // 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.8      // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10                   // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 a.dunfey 1.11.8.1 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12                   // EMC Corporation; Symantec Corporation; The Open Group.
 13 schuur   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.7      // 
 21 schuur   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                   // Author: Chip Vincent (cvincent@us.ibm.com)
 33                   //
 34                   // Modified By: Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com)
 35                   //              Jenny Yu, Hewlett-Packard Company(jenny_yu@hp.com)
 36                   //              Mike Day, IBM (mdday@us.ibm.com)
 37                   //              Adrian Schuur, schuur@de.ibm.com
 38 dj.gorey 1.2      //              Dan Gorey, IBM djgorey@us.ibm.com
 39 schuur   1.1      //
 40                   //%/////////////////////////////////////////////////////////////////////////////
 41                   
 42                   #ifndef Pegasus_CMPILocalProviderManager_h
 43                   #define Pegasus_CMPILocalProviderManager_h
 44                   
 45                   #include <Pegasus/Common/Config.h>
 46                   #include <Pegasus/Common/String.h>
 47                   #include <Pegasus/Common/IPC.h>
 48                   #include <Pegasus/Common/DQueue.h>
 49                   #include <Pegasus/Common/HashTable.h>
 50                   
 51                   #include <Pegasus/ProviderManager2/CMPI/CMPIProvider.h>
 52                   #include <Pegasus/ProviderManager2/CMPI/CMPIResolverModule.h>
 53                   
 54                   #include <Pegasus/ProviderManager2/Lockable.h>
 55                   
 56 schuur   1.4      #include <Pegasus/ProviderManager2/CMPI/Linkage.h>
 57 schuur   1.1      
 58                   PEGASUS_NAMESPACE_BEGIN
 59                   
 60 schuur   1.4      class PEGASUS_CMPIPM_LINKAGE CMPILocalProviderManager
 61 schuur   1.1      {
 62                   
 63                   public:
 64                       CMPILocalProviderManager(void);
 65                       virtual ~CMPILocalProviderManager(void);
 66                   
 67                   public:
 68 schuur   1.6          CMPIProvider::OpProviderHolder getProvider(const String & fileName, const String & providerName);
 69                            
 70                       CMPIProvider::OpProviderHolder getRemoteProvider(const String & fileName, const String & providerName);
 71 schuur   1.1      
 72                       void unloadProvider(const String & fileName, const String & providerName);
 73                   
 74                       void shutdownAllProviders(void);
 75                   
 76 kumpf    1.5          Boolean hasActiveProviders();
 77                       void unloadIdleProviders();
 78 schuur   1.1      
 79 carolann.graves 1.9          /**
 80                                   Gets list of indication providers to be enabled.
 81                                   Once IndicationService initialization has been completed, the
 82                                   enableIndications() method must be called on each indication provider
 83                                   that has current subscriptions.
 84                          
 85                                   @return list of providers whose enableIndications() method must be
 86                                           called
 87                               */
 88                              Array <CMPIProvider *> getIndicationProvidersToEnable ();
 89 konrad.r        1.11     	static void cleanupThread(Thread *t, CMPIProvider *p);
 90 carolann.graves 1.9      
 91 schuur          1.1      private:
 92                              enum CTRL
 93                              {
 94                                  INSERT_PROVIDER,
 95                                  INSERT_MODULE,
 96                                  LOOKUP_PROVIDER,
 97                                  LOOKUP_MODULE,
 98                                  GET_PROVIDER,
 99                                  UNLOAD_PROVIDER,
100                                  UNLOAD_ALL_PROVIDERS,
101 schuur          1.3              UNLOAD_IDLE_PROVIDERS
102 schuur          1.1          };
103                          
104                              typedef HashTable<String, CMPIProvider *,
105                                  EqualFunc<String>,  HashFunc<String> > ResolverTable;
106                          
107                              typedef HashTable<String, CMPIProvider *,
108                                  EqualFunc<String>,  HashFunc<String> > ProviderTable;
109                          
110                              typedef HashTable<String, CMPIProviderModule *,
111                                  EqualFunc<String>, HashFunc<String> > ModuleTable;
112                          
113                              typedef struct
114                              {
115                                  const String *providerName;
116                                  const String *fileName;
117 schuur          1.6              const String *location;
118 schuur          1.1          } CTRL_STRINGS;
119                          
120                              friend class ProviderManagerService;
121                          
122                              ResolverTable _resolvers;
123                              ProviderTable _providers;
124                              ModuleTable _modules;
125                              Uint32 _idle_timeout;
126                              Sint32 _provider_ctrl(CTRL code, void *parm, void *ret);
127                          
128 dj.gorey        1.2          CMPIProvider* _initProvider(CMPIProvider * provider,
129 schuur          1.6                                  const String & moduleFileName); 
130 dj.gorey        1.2      
131                              void _unloadProvider(CMPIProvider * provider);
132                          
133                              CMPIProvider * _lookupProvider(const String & providerName);
134                          
135 schuur          1.6          CMPIProviderModule * _lookupModule(const String & moduleFileName);
136 dj.gorey        1.2          Mutex _providerTableMutex;
137 konrad.r        1.11     	                                    
138                             /*
139                             *  The cleaning functions for provider threads.
140                             */
141                          
142                             static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL _reaper(void *);
143                          
144                            /*
145                             * The data structures for holding the thread and the CMPIProvider
146                             */
147                          
148                             struct cleanupThreadRecord {
149                          		cleanupThreadRecord(): thread(0), provider(0) {}
150                          		cleanupThreadRecord(Thread *t, CMPIProvider *p): thread(t), provider(p) { }
151                          		Thread *thread;
152                          		CMPIProvider *provider;
153                             };
154                          
155                             static Thread* _reaperThread;
156                             static Semaphore _pollingSem;
157                             static AtomicInt _stopPolling;
158 konrad.r        1.11        static Mutex _reaperMutex;
159                             static DQueue<cleanupThreadRecord> _finishedThreadList;
160                          
161 schuur          1.1      protected:
162                          
163                          };
164                          
165                          PEGASUS_NAMESPACE_END
166                          
167                          #endif
168                          

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2