blob: 38dd300ad1a0ac9e139aba05d352a2e0b8ccc3e2 (
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
|
// -*- C++ -*-
//=============================================================================
/**
* @file AMI_Primary_Replication_Strategy.h
*
* $Id$
*
* @author Huang-Ming Huang <hh1@cse.wustl.edu>
*/
//=============================================================================
#ifndef AMI_PRIMARY_REPLICATION_STRATEGY_H
#define AMI_PRIMARY_REPLICATION_STRATEGY_H
#include "UpdateableHandler.h"
#include "Replication_Strategy.h"
#include "orbsvcs/FtRtecEventChannelAdminC.h"
#include "ace/Task.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
class AMI_Primary_Replication_Strategy : public Replication_Strategy
, public ACE_Task_Base
{
public:
AMI_Primary_Replication_Strategy();
virtual ~AMI_Primary_Replication_Strategy();
virtual int init();
virtual void replicate_request(const FTRT::State& state,
RollbackOperation rollback,
const FtRtecEventChannelAdmin::ObjectId& oid
ACE_ENV_ARG_DECL);
virtual int acquire_read (void);
virtual int acquire_write (void);
virtual int release (void);
PortableServer::POA_ptr poa() { return poa_.in(); }
CORBA::ORB_ptr orb() { return orb_.in();}
private:
virtual int svc (void);
CORBA::ORB_var orb_;
PortableServer::POA_var poa_;
PortableServer::POAManager_var mgr_;
bool running_;
ACE_RW_Thread_Mutex mutex_;
UpdateableHandler handler_;
};
#endif // AMI_PRIMARY_REPLICATION_STRATEGY_H
|