Horus Doc || Corba Reference || Corba   Client Server   Stubs C++   Stubs Java   Servant Generator  

HxDataObjectInterceptor Class Reference

This interceptor will take care of calling "objectAccessed" and "objectUsed" on corresponding HxDataObjectManager each time an object receives a request. More...

#include <HxDataObjectInterceptor.h>

List of all members.

Public Methods

 HxDataObjectInterceptor (const char *poaName)
 Construct an interceptor that will only watch request on the given POA. More...

virtual ~HxDataObjectInterceptor ()
virtual char * name ()
virtual void destroy ()
virtual void receive_request_service_contexts (PortableInterceptor::ServerRequestInfo_ptr)
virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr)
virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr)
virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr)
virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr)


Detailed Description

This interceptor will take care of calling "objectAccessed" and "objectUsed" on corresponding HxDataObjectManager each time an object receives a request.


Constructor & Destructor Documentation

HxDataObjectInterceptor::HxDataObjectInterceptor const char *    poaName
 

Construct an interceptor that will only watch request on the given POA.

00018     : _poaName(poaName), _lastReqId(0), _lastMgr(NULL)
00019 {
00020 }

HxDataObjectInterceptor::~HxDataObjectInterceptor   [virtual]
 

00023 {
00024 }


Member Function Documentation

char * HxDataObjectInterceptor::name   [virtual]
 

00028 {
00029     return CORBA::string_dup("HxDataObjectInterceptor");
00030 }

void HxDataObjectInterceptor::destroy   [virtual]
 

00034 {
00035 }

void HxDataObjectInterceptor::receive_request_service_contexts PortableInterceptor::ServerRequestInfo_ptr    info [virtual]
 

00040 {
00041 }

void HxDataObjectInterceptor::receive_request PortableInterceptor::ServerRequestInfo_ptr    info [virtual]
 

00046 {
00047     try
00048     {
00049         _lastReqId = info->request_id();
00050         _lastMgr = NULL;
00051 
00052         PortableServer::POA_var poa = HxServer::instance()->getCurrentPOA();
00053         if(strcmp(poa->the_name(), _poaName) == 0) {
00054             CORBA::RepositoryId rep_id = info->target_most_derived_interface();
00055             _lastMgr = HxDataObjectManager::get(rep_id);
00056             _lastOID = HxServer::instance()->getCurrentObjectId();
00057 
00058             _lastMgr->objectAccessed(_lastOID);
00059         }
00060     }
00061     catch(const CORBA::BAD_INV_ORDER&)
00062     {
00063         // Operation not supported in this context
00064         std::cout << "receive_request BAD_INV_ORDER" << std::endl;
00065     }
00066 }

void HxDataObjectInterceptor::send_reply PortableInterceptor::ServerRequestInfo_ptr    info [virtual]
 

00071 {
00072     try
00073     {
00074         //CORBA::OctetSeq_var obj_id = info->object_id();
00075         if((info->request_id() == _lastReqId) && _lastMgr)
00076             _lastMgr->objectUsed(_lastOID);
00077     }
00078     catch(const CORBA::BAD_INV_ORDER&)
00079     {
00080         // Operation not supported in this context
00081         std::cout << "send_reply BAD_INV_ORDER" << std::endl;
00082     }
00083 }

void HxDataObjectInterceptor::send_exception PortableInterceptor::ServerRequestInfo_ptr    info [virtual]
 

00088 {
00089     try
00090     {
00091         if((info->request_id() == _lastReqId) && _lastMgr)
00092             _lastMgr->objectUsed(_lastOID);
00093     }
00094     catch(const CORBA::BAD_INV_ORDER&)
00095     {
00096         // Operation not supported in this context
00097         std::cout << "send_exception BAD_INV_ORDER" << std::endl;
00098     }
00099 }

void HxDataObjectInterceptor::send_other PortableInterceptor::ServerRequestInfo_ptr    info [virtual]
 

00104 {
00105     try
00106     {
00107         if((info->request_id() == _lastReqId) && _lastMgr)
00108             _lastMgr->objectUsed(_lastOID);
00109     }
00110     catch(const CORBA::BAD_INV_ORDER&)
00111     {
00112         // Operation not supported in this context
00113         std::cout << "send_other BAD_INV_ORDER" << std::endl;
00114     }
00115 }


The documentation for this class was generated from the following files:
Generated on Mon Jan 27 15:20:54 2003 for CorbaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001