blob: b541ee3dd8675f9f2ccb3716eb5f36efd368007b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
// -*- C++ -*-
//=============================================================================
/**
* @file Replication_Service.h
*
* @author Huang-Ming Huang <hh1@cse.wustl.edu>
*/
//=============================================================================
#ifndef REPLCATION_SERVICE_H
#define REPLCATION_SERVICE_H
#include "orbsvcs/FtRtecEventChannelAdminC.h"
#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h"
#include "tao/PortableInterceptorC.h"
#include "ace/Service_Object.h"
#include "orbsvcs/FtRtEvent/EventChannel/ftrtec_export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
namespace FTRTEC
{
class TAO_FTRTEC_Export Replication_Service
: public TAO_FTEC_Become_Primary_Listener
, public ACE_Service_Object
{
public:
static Replication_Service* instance();
Replication_Service();
~Replication_Service();
virtual int init (int argc,
ACE_TCHAR* []);
virtual void become_primary();
/**
* Used for checking if the incoming replication message is out of sequence.
*/
void check_validity();
typedef void (FtRtecEventChannelAdmin::EventChannelFacade::*RollbackOperation)
(const FtRtecEventChannelAdmin::ObjectId&);
/**
* Replicate a request.
*
* @param state The request to be replicated.
* @param rollback The rollback operation when the replication failed.
*/
void replicate_request(const FtRtecEventChannelAdmin::Operation& update,
RollbackOperation rollback);
/**
* Inform the backup replicas that a new replica has joined the object
* group.
*/
void add_member(const FTRT::ManagerInfo & info,
CORBA::ULong object_group_ref_version);
int acquire_read ();
int acquire_write ();
int release ();
int threads() const;
};
}
TAO_END_VERSIONED_NAMESPACE_DECL
ACE_STATIC_SVC_DECLARE_EXPORT (TAO_FTRTEC, Replication_Service)
ACE_STATIC_SVC_REQUIRE(Replication_Service)
ACE_FACTORY_DECLARE (TAO_FTRTEC, Replication_Service)
#endif //REPLCATION_SERVICE_H
|