OW_ProviderIFCBaseIFC.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * Copyright (C) 2001-2004 Vintela, Inc. All rights reserved.
00003 *
00004 * Redistribution and use in source and binary forms, with or without
00005 * modification, are permitted provided that the following conditions are met:
00006 *
00007 *  - Redistributions of source code must retain the above copyright notice,
00008 *    this list of conditions and the following disclaimer.
00009 *
00010 *  - Redistributions in binary form must reproduce the above copyright notice,
00011 *    this list of conditions and the following disclaimer in the documentation
00012 *    and/or other materials provided with the distribution.
00013 *
00014 *  - Neither the name of Vintela, Inc. nor the names of its
00015 *    contributors may be used to endorse or promote products derived from this
00016 *    software without specific prior written permission.
00017 *
00018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00019 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS
00022 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00023 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00024 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00025 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00026 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00027 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00028 * POSSIBILITY OF SUCH DAMAGE.
00029 *******************************************************************************/
00030 
00035 #ifndef OW_PROVIDERIFC_HPP_
00036 #define OW_PROVIDERIFC_HPP_
00037 #include "OW_config.h"
00038 #include "OW_SharedLibraryReference.hpp"
00039 #include "OW_String.hpp"
00040 #include "OW_MethodProviderIFC.hpp"
00041 #include "OW_InstanceProviderIFC.hpp"
00042 #include "OW_SecondaryInstanceProviderIFC.hpp"
00043 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00044 #include "OW_AssociatorProviderIFC.hpp"
00045 #endif
00046 #include "OW_IndicationExportProviderIFC.hpp"
00047 #include "OW_PolledProviderIFC.hpp"
00048 #include "OW_IndicationProviderIFC.hpp"
00049 #include "OW_ProviderEnvironmentIFC.hpp"
00050 #include "OW_InstanceProviderInfo.hpp"
00051 #include "OW_SecondaryInstanceProviderInfo.hpp"
00052 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00053 #include "OW_AssociatorProviderInfo.hpp"
00054 #endif
00055 #include "OW_MethodProviderInfo.hpp"
00056 #include "OW_IndicationProviderInfo.hpp"
00057 #include "OW_IntrusiveReference.hpp"
00058 #include "OW_IntrusiveCountableBase.hpp"
00059 
00060 namespace OW_NAMESPACE
00061 {
00062 
00080 class OW_PROVIDER_API ProviderIFCBaseIFC : public IntrusiveCountableBase
00081 {
00082 public:
00083    ProviderIFCBaseIFC();
00084    virtual ~ProviderIFCBaseIFC();
00091    virtual const char* getName() const = 0;
00097    const UInt32 signature;
00101    void init(const ProviderEnvironmentIFCRef& env,
00102       InstanceProviderInfoArray& i,
00103       SecondaryInstanceProviderInfoArray& si,
00104 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00105       AssociatorProviderInfoArray& a,
00106 #endif
00107       MethodProviderInfoArray& m,
00108       IndicationProviderInfoArray& ind);
00119    InstanceProviderIFCRef getInstanceProvider(const ProviderEnvironmentIFCRef& env,
00120       const char* provIdString);
00131    SecondaryInstanceProviderIFCRef getSecondaryInstanceProvider(const ProviderEnvironmentIFCRef& env,
00132       const char* provIdString);
00143    MethodProviderIFCRef getMethodProvider(const ProviderEnvironmentIFCRef& env,
00144       const char* provIdString);
00145 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00146 
00156    AssociatorProviderIFCRef getAssociatorProvider(const ProviderEnvironmentIFCRef& env,
00157       const char* provIdString);
00158 #endif
00159 
00163    IndicationExportProviderIFCRefArray getIndicationExportProviders(
00164       const ProviderEnvironmentIFCRef& env);
00169    PolledProviderIFCRefArray getPolledProviders(const ProviderEnvironmentIFCRef& env);
00173    void unloadProviders(const ProviderEnvironmentIFCRef& env);
00184    IndicationProviderIFCRef getIndicationProvider(const ProviderEnvironmentIFCRef& env,
00185       const char* provIdString);
00186 
00187    /*
00188     * This function gets called for all providers just before the CIMOM
00189     * shuts down.  It gives providers the opportunity to do any cleanup
00190     * needed for shutdown, while the CIMOM services are still available.
00191     */
00192    void shuttingDown(const ProviderEnvironmentIFCRef& env);
00193 
00194 protected:
00199    virtual void doInit(const ProviderEnvironmentIFCRef& env,
00200       InstanceProviderInfoArray& i,
00201       SecondaryInstanceProviderInfoArray& si,
00202 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00203       AssociatorProviderInfoArray& a,
00204 #endif
00205       MethodProviderInfoArray& m,
00206       IndicationProviderInfoArray& ind) = 0;
00207    virtual InstanceProviderIFCRef doGetInstanceProvider(const ProviderEnvironmentIFCRef& env,
00208       const char* provIdString);
00209    virtual SecondaryInstanceProviderIFCRef doGetSecondaryInstanceProvider(const ProviderEnvironmentIFCRef& env,
00210       const char* provIdString);
00211    virtual MethodProviderIFCRef doGetMethodProvider(const ProviderEnvironmentIFCRef& env,
00212       const char* provIdString);
00213 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00214    virtual AssociatorProviderIFCRef doGetAssociatorProvider(
00215       const ProviderEnvironmentIFCRef& env,
00216       const char* provIdString);
00217 #endif
00218    virtual IndicationExportProviderIFCRefArray doGetIndicationExportProviders(
00219       const ProviderEnvironmentIFCRef& env
00220       );
00221    virtual PolledProviderIFCRefArray doGetPolledProviders(
00222       const ProviderEnvironmentIFCRef& env
00223       );
00224    virtual IndicationProviderIFCRef doGetIndicationProvider(
00225       const ProviderEnvironmentIFCRef& env,
00226       const char* provIdString);
00227    virtual void doUnloadProviders(const ProviderEnvironmentIFCRef& env);
00228    virtual void doShuttingDown(const ProviderEnvironmentIFCRef& env);
00229 };
00230 
00231 typedef SharedLibraryReference< IntrusiveReference<ProviderIFCBaseIFC> > ProviderIFCBaseIFCRef;
00232 
00233 } // end namespace OW_NAMESPACE
00234 
00235 #if !defined(OW_STATIC_SERVICES)
00236 #define OW_PROVIDERIFCFACTORY(prov, name) \
00237 extern "C" OW_EXPORT OW_NAMESPACE::ProviderIFCBaseIFC* \
00238 createProviderIFC() \
00239 { \
00240    return new prov; \
00241 } \
00242 extern "C" OW_EXPORT const char* \
00243 getOWVersion() \
00244 { \
00245    return OW_VERSION; \
00246 }
00247 #else
00248 #define OW_PROVIDERIFCFACTORY(prov, name) \
00249 extern "C" OW_NAMESPACE::ProviderIFCBaseIFC* \
00250 createProviderIFC_##name() \
00251 { \
00252    return new prov; \
00253 }
00254 #endif /* !defined(OW_STATIC_SERVICES) */
00255 
00256 #endif

Generated on Thu Feb 9 08:48:08 2006 for openwbem by  doxygen 1.4.6