summaryrefslogtreecommitdiff
path: root/TAO/tao/PortableServer/Active_Policy_Strategies.h
blob: b5f2cac656cde2a7503dffe3092dd21a7b910854 (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// -*- C++ -*-

//=============================================================================
/**
 *  @file Active_Policy_Strategies.h
 *
 *  $Id$
 *
 *  @author  Johnny Willemsen  <jwillemsen@remedy.nl>
 */
//=============================================================================

#ifndef TAO_PORTABLESERVER_ACTIVE_POLICY_STRATEGIES_H
#define TAO_PORTABLESERVER_ACTIVE_POLICY_STRATEGIES_H

#include /**/ "ace/pre.h"

#include "tao/orbconf.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_Root_POA;

namespace TAO
{
  namespace Portable_Server
  {
    class Cached_Policies;
    class ThreadStrategy;
    class RequestProcessingStrategy;
    class IdAssignmentStrategy;
    class LifespanStrategy;
    class IdUniquenessStrategy;
    class ImplicitActivationStrategy;
    class ServantRetentionStrategy;

    class ThreadStrategyFactory;
    class ServantRetentionStrategyFactory;
    class RequestProcessingStrategyFactory;
    class LifespanStrategyFactory;
    class ImplicitActivationStrategyFactory;
    class IdUniquenessStrategyFactory;
    class IdAssignmentStrategyFactory;

    /**
     * This class stores the active policy strategies used for a certain POA.
     */
    class Active_Policy_Strategies
    {
    public:
      Active_Policy_Strategies (void);

      void update (Cached_Policies &policies,
                   TAO_Root_POA* poa
                  );

      void cleanup (void);

      ThreadStrategy *thread_strategy (void) const;

      RequestProcessingStrategy *request_processing_strategy (void) const;

      IdAssignmentStrategy *id_assignment_strategy (void) const;

      IdUniquenessStrategy *id_uniqueness_strategy (void) const;

      LifespanStrategy *lifespan_strategy (void) const;

      ImplicitActivationStrategy *implicit_activation_strategy (void) const;

      ServantRetentionStrategy *servant_retention_strategy (void) const;

    private:
      ThreadStrategy *thread_strategy_;
      RequestProcessingStrategy *request_processing_strategy_;
      IdAssignmentStrategy *id_assignment_strategy_;
      LifespanStrategy *lifespan_strategy_;
      IdUniquenessStrategy *id_uniqueness_strategy_;
      ImplicitActivationStrategy *implicit_activation_strategy_;
      ServantRetentionStrategy *servant_retention_strategy_;

      ThreadStrategyFactory *thread_strategy_factory_;
      ServantRetentionStrategyFactory *servant_retention_strategy_factory_;
      RequestProcessingStrategyFactory *request_processing_strategy_factory_;
      LifespanStrategyFactory *lifespan_strategy_factory_;
      ImplicitActivationStrategyFactory *implicit_activation_strategy_factory_;
      IdUniquenessStrategyFactory *id_uniqueness_strategy_factory_;
      IdAssignmentStrategyFactory *id_assignment_strategy_factory_;
    };

    /**
     * This class quards the cleanup of strategies if something went wrong
     * in the code that called Active_Policy_Strategies::update().
     */
    class Active_Policy_Strategies_Cleanup_Guard
    {
    public:
      Active_Policy_Strategies_Cleanup_Guard (Active_Policy_Strategies *p);
      ~Active_Policy_Strategies_Cleanup_Guard (void);

      Active_Policy_Strategies *_retn (void);

    private:
      Active_Policy_Strategies *ptr_;
    };
  }
}

TAO_END_VERSIONED_NAMESPACE_DECL

#if defined (__ACE_INLINE__)
# include "tao/PortableServer/Active_Policy_Strategies.inl"
#endif /* __ACE_INLINE__ */

#include /**/ "ace/post.h"

#endif /* TAO_PORTABLESERVER_ACTIVE_POLICY_STRATEGIES_H */