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

  1 schuur 1.1 //%/////////////////////////////////////////////////////////////////////////////
  2            //
  3            // Copyright (c) 2000 - 2003 BMC Software, Hewlett-Packard Company, IBM,
  4            // The Open Group, Tivoli Systems
  5            //
  6            // Permission is hereby granted, free of charge, to any person obtaining a copy
  7            // of this software and associated documentation files (the "Software"), to
  8            // deal in the Software without restriction, including without limitation the
  9            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 10            // sell copies of the Software, and to permit persons to whom the Software is
 11            // furnished to do so, subject to the following conditions:
 12            //
 13            // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14            // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 17            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 18            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 19            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21            //
 22 schuur 1.1 //==============================================================================
 23            //
 24            // Author: Chip Vincent (cvincent@us.ibm.com)
 25            //
 26            // Modified By: Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com)
 27            //              Jenny Yu, Hewlett-Packard Company(jenny_yu@hp.com)
 28            //              Mike Day, IBM (mdday@us.ibm.com)
 29            //              Adrian Schuur, schuur@de.ibm.com
 30 schuur 1.1.6.1 //              Dan Gorey, IBM djgorey@us.ibm.com
 31 schuur 1.1     //
 32                //%/////////////////////////////////////////////////////////////////////////////
 33                
 34                #ifndef Pegasus_CMPILocalProviderManager_h
 35                #define Pegasus_CMPILocalProviderManager_h
 36                
 37                #include <Pegasus/Common/Config.h>
 38                #include <Pegasus/Common/String.h>
 39                #include <Pegasus/Common/IPC.h>
 40                #include <Pegasus/Common/DQueue.h>
 41                #include <Pegasus/Common/HashTable.h>
 42                
 43                #include <Pegasus/Provider/CIMNullProvider.h>
 44                
 45                #include <Pegasus/ProviderManager2/CMPI/CMPIProvider.h>
 46                #include <Pegasus/ProviderManager2/CMPI/CMPIResolverModule.h>
 47                #include <Pegasus/ProviderManager2/CMPI/CMPIProviderManager.h>
 48                
 49                #include <Pegasus/ProviderManager2/Lockable.h>
 50                
 51 schuur 1.1.6.2 #include <Pegasus/ProviderManager2/CMPI/Linkage.h>
 52 schuur 1.1     
 53                PEGASUS_NAMESPACE_BEGIN
 54                
 55 schuur 1.1.6.2 class PEGASUS_CMPIPM_LINKAGE CMPILocalProviderManager
 56 schuur 1.1     {
 57                
 58                public:
 59                    CMPILocalProviderManager(void);
 60                    virtual ~CMPILocalProviderManager(void);
 61                
 62                public:
 63                    CMPIProvider::OpProviderHolder getProvider(const String & fileName, const String & providerName,
 64                         const String & interfaceName = String::EMPTY);
 65                
 66                    void unloadProvider(const String & fileName, const String & providerName);
 67                
 68                    void shutdownAllProviders(void);
 69                
 70                    static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL provider_monitor(void *);
 71                
 72                    void unload_idle_providers(void);
 73                
 74                private:
 75                    enum CTRL
 76                    {
 77 schuur 1.1             INSERT_PROVIDER,
 78                        INSERT_MODULE,
 79                        LOOKUP_PROVIDER,
 80                        LOOKUP_MODULE,
 81                        GET_PROVIDER,
 82                        UNLOAD_PROVIDER,
 83                        UNLOAD_ALL_PROVIDERS,
 84 schuur 1.1.6.1         UNLOAD_IDLE_PROVIDERS
 85 schuur 1.1         };
 86                
 87                    typedef HashTable<String, CMPIProvider *,
 88                        EqualFunc<String>,  HashFunc<String> > ResolverTable;
 89                
 90                    typedef HashTable<String, CMPIProvider *,
 91                        EqualFunc<String>,  HashFunc<String> > ProviderTable;
 92                
 93                    typedef HashTable<String, CMPIProviderModule *,
 94                        EqualFunc<String>, HashFunc<String> > ModuleTable;
 95                
 96                    typedef struct
 97                    {
 98                        const String *providerName;
 99                        const String *fileName;
100                        const String *interfaceName;
101                    } CTRL_STRINGS;
102                
103                    friend class ProviderManagerService;
104                
105                    ResolverTable _resolvers;
106 schuur 1.1         ProviderTable _providers;
107                    ModuleTable _modules;
108                    Uint32 _idle_timeout;
109                
110                    CMPIProvider *_getResolver(const String & fileName, const String & interfaceType);
111                    CMPIResolverModule *_loadResolver(const String & fileName);
112                    Sint32 _provider_ctrl(CTRL code, void *parm, void *ret);
113                    AtomicInt _unload_idle_flag;
114                
115 schuur 1.1.6.1     CMPIProvider* _initProvider(CMPIProvider * provider,
116                                            const String & moduleFileName,
117                                            const String & interfaceName);
118                
119                    void _unloadProvider(CMPIProvider * provider);
120                
121                    CMPIProvider * _lookupProvider(const String & providerName);
122                
123                    CMPIProviderModule * _lookupModule(const String & moduleFileName,
124                                                    const String & interfaceName);
125                    Mutex _providerTableMutex;
126                                                    
127 schuur 1.1     
128                protected:
129                
130                };
131                
132                PEGASUS_NAMESPACE_END
133                
134                #endif
135                

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2