00001
00002
00003 #include "tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h"
00004
00005 #if (TAO_HAS_MINIMUM_CORBA == 0)
00006 # include "tao/PortableServer/ForwardRequestC.h"
00007 #endif
00008
00009 #include "tao/Abstract_Servant_Base.h"
00010 #include "tao/ORB_Constants.h"
00011 #include "tao/Object.h"
00012 #include "tao/SystemException.h"
00013
00014 ACE_RCSID (PortableServer,
00015 Direct_Collocation_Upcall_Wrapper,
00016 "$Id: Direct_Collocation_Upcall_Wrapper.cpp 81211 2008-04-02 11:36:47Z vzykov $")
00017
00018 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00019
00020 void
00021 TAO::Direct_Collocation_Upcall_Wrapper::upcall (
00022 CORBA::Object_ptr obj,
00023 CORBA::Object_out forward_obj,
00024 bool & is_forwarded,
00025 TAO::Argument ** args,
00026 int num_args,
00027 const char * op,
00028 size_t op_len,
00029 TAO::Collocation_Strategy strategy)
00030 {
00031 TAO_Abstract_ServantBase * const servant = obj->_servant ();
00032
00033 TAO_Collocated_Skeleton collocated_skel;
00034
00035 if (servant->_find (op, collocated_skel, strategy, op_len) == -1)
00036 {
00037 throw ::CORBA::BAD_OPERATION (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
00038 }
00039
00040 #if (TAO_HAS_MINIMUM_CORBA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00041 try
00042 {
00043 #endif
00044 collocated_skel (servant, args, num_args);
00045 #if (TAO_HAS_MINIMUM_CORBA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00046 }
00047 catch (const ::PortableServer::ForwardRequest& forward_request)
00048 {
00049 forward_obj =
00050 CORBA::Object::_duplicate (forward_request.forward_reference.in ());
00051 is_forwarded = true;
00052 }
00053 #else
00054 ACE_UNUSED_ARG (forward_obj);
00055 ACE_UNUSED_ARG (is_forwarded);
00056 #endif
00057 }
00058
00059 TAO_END_VERSIONED_NAMESPACE_DECL