#include <AMH_DSI_Response_Handler.h>
Collaboration diagram for TAO_AMH_DSI_Response_Handler:
With ordinary DSI, the POA calls _dispatch, which in turn calls invoke on the DSI handler. Invoke completely handles the request, and packages the result in the request object so that it can be marshalled and sent back to the caller.
With the AMH variation, the DSI handler's invoke method starts the processing, but delegates the result packaging to a response handler. This way, if the invocation takes a long time, or involves blocking calls, then the result handling can be managed by another thread. This is particularly useful for gateway implementations, where the middle tier should not have to block waiting for replies.
As this is built on the CORBA object model, there are separate classes representing the interface and the implementation.
Definition at line 213 of file AMH_DSI_Response_Handler.h.
|
Definition at line 217 of file AMH_DSI_Response_Handler.h. |
|
Definition at line 218 of file AMH_DSI_Response_Handler.h. |
|
Definition at line 314 of file AMH_DSI_Response_Handler.cpp.
|
|
Definition at line 321 of file AMH_DSI_Response_Handler.cpp.
00322 { 00323 } |
|
Simply returns "this".
Definition at line 455 of file AMH_DSI_Response_Handler.cpp.
00456 { 00457 return this; 00458 } |
|
CORBA Object related methods.
Definition at line 7 of file AMH_DSI_Response_Handler.inl. References TAO_AMH_DSI_Response_Handler_ptr. Referenced by TAO_AMH_DSI_Response_Handler_var::operator=().
00008 { 00009 if (x != 0) 00010 { 00011 x->_add_ref (); 00012 } 00013 00014 return x; 00015 } |
|
Return 0. Should never be used.
Definition at line 476 of file AMH_DSI_Response_Handler.cpp.
00477 {
00478 return 0;
00479 }
|
|
Definition at line 461 of file AMH_DSI_Response_Handler.cpp. References _unchecked_narrow().
00462 { 00463 return TAO_AMH_DSI_Response_Handler::_unchecked_narrow (obj); 00464 } |
|
Definition at line 308 of file AMH_DSI_Response_Handler.cpp. References TAO_AMH_DSI_Response_Handler_ptr. Referenced by TAO_AMH_DSI_Response_Handler_var::_retn(), _unchecked_narrow(), and TAO_AMH_DSI_Response_Handler_var::out().
00309 { 00310 return (TAO_AMH_DSI_Response_Handler_ptr) 0; 00311 } |
|
Returns a CORBA::Object_ptr for the target object.
|
|
Definition at line 467 of file AMH_DSI_Response_Handler.cpp. References _nil(), and CORBA::is_nil(). Referenced by _narrow().
00468 { 00469 if (CORBA::is_nil (obj)) 00470 return TAO_AMH_DSI_Response_Handler::_nil (); 00471 00472 return dynamic_cast < TAO_AMH_DSI_Response_Handler_ptr > (obj); 00473 } |
|
Definition at line 410 of file AMH_DSI_Response_Handler.cpp. References ACE_InputCDR::byte_order(), ACE_InputCDR::start(), TAO_GIOP_SYSTEM_EXCEPTION, and TAO_GIOP_USER_EXCEPTION.
00413 { 00414 // for this to be effective, ACE & TAO must be built with 00415 // ACE_ENABLE_SWAP_ON_WRITE defined in ace/config.h 00416 this->_tao_out.reset_byte_order(encap.byte_order()); 00417 // This reply path handles only user exceptions. 00418 switch (reply_status) 00419 { 00420 //case TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION: 00421 case TAO_AMI_REPLY_USER_EXCEPTION: 00422 this->exception_type_ = TAO_GIOP_USER_EXCEPTION; 00423 break; 00424 case TAO_AMI_REPLY_SYSTEM_EXCEPTION: 00425 this->exception_type_ = TAO_GIOP_SYSTEM_EXCEPTION; 00426 break; 00427 00428 // we don't handle location forward at this moment. 00429 // need to be addressed later. 00430 // 00431 //case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD: 00432 // this->exception_type_ = TAO_GIOP_LOCATION_FORWARD; 00433 // break; 00434 } 00435 try 00436 { 00437 this->_tao_rh_init_reply (); 00438 00439 // We know nothing about this exception, so we marshal it as a block 00440 // of bytes. The outgoing stream's byte order has already been matched 00441 // to the original source of the reply. 00442 this->_tao_out.write_octet_array_mb (encap.start()); 00443 // This will prevent the marshaling of any parameters into this reply. 00444 // this->sent_gateway_exception_ = 1; 00445 this->_tao_rh_send_reply (); 00446 } 00447 catch (const CORBA::Exception &) 00448 { 00449 // TODO: 00450 } 00451 00452 } |
|
Definition at line 366 of file AMH_DSI_Response_Handler.cpp. References ACE_OutputCDR::buffer(), ACE_OutputCDR::byte_order(), ACE_OutputCDR::length(), TAO_GIOP_SYSTEM_EXCEPTION, and TAO_GIOP_USER_EXCEPTION.
00369 { 00370 // for this to be effective, ACE & TAO must be built with 00371 // ACE_ENABLE_SWAP_ON_WRITE defined in ace/config.h 00372 this->_tao_out.reset_byte_order (encap.byte_order ()); 00373 // This reply path handles only user exceptions. 00374 switch (reply_status) 00375 { 00376 case TAO_AMI_REPLY_USER_EXCEPTION: 00377 this->exception_type_ = TAO_GIOP_USER_EXCEPTION; 00378 break; 00379 case TAO_AMI_REPLY_SYSTEM_EXCEPTION: 00380 this->exception_type_ = TAO_GIOP_SYSTEM_EXCEPTION; 00381 break; 00382 00383 // TODO: we don't handle location forward at this moment. 00384 // need to be addressed later. 00385 // 00386 //case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD: 00387 // this->exception_type_ = TAO_GIOP_LOCATION_FORWARD; 00388 // break; 00389 } 00390 try 00391 { 00392 this->_tao_rh_init_reply (); 00393 00394 // We know nothing about this exception, so we marshal it as a block 00395 // of bytes. The outgoing stream's byte order has already been matched 00396 // to the original source of the reply. 00397 this->_tao_out.write_char_array (encap.buffer (), encap.length ()); 00398 // This will prevent the marshaling of any parameters into this reply. 00399 // this->sent_gateway_exception_ = 1; 00400 this->_tao_rh_send_reply (); 00401 } 00402 catch (const CORBA::Exception &) 00403 { 00404 // TODO: 00405 } 00406 00407 } |
|
Definition at line 353 of file AMH_DSI_Response_Handler.cpp. References TAO_AMH_DSI_Exception_Holder::raise_invoke().
00354 { 00355 try 00356 { 00357 h->raise_invoke (); 00358 } 00359 catch (const CORBA::Exception & ex) 00360 { 00361 this->_tao_rh_send_exception (ex); 00362 } 00363 } |
|
Definition at line 326 of file AMH_DSI_Response_Handler.cpp.
00328 { 00329 try 00330 { 00331 this->_tao_rh_init_reply (); 00332 00333 // Send the return value, if any. 00334 if (result != 0 && result->value () != 0) 00335 { 00336 result->value ()->impl ()->marshal_value (this->_tao_out); 00337 } 00338 00339 // Send the "inout" and "out" parameters. 00340 if (args != 0) 00341 { 00342 args->_tao_encode (this->_tao_out, CORBA::ARG_INOUT | CORBA::ARG_OUT); 00343 } 00344 this->_tao_rh_send_reply (); 00345 } 00346 catch (const CORBA::Exception &) 00347 { 00348 // TODO: 00349 } 00350 } |
|
Definition at line 253 of file AMH_DSI_Response_Handler.h. |