TAO_Implementation_Repository
2.0.8
|
Implementation Repository Forwarder. More...
#include <Forwarder.h>
Public Member Functions | |
ImR_Forwarder (ImR_Locator_i &imr_impl) | |
virtual PortableServer::Servant | preinvoke (const PortableServer::ObjectId &oid, PortableServer::POA_ptr poa, const char *operation, PortableServer::ServantLocator::Cookie &cookie) |
Called before the invocation begins. | |
virtual void | postinvoke (const PortableServer::ObjectId &oid, PortableServer::POA_ptr adapter, const char *operation, PortableServer::ServantLocator::Cookie the_cookie, PortableServer::Servant the_servant) |
void | init (CORBA::ORB_ptr orb) |
Private Attributes | |
ImR_Locator_i & | locator_ |
Where we find out where to forward to. | |
PortableServer::Current_var | poa_current_var_ |
POA reference. | |
CORBA::ORB_ptr | orb_ |
Variable to save the ORB reference passed to the constr. |
Implementation Repository Forwarder.
This class provides a ServantLocator implementation that is used to handle arbitrary calls and forward them to the correct place.
ImR_Forwarder::ImR_Forwarder | ( | ImR_Locator_i & | imr_impl | ) |
This constructor takes in orb and ImR_Locator_i pointers to store for later use. It also grabs a reference to the POACurrent object for use in preinvoke.
void ImR_Forwarder::init | ( | CORBA::ORB_ptr | orb | ) |
void ImR_Forwarder::postinvoke | ( | const PortableServer::ObjectId & | oid, |
PortableServer::POA_ptr | adapter, | ||
const char * | operation, | ||
PortableServer::ServantLocator::Cookie | the_cookie, | ||
PortableServer::Servant | the_servant | ||
) | [virtual] |
PortableServer::Servant ImR_Forwarder::preinvoke | ( | const PortableServer::ObjectId & | oid, |
PortableServer::POA_ptr | poa, | ||
const char * | operation, | ||
PortableServer::ServantLocator::Cookie & | cookie | ||
) | [virtual] |
Called before the invocation begins.
We figure out the intended recipient from the POA name. After activating the server, we throw a forwarding exception to the correct server.
The big complicated thing here is that we have to create the forwarding ior based on what we already have. So we combine the endpoint received from activate_server_i and append the objectid from the request to it.
ImR_Locator_i& ImR_Forwarder::locator_ [private] |
Where we find out where to forward to.
CORBA::ORB_ptr ImR_Forwarder::orb_ [private] |
Variable to save the ORB reference passed to the constr.
POA reference.