00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Remote_Invocation.h 00006 * 00007 * $Id: Remote_Invocation.h 80292 2007-12-17 20:38:32Z johnnyw $ 00008 * 00009 * 00010 * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> 00011 */ 00012 //============================================================================= 00013 00014 #ifndef TAO_REMOTE_INVOCATION_H 00015 #define TAO_REMOTE_INVOCATION_H 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "tao/Invocation_Base.h" 00020 #include "tao/Transport.h" 00021 00022 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00023 # pragma once 00024 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00025 00026 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00027 00028 class TAO_Operation_Details; 00029 class TAO_Target_Specification; 00030 class TAO_OutputCDR; 00031 00032 namespace TAO 00033 { 00034 class Profile_Transport_Resolver; 00035 class Argument; 00036 00037 /** 00038 * @class Remote_Invocation 00039 * 00040 * @brief Base class for remote invocations. 00041 * 00042 * This class encapulates some of the common functionalities used by 00043 * synchronous, asynchronous, DII and DSI invocations. 00044 * 00045 */ 00046 class TAO_Export Remote_Invocation : public Invocation_Base 00047 { 00048 public: 00049 /** 00050 * @param otarget The original target on which this invocation 00051 * was started. This is there to be passed up to its parent 00052 * class. 00053 * 00054 * @param resolver The profile and transport holder. 00055 * 00056 * @param detail Pperation details of the invocation on the target 00057 * 00058 * @param response_expected Flag to indicate whether the 00059 * operation encapsulated by @a op returns a response or not. 00060 */ 00061 Remote_Invocation (CORBA::Object_ptr otarget, 00062 Profile_Transport_Resolver &resolver, 00063 TAO_Operation_Details &detail, 00064 bool response_expected); 00065 00066 protected: 00067 00068 /// Initialize the @a spec. 00069 void init_target_spec (TAO_Target_Specification &spec); 00070 00071 /// Write the GIOP header into the stream. 00072 void write_header (TAO_OutputCDR &out_stream); 00073 00074 /// Marshal the arguments into the stream. 00075 void marshal_data (TAO_OutputCDR &cdr); 00076 00077 /// Write the message onto the socket 00078 Invocation_Status send_message (TAO_OutputCDR &cdr, 00079 TAO_Transport::TAO_Message_Semantics message_semantics, 00080 ACE_Time_Value *max_wait_time); 00081 00082 protected: 00083 /// Our resolver 00084 Profile_Transport_Resolver &resolver_; 00085 }; 00086 } 00087 00088 TAO_END_VERSIONED_NAMESPACE_DECL 00089 00090 #include /**/ "ace/post.h" 00091 00092 #endif /*TAO_REMOTE_INVOCATION_H*/