00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00035 #ifndef OWBI1_PROVIDERIFC_HPP_INCLUDE_GUARD_
00036 #define OWBI1_PROVIDERIFC_HPP_INCLUDE_GUARD_
00037 #include "OW_config.h"
00038 #include "OWBI1_config.h"
00039 #include "OWBI1_Fwd.hpp"
00040 #include "OW_ProviderIFCBaseIFC.hpp"
00041 #include "OW_Map.hpp"
00042 #include "OW_SharedLibrary.hpp"
00043 #include "OWBI1_ProviderBaseIFC.hpp"
00044 #include "OW_MutexLock.hpp"
00045 #include "OW_SharedLibraryReference.hpp"
00046 #include "OWBI1_IntrusiveReference.hpp"
00047 #include "OWBI1_Array.hpp"
00048
00049
00050
00051
00052 namespace OWBI1
00053 {
00054
00055 using namespace OpenWBEM;
00056
00057 typedef SharedLibraryReference< IntrusiveReference<BI1ProviderBaseIFC> > BI1ProviderBaseIFCRef;
00058
00063 class OWBI1_OWBI1PROVIFC_API BI1ProviderIFC : public ProviderIFCBaseIFC
00064 {
00065 public:
00066 static const char* const CREATIONFUNC;
00067 BI1ProviderIFC();
00068 ~BI1ProviderIFC();
00069
00070
00071 static BI1ProviderBaseIFCRef loadProvider(const OpenWBEM::String& libName, OpenWBEM::LoggerRef logger);
00072
00073 protected:
00074 virtual const char* getName() const { return "owbi1"; }
00079 virtual void doInit(const OpenWBEM::ProviderEnvironmentIFCRef& env,
00080 OpenWBEM::InstanceProviderInfoArray& i,
00081 OpenWBEM::SecondaryInstanceProviderInfoArray& si,
00082 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00083 OpenWBEM::AssociatorProviderInfoArray& a,
00084 #endif
00085 OpenWBEM::MethodProviderInfoArray& m,
00086 OpenWBEM::IndicationProviderInfoArray& ind);
00087 virtual OpenWBEM::InstanceProviderIFCRef doGetInstanceProvider(
00088 const OpenWBEM::ProviderEnvironmentIFCRef& env,
00089 const char* provIdString);
00090 virtual OpenWBEM::SecondaryInstanceProviderIFCRef doGetSecondaryInstanceProvider(
00091 const OpenWBEM::ProviderEnvironmentIFCRef& env,
00092 const char* provIdString);
00093 virtual OpenWBEM::MethodProviderIFCRef doGetMethodProvider(
00094 const OpenWBEM::ProviderEnvironmentIFCRef& env,
00095 const char* provIdString);
00096 virtual OpenWBEM::AssociatorProviderIFCRef doGetAssociatorProvider(
00097 const OpenWBEM::ProviderEnvironmentIFCRef& env,
00098 const char* provIdString);
00099 virtual OpenWBEM::IndicationProviderIFCRef doGetIndicationProvider(
00100 const OpenWBEM::ProviderEnvironmentIFCRef& env,
00101 const char* provIdString);
00102 virtual OpenWBEM::IndicationExportProviderIFCRefArray doGetIndicationExportProviders(
00103 const OpenWBEM::ProviderEnvironmentIFCRef& env
00104 );
00105 virtual OpenWBEM::PolledProviderIFCRefArray doGetPolledProviders(
00106 const OpenWBEM::ProviderEnvironmentIFCRef& env
00107 );
00108 virtual void doUnloadProviders(const OpenWBEM::ProviderEnvironmentIFCRef& env);
00109 virtual void doShuttingDown(const OpenWBEM::ProviderEnvironmentIFCRef& env);
00110 private:
00111
00112
00113
00114 class BI1ProviderInitializationHelper;
00115 typedef OpenWBEM::IntrusiveReference<BI1ProviderInitializationHelper> BI1ProviderInitializationHelperRef;
00116
00117 typedef Map<OpenWBEM::String, BI1ProviderInitializationHelperRef> ProviderMap;
00118 typedef Map<OpenWBEM::String, OpenWBEM::IndicationProviderIFCRef> IndicationProviderMap;
00119
00120 enum StoreProviderFlag
00121 {
00122 dontStoreProvider,
00123 storeProvider
00124 };
00125 enum InitializeProviderFlag
00126 {
00127 dontInitializeProvider,
00128 initializeProvider
00129 };
00130
00131
00132
00133 BI1ProviderBaseIFCRef getProvider(const OpenWBEM::ProviderEnvironmentIFCRef& env,
00134 const char* provIdString, StoreProviderFlag = storeProvider,
00135 InitializeProviderFlag = initializeProvider);
00136
00137 void loadProviders(const OpenWBEM::ProviderEnvironmentIFCRef& env,
00138 OpenWBEM::InstanceProviderInfoArray& i,
00139 OpenWBEM::SecondaryInstanceProviderInfoArray& si,
00140 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00141 OpenWBEM::AssociatorProviderInfoArray& a,
00142 #endif
00143 OpenWBEM::MethodProviderInfoArray& m,
00144 OpenWBEM::IndicationProviderInfoArray& ind);
00145
00146 ProviderMap m_provs;
00147 IndicationProviderMap m_indicationProviders;
00148 OpenWBEM::Mutex m_guard;
00149 OpenWBEM::IndicationExportProviderIFCRefArray m_indicationExportProviders;
00150 OpenWBEM::PolledProviderIFCRefArray m_polledProviders;
00151 bool m_loadDone;
00152 };
00153
00154
00155 }
00156
00157 #endif