summaryrefslogtreecommitdiff
path: root/TAO/tao/CSD_Framework/CSD_Strategy_Proxy.inl
blob: 8977b973f4c6dc4620d9cad12e1f093efd8989ed (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
// -*- C++ -*-
//
// $Id$

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

ACE_INLINE
TAO::CSD::Strategy_Proxy::Strategy_Proxy()
  : strategy_impl_(0)
{
}

ACE_INLINE
TAO::CSD::Strategy_Proxy::~Strategy_Proxy()
{
  strategy_impl_ = 0; // don't delete it! The var will do it for us.
}

ACE_INLINE
void
TAO::CSD::Strategy_Proxy::dispatch_request
                                (TAO_ServerRequest& server_request,
                                 TAO::Portable_Server::Servant_Upcall& upcall)
{

  if (this->strategy_impl_ == 0)
    {
      // This is the "default" strategy implementation.
      upcall.servant()->_dispatch(server_request, (void*)&upcall);
    }
  else
    {
      // Delegate to the custom strategy object.
      this->strategy_impl_->dispatch_request(server_request, upcall);
    }
}

ACE_INLINE
bool
TAO::CSD::Strategy_Proxy::poa_activated_event(TAO_ORB_Core& orb_core)
{
  // Delegate to the custom strategy object (or return true if this proxy
  // is not holding a custom strategy).
  return (this->strategy_impl_ == 0) ? true
    : this->strategy_impl_->poa_activated_event(orb_core);
}


ACE_INLINE
void
TAO::CSD::Strategy_Proxy::poa_deactivated_event()
{
  // We only need to do something if this proxy holds a custom strategy.
  if (this->strategy_impl_)
    {
      // Delegate to the custom strategy object.
      this->strategy_impl_->poa_deactivated_event();
    }
}

ACE_INLINE
void
TAO::CSD::Strategy_Proxy::servant_activated_event
                                  (PortableServer::Servant servant,
                                   const PortableServer::ObjectId& oid)
{
  // We only need to do something if this proxy holds a custom strategy.
  if (this->strategy_impl_)
    {
      // Delegate to the custom strategy object.
      this->strategy_impl_->servant_activated_event(servant, oid);
    }
}

ACE_INLINE
void
TAO::CSD::Strategy_Proxy::servant_deactivated_event
                                  (PortableServer::Servant servant,
                                   const PortableServer::ObjectId& oid)
{
  // We only need to do something if this proxy holds a custom strategy.
  if (this->strategy_impl_)
    {
      // Delegate to the custom strategy object.
      this->strategy_impl_->servant_deactivated_event(servant, oid);
    }
}

TAO_END_VERSIONED_NAMESPACE_DECL