Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
4.2 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // EvictNotify.h
  7. //
  8. // Description:
  9. // This file contains the declaration of the CEvictNotify
  10. // class. This class handles is used to clean up a node after it has been
  11. // evicted from a cluster.
  12. //
  13. // Documentation:
  14. // TODO: fill in pointer to external documentation
  15. //
  16. // Implementation Files:
  17. // EvictNotify.cpp
  18. //
  19. // Maintained By:
  20. // Galen Barbee (GalenB) 20-SEP-2001
  21. //
  22. //////////////////////////////////////////////////////////////////////////////
  23. // Make sure that this file is included only once per compile path.
  24. #pragma once
  25. //////////////////////////////////////////////////////////////////////////////
  26. // Include Files
  27. //////////////////////////////////////////////////////////////////////////////
  28. // For IUnknown
  29. #include <unknwn.h>
  30. // For IClusCfgStartup
  31. #include "ClusCfgServer.h"
  32. // For ILogger
  33. #include <ClusCfgClient.h>
  34. //////////////////////////////////////////////////////////////////////////////
  35. //++
  36. //
  37. // class CEvictNotify
  38. //
  39. // Description:
  40. // This class handles is used to clean up a node after it has been
  41. // evicted from a cluster.
  42. //
  43. //--
  44. //////////////////////////////////////////////////////////////////////////////
  45. class CEvictNotify
  46. : public IClusCfgEvictNotify
  47. , public IClusCfgCallback
  48. {
  49. private:
  50. LONG m_cRef; // Reference count for this object.
  51. // IClusCfgCallback
  52. BSTR m_bstrNodeName; // Name of the local node.
  53. ILogger * m_plLogger; // ILogger for doing logging.
  54. // Second phase of a two phase constructor.
  55. HRESULT HrInit( void );
  56. // Enumerate all components on the local computer registered for cluster
  57. // startup notification.
  58. HRESULT HrNotifyListeners( LPCWSTR pcszNodeNameIn );
  59. // Instantiate a cluster evict listener component and call the
  60. // appropriate methods.
  61. HRESULT HrProcessListener(
  62. const CLSID & rclsidListenerCLSIDIn
  63. , LPCWSTR pcszNodeNameIn
  64. );
  65. //
  66. // Private constructors, destructor and assignment operator.
  67. // All of these methods are private for two reasons:
  68. // 1. Lifetimes of objects of this class are controlled by S_HrCreateInstance and Release.
  69. // 2. Copying of an object of this class is prohibited.
  70. //
  71. // Default constructor.
  72. CEvictNotify( void );
  73. // Destructor.
  74. ~CEvictNotify( void );
  75. // Copy constructor.
  76. CEvictNotify( const CEvictNotify & );
  77. // Assignment operator.
  78. CEvictNotify & operator =( const CEvictNotify & );
  79. public:
  80. //
  81. // IUnknown methods
  82. //
  83. STDMETHOD( QueryInterface )( REFIID riid, void ** ppvObject );
  84. STDMETHOD_( ULONG, AddRef )( void );
  85. STDMETHOD_( ULONG, Release )( void );
  86. //
  87. // IClusCfgEvictNotify methods
  88. //
  89. // Send out notification of cluster service startup to interested listeners
  90. STDMETHOD( SendNotifications )( LPCWSTR pcszNodeNameIn );
  91. //////////////////////////////////////////////////////////////////////////
  92. // IClusCfgCallback methods
  93. //////////////////////////////////////////////////////////////////////////
  94. STDMETHOD( SendStatusReport )(
  95. LPCWSTR pcszNodeNameIn
  96. , CLSID clsidTaskMajorIn
  97. , CLSID clsidTaskMinorIn
  98. , ULONG ulMinIn
  99. , ULONG ulMaxIn
  100. , ULONG ulCurrentIn
  101. , HRESULT hrStatusIn
  102. , LPCWSTR pcszDescriptionIn
  103. , FILETIME * pftTimeIn
  104. , LPCWSTR pcszReference
  105. );
  106. //////////////////////////////////////////////////////////////////////////
  107. // Other public methods
  108. //////////////////////////////////////////////////////////////////////////
  109. // Create an instance of this class.
  110. static HRESULT S_HrCreateInstance( IUnknown ** ppunkOut );
  111. }; //*** class CEvictNotify