00001 #ifndef _IT_BUS_PDK_MESSAGING_OPERATION_H_ 00002 #define _IT_BUS_PDK_MESSAGING_OPERATION_H_ 00003 00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved. 00005 // 00006 00007 #include <it_bus/api_defines.h> 00008 #include <it_bus/logging_defs.h> 00009 #include <it_bus/operation.h> 00010 #include <it_bus/message_reader.h> 00011 #include <it_bus/message_writer.h> 00012 #include <it_bus_pdk/messaging_transport.h> 00013 #include <it_bus_pdk/transport_readable_message.h> 00014 #include <it_bus_pdk/transport_writable_message.h> 00015 #include <it_bus_pdk/messaging_port.h> 00016 #include <it_bus_pdk/pass_thru_operation.h> 00017 00018 namespace IT_Bus 00019 { 00020 class BusContextRegistry; 00021 00022 class IT_BUS_API MessagingClientOperation : public ClientOperation, public ClientOperationPassThrough 00023 { 00024 public: 00025 00026 MessagingClientOperation( 00027 const IT_WSDL::WSDLPort& wsdl_port, 00028 const IT_WSDL::WSDLOperation& wsdl_operation, 00029 MessageReader* message_reader, 00030 MessageWriter* message_writer, 00031 MessagingPort & messaging_port, 00032 BusContextRegistry& context_registry 00033 ); 00034 00035 virtual 00036 ~MessagingClientOperation(); 00037 00038 virtual WritableMessage& 00039 get_input_message(); 00040 00041 virtual ReadableMessage& 00042 get_output_message(); 00043 00044 TransportWritableMessage& 00045 get_transport_input_message(); 00046 00047 TransportReadableMessage& 00048 get_transport_output_message(); 00049 00050 virtual MessageReader* 00051 get_message_reader(); 00052 00053 virtual MessageWriter* 00054 get_message_writer(); 00055 00056 virtual ContextContainer* 00057 request_contexts(); 00058 00059 virtual ContextContainer* 00060 reply_contexts(); 00061 00062 virtual BinaryBuffer& 00063 get_request_buffer(); 00064 00065 virtual BinaryBuffer& 00066 get_reply_buffer(); 00067 00068 void 00069 set_contexts( 00070 ContextContainer* request_contexts, 00071 ContextContainer* reply_contexts 00072 ); 00073 00074 virtual ClientOperationPassThrough* 00075 get_client_pass_through(); 00076 00077 // The following 5 methods are implementing the ClientOperationPassThrough API 00078 Boolean 00079 set_passthru_request( 00080 BinaryBuffer* buffer 00081 ); 00082 00083 Boolean 00084 set_passthru_reply( 00085 BinaryBuffer* buffer 00086 ); 00087 00088 BinaryBuffer* 00089 get_passthru_reply(); 00090 00091 BinaryBuffer* 00092 get_passthru_request(); 00093 00094 Boolean 00095 passthru_enabled(); 00096 00097 protected : 00098 00099 virtual void 00100 do_invoke( 00101 ) IT_THROW_DECL((Exception)); 00102 00103 private: 00104 00105 MessagingClientOperation& 00106 operator =( 00107 const MessagingClientOperation& rhs 00108 ); 00109 00110 MessagingClientOperation( 00111 const MessagingClientOperation& rhs 00112 ); 00113 00114 BinaryBuffer m_request_buffer; 00115 BinaryBuffer m_reply_buffer; 00116 TransportWritableMessage m_input_message; 00117 TransportReadableMessage m_output_message; 00118 MessageWriter* m_message_writer; 00119 MessageReader* m_message_reader; 00120 MessagingPort & m_messaging_port; 00121 BusContextRegistry& m_context_registry; 00122 ContextContainer* m_request_contexts; 00123 ContextContainer* m_reply_contexts; 00124 BinaryBuffer* m_passthru_request_buffer; 00125 BinaryBuffer* m_passthru_reply_buffer; 00126 bool m_passthru_enabled; 00127 IT_DECLARE_BUS_LOGGER_MEM 00128 }; 00129 } 00130 00131 #endif