本文整理汇总了C++中TAO_ServerRequest::collocated方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_ServerRequest::collocated方法的具体用法?C++ TAO_ServerRequest::collocated怎么用?C++ TAO_ServerRequest::collocated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAO_ServerRequest
的用法示例。
在下文中一共展示了TAO_ServerRequest::collocated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
int
TAO_Object_Adapter::dispatch_servant (const TAO::ObjectKey &key,
TAO_ServerRequest &req,
CORBA::Object_out forward_to)
{
ACE_FUNCTION_TIMEPROBE (TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_START);
// This object is magical, i.e., it has a non-trivial constructor
// and destructor.
TAO::Portable_Server::Servant_Upcall servant_upcall (&this->orb_core_);
// Set up state in the POA et al (including the POA Current), so
// that we know that this servant is currently in an upcall.
const char *operation = req.operation ();
int result = servant_upcall.prepare_for_upcall (key, operation, forward_to);
if (result != TAO_Adapter::DS_OK)
return result;
// Preprocess request.
if (req.collocated ())
{
servant_upcall.pre_invoke_collocated_request ();
}
else
{
servant_upcall.pre_invoke_remote_request (req);
}
// Servant dispatch.
{
ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_DISPATCH_START);
do_dispatch (req, servant_upcall);
}
#if TAO_HAS_INTERCEPTORS == 1
// ServerInterceptor might have raised ForwardRequest. In case of
// remote calls invocations the LocationForwardReply would have been
// sent in earlier stage, but in colocal scenario no message is sent
// and the LocationForward object must be passed over here to
// calling operation's mem-space.
if (req.collocated() && req.pi_reply_status () == PortableInterceptor::LOCATION_FORWARD)
{
forward_to = req.forward_location ();
result = TAO_Adapter::DS_FORWARD;
}
#endif
return result;
}
示例2: if
void
TAO_DynamicImplementation::_dispatch (
TAO_ServerRequest &request,
TAO::Portable_Server::Servant_Upcall * /* context */)
{
// No need to do any of this if the client isn't waiting.
if (request.response_expected ())
{
if (request.is_forwarded ())
{
request.init_reply ();
request.tao_send_reply ();
// No need to invoke in this case.
return;
}
else if (request.sync_with_server ())
{
// The last line before the call to this function
// was an ACE_CHECK_RETURN, so if we're here, we
// know there is no exception so far, and that's all
// a SYNC_WITH_SERVER client request cares about.
request.send_no_exception_reply ();
}
}
// Create DSI request object.
CORBA::ServerRequest *dsi_request = 0;
ACE_NEW (dsi_request,
CORBA::ServerRequest (request));
try
{
// Delegate to user.
this->invoke (dsi_request);
// Only if the client is waiting.
if (request.response_expected () && !request.sync_with_server ())
{
dsi_request->dsi_marshal ();
}
}
catch (::CORBA::Exception& ex)
{
// Only if the client is waiting.
if (request.response_expected () && !request.sync_with_server ())
{
if (request.collocated ()
&& request.operation_details ()->cac () != 0)
{
// If we have a cac it will handle the exception and no
// need to do any further processing
request.operation_details ()->cac ()->handle_corba_exception (
request, &ex);
return;
}
else
request.tao_send_reply_exception (ex);
}
}
::CORBA::release (dsi_request);
}