blob: 19280efe312ab67867e51c3193b9738049ce7fb6 (
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
/* -*- C++ -*- */
//=============================================================================
/**
* @file Invocation_Retry_State.h
*
* @author Byron Harris (harrisb@ociweb.com)
*
*/
//=============================================================================
#ifndef TAO_INVOCATION_RETRY_STATE_H
#define TAO_INVOCATION_RETRY_STATE_H
#include "tao/Stub.h"
#include "tao/Invocation_Retry_Params.h"
#include "ace/Array_Map.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
namespace TAO
{
/**
* @class Invocation_Retry_State
*
* @brief Maintains state of invocation retries.
*/
class Invocation_Retry_State
{
public:
Invocation_Retry_State (TAO_Stub &stub);
~Invocation_Retry_State ();
/**
* Answer if any profile forward on exception limit
* parameter is used.
*/
bool forward_on_exception_limit_used () const;
/**
* Attempt to increment the count of profile
* forwards.
* @return false if forward on exception is not
* being used or the limit has been reached.
*/
bool forward_on_exception_increment (const int ef);
/**
* Attempt to increment the count of retries
* when a server connection is seen as closed
* during reply.
*/
bool forward_on_reply_closed_increment ();
/**
* Increment to next profile in preparation
* to retry using that profile.
* If the next profile is the starting
* base profile then also call
* sleep ().
* @see TAO_Stub::next_profile_retry()
*/
void next_profile_retry (TAO_Stub &stub) const;
/**
* Sleep if profile is the starting
* base profile.
*/
void sleep_at_starting_profile (TAO_Stub &stub) const;
/**
* Sleep according to the delay value
* in Invocation_Retry_Params.
*/
void sleep () const;
private:
typedef ACE_Array_Map<int, int> Ex_Count_Map;
Ex_Count_Map ex_count_map_;
int forward_on_reply_closed_count_;
Invocation_Retry_Params retry_params_;
bool forward_on_exception_limit_used_;
};
}
TAO_END_VERSIONED_NAMESPACE_DECL
#endif /* TAO_INVOCATION_RETRY_STATE_H*/
|