Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / MProfile_Forwarding / Servant_Locator.h
blob5ebe6c3eaffd0d3c12c36b6d11c82d6c289ba55a
2 //=============================================================================
3 /**
4 * @file Servant_Locator.h
6 * Defines a MyFooServantLocator class , used with a POA having
7 * a NON_RETAIN policy
9 * @author Irfan Pyarali
11 //=============================================================================
14 #ifndef _SERVANT_LOCATOR_H_
15 #define _SERVANT_LOCATOR_H_
17 #include "tao/PortableServer/PortableServer.h"
18 #include "tao/PortableServer/ServantLocatorC.h"
19 #include "tao/ORB.h"
21 /**
22 * @class Servant_Locator
24 * @brief This class is used by a POA with USE_SERVANT_MANAGER and
25 * NON_RETAIN policy.
27 class Servant_Locator : public PortableServer::ServantLocator
29 public:
30 Servant_Locator (CORBA::ORB_ptr orb_ptr);
32 // constructor
34 ~Servant_Locator ();
36 /// This method is invoked by a POA whenever it receives a request
37 /// for MyFoo object that is not currently active.
38 virtual PortableServer::Servant preinvoke (const PortableServer::ObjectId &oid,
39 PortableServer::POA_ptr adapter,
40 const char *operation,
41 PortableServer::ServantLocator::Cookie &the_cookie);
43 /// This method is invoked whenever a MyFooServant completes a
44 /// request.
45 virtual void postinvoke (const PortableServer::ObjectId &oid,
46 PortableServer::POA_ptr adapter,
47 const char *operation,
48 PortableServer::ServantLocator::Cookie the_cookie,
49 PortableServer::Servant the_servant);
51 /// To be removed..
52 void set (CORBA::Object_var obj);
54 private:
55 CORBA::ORB_var orb_var_;
57 /// To be removed
58 CORBA::Object_var objref_;
61 #endif /* _SERVANT_LOCATOR_H */