summaryrefslogtreecommitdiff
path: root/trunk/TAO/tao/PortableServer/POA_Cached_Policies.h
blob: 5b8caca49d0ff2c394ce184b9c8eb7dd9b5f7fcd (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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// -*- C++ -*-

//=============================================================================
/**
 *  @file POA_Cached_Policies.h
 *
 *  $Id$
 *
 *   POA
 *
 *  @author  Irfan Pyarali
 */
//=============================================================================

#ifndef TAO_POA_CACHED_POLICIES_H
#define TAO_POA_CACHED_POLICIES_H
#include /**/ "ace/pre.h"

#include "tao/PortableServer/portableserver_export.h"

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

#include "tao/PortableServer/ThreadPolicyC.h"
#include "tao/PortableServer/LifespanPolicyC.h"
#include "tao/PortableServer/IdUniquenessPolicyC.h"
#include "tao/PortableServer/IdAssignmentPolicyC.h"
#include "tao/PortableServer/ImplicitActivationPolicyC.h"
#include "tao/PortableServer/ServantRetentionPolicyC.h"
#include "tao/PortableServer/RequestProcessingPolicyC.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

// Forward references.
class TAO_POA_Policy_Set;

namespace TAO
{
  namespace Portable_Server
  {
    class TAO_PortableServer_Export Cached_Policies
    {
    public:

      enum PriorityModel
      {
        CLIENT_PROPAGATED,
        SERVER_DECLARED,
        NOT_SPECIFIED
      };

      enum NetworkPriorityModel
      {
        CLIENT_PROPAGATED_NETWORK_PRIORITY,
        SERVER_DECLARED_NETWORK_PRIORITY,
        NO_NETWORK_PRIORITY
      };

      Cached_Policies ();

      ~Cached_Policies (void);

      /// Update the cached policy values.
      void update (TAO_POA_Policy_Set &policy_set
                  );

      /**
       * @name Accessor methods to cached values.
       */
      //@{
      ::PortableServer::ThreadPolicyValue thread (void) const;
      ::PortableServer::LifespanPolicyValue lifespan (void) const;
      ::PortableServer::IdUniquenessPolicyValue id_uniqueness (void) const;
      ::PortableServer::IdAssignmentPolicyValue id_assignment (void) const;
      ::PortableServer::ImplicitActivationPolicyValue implicit_activation (void) const;
      ::PortableServer::ServantRetentionPolicyValue servant_retention (void) const;
      ::PortableServer::RequestProcessingPolicyValue request_processing (void) const;
      PriorityModel priority_model (void) const;
      CORBA::Short server_priority (void) const;

      /// Returns the network priority model that was set using a policy
      /// by the server application.
      ///
      NetworkPriorityModel network_priority_model (void) const;

      /// Returns the request DiffServ codepoint that was set using a policy
      /// by the server application.
      ///
      CORBA::Long request_diffserv_codepoint (void) const;

      /// Returns the reply DiffServ codepoint that was set using a policy
      /// by the server application.
      ///
      CORBA::Long reply_diffserv_codepoint (void) const;

      /// Caches the network priority model that was set using a policy
      /// by the server application.
      ///
      void network_priority_model (
        NetworkPriorityModel network_priority_model);

      /// Caches the request DiffServ codepoint that was set using a policy
      /// by the server application.
      ///
      void request_diffserv_codepoint (CORBA::Long diffserv_codepoint);

      /// Caches the reply DiffServ codepoint that was set using a policy
      /// by the server application.
      ///
      void reply_diffserv_codepoint (CORBA::Long diffserv_codepoint);

      void priority_model (PriorityModel priority_model);
      void server_priority (CORBA::Short priority);
      void implicit_activation (::PortableServer::ImplicitActivationPolicyValue value);
      //@}

    protected:

      /// Helper method to update a particular policy.
      void update_policy (const CORBA::Policy_ptr policy
                         );

      ::PortableServer::ThreadPolicyValue thread_;

      ::PortableServer::LifespanPolicyValue lifespan_;

      ::PortableServer::IdUniquenessPolicyValue id_uniqueness_;

      ::PortableServer::IdAssignmentPolicyValue id_assignment_;

      ::PortableServer::ImplicitActivationPolicyValue implicit_activation_;

      ::PortableServer::ServantRetentionPolicyValue servant_retention_;

      ::PortableServer::RequestProcessingPolicyValue request_processing_;

      PriorityModel priority_model_;

      CORBA::Short server_priority_;

      NetworkPriorityModel network_priority_model_;

      CORBA::Long request_diffserv_codepoint_;

      CORBA::Long reply_diffserv_codepoint_;
    };
  }
}

TAO_END_VERSIONED_NAMESPACE_DECL

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

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