Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ImR_Forwarder Class Reference

Implementation Repository Forwarder. More...

#include <Forwarder.h>

Inheritance diagram for ImR_Forwarder:

Inheritance graph
[legend]
Collaboration diagram for ImR_Forwarder:

Collaboration graph
[legend]
List of all members.

Public Methods

 ImR_Forwarder (ImR_Locator_i *ir_impl, CORBA::ORB_ptr orb)
 Constructor. More...

virtual PortableServer::Servant preinvoke (const PortableServer::ObjectId &oid, PortableServer::POA_ptr poa, const char *operation, PortableServer::ServantLocator::Cookie &cookie ACE_ENV_ARG_DECL) throw (CORBA::SystemException, PortableServer::ForwardRequest)
 Called before the invocation begins. More...

virtual void postinvoke (const PortableServer::ObjectId &oid, PortableServer::POA_ptr poa, const char *operation, PortableServer::ServantLocator::Cookie cookie, PortableServer::Servant servant ACE_ENV_ARG_DECL) throw (CORBA::SystemException)
 Called after the invocation finishes. More...


Private Attributes

ImR_Locator_iimr_impl_
 Where we find out where to forward to. More...

PortableServer::Current_var poa_current_var_
 POA reference. More...

CORBA::ORB_ptr orb_
 Variable to save the ORB reference passed to the constr. More...


Detailed Description

Implementation Repository Forwarder.

This class provides a ServantLocator implementation that is used to handle arbitrary calls and forward them to the correct place.

Definition at line 31 of file Forwarder.h.


Constructor & Destructor Documentation

ImR_Forwarder::ImR_Forwarder ImR_Locator_i   imr_impl,
CORBA::ORB_ptr    orb
 

Constructor.

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.

Definition at line 26 of file Forwarder.cpp.

References PortableServer::Current::_narrow, ACE_ASSERT, ACE_CATCHANY, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY_CHECK, ACE_TRY_NEW_ENV, and poa_current_var_.

00028   : imr_impl_ (imr_impl),
00029     orb_ (orb)
00030 {
00031   ACE_ASSERT (imr_impl != 0);
00032 
00033   ACE_TRY_NEW_ENV
00034     {
00035       CORBA::Object_var tmp =
00036         orb->resolve_initial_references ("POACurrent" ACE_ENV_ARG_PARAMETER);
00037       ACE_TRY_CHECK;
00038 
00039       this->poa_current_var_ =
00040         PortableServer::Current::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER);
00041       ACE_TRY_CHECK;
00042     }
00043   ACE_CATCHANY
00044     {
00045       // Ignore
00046     }
00047   ACE_ENDTRY;
00048 
00049   ACE_ASSERT (!CORBA::is_nil (this->poa_current_var_.in ()));
00050 }


Member Function Documentation

void ImR_Forwarder::postinvoke const PortableServer::ObjectId   oid,
PortableServer::POA_ptr    poa,
const char *    operation,
PortableServer::ServantLocator::Cookie    cookie,
PortableServer::Servant servant    ACE_ENV_ARG_DECL_NOT_USED
throw (CORBA::SystemException) [virtual]
 

Called after the invocation finishes.

The postinvoke method just deletes the passed in servant.

Definition at line 135 of file Forwarder.cpp.

References ACE_ENV_ARG_DECL_NOT_USED, and PortableServer::ServantLocator::Cookie.

00142 {
00143   delete servant;
00144   delete imr_impl_;
00145 }

virtual PortableServer::Servant ImR_Forwarder::preinvoke const PortableServer::ObjectId   oid,
PortableServer::POA_ptr    poa,
const char *    operation,
PortableServer::ServantLocator::Cookie &cookie    ACE_ENV_ARG_DECL
throw (CORBA::SystemException, PortableServer::ForwardRequest) [virtual]
 

Called before the invocation begins.


Member Data Documentation

ImR_Locator_i* ImR_Forwarder::imr_impl_ [private]
 

Where we find out where to forward to.

Definition at line 58 of file Forwarder.h.

CORBA::ORB_ptr ImR_Forwarder::orb_ [private]
 

Variable to save the ORB reference passed to the constr.

Definition at line 64 of file Forwarder.h.

PortableServer::Current_var ImR_Forwarder::poa_current_var_ [private]
 

POA reference.

Definition at line 61 of file Forwarder.h.

Referenced by ImR_Forwarder.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 20:03:17 2003 for TAO_Implementation_Repository by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002