Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

it_bus/operation.h

00001 #ifndef _IT_BUS_OPERATION_H_
00002 #define _IT_BUS_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/readable_message.h>
00009 #include <it_bus/writable_message.h>
00010 
00011 #include <it_bus/port.h>
00012 #include <it_wsdl/wsdl_port.h>
00013 #include <it_wsdl/wsdl_operation.h>
00014 
00015 #include <it_bus_pdk/interceptor.h>
00016 #include <it_bus/port.h>
00017 
00018 namespace IT_Bus
00019 {
00020     class Operation;
00021     class MessageAttributesHolder;
00022     class ContextContainer;
00023     class ClientOperationPassThrough;
00024     class ServerOperationPassThrough;
00025 
00026     namespace Logging
00027     {
00028         class ServiceNameRetriever;
00029     }
00030 
00031     typedef QNameHashMap<MessageAttributesHolder *> MessageAttributesMap;
00032 
00033     class IT_BUS_API MessageAttributesHolder
00034     {
00035     public:
00036         MessageAttributesHolder(
00037             Operation&         operation,
00038             const QName&       name,
00039             MessageAttributes* data,
00040             IT_Bool            take_ownership = true
00041         );
00042 
00043         ~MessageAttributesHolder();
00044 
00045         void create_reference();
00046         void release_reference();
00047 
00048         MessageAttributes&
00049         get_data();
00050 
00051         const MessageAttributes&
00052         get_data() const;
00053 
00054     private:
00055         MessageAttributesHolder();
00056 
00057         IT_Bool                 m_take_ownership;
00058         IT_ULong                m_ref_count;
00059         MessageAttributes*      m_data;
00060         const QName&            m_name;
00061         Operation&              m_operation;
00062     };
00063 
00067     class IT_BUS_API Operation
00068     {
00069     friend class MessageAttributesHolder;
00070 
00071     public:
00079         Operation(
00080             Port& port,
00081             const IT_WSDL::WSDLPort& wsdl_port
00082         );
00083         
00087         virtual
00088         ~Operation();
00089 
00099         virtual Port&
00100         get_port();
00101 
00108         virtual const IT_WSDL::WSDLPort&
00109         get_wsdl_port() const;
00110 
00111         Logging::ServiceNameRetriever*
00112         get_snr();
00113 
00114       protected:
00115         Port&                           m_port;
00116         const IT_WSDL::WSDLPort&        m_wsdl_port;        
00117         Operation*                      m_source_operation;
00118         Logging::ServiceNameRetriever* m_snr;
00119     };
00120 
00148     class IT_BUS_API ClientOperation : public Operation
00149     {
00150       friend class PDKClientService; 
00151 
00152       public:
00153 
00157         virtual 
00158         ~ClientOperation();
00159 
00166         virtual const IT_WSDL::WSDLOperation&
00167         get_wsdl_operation() const;
00168 
00174         virtual const String &
00175         get_name() const;
00176 
00183         virtual WritableMessage & 
00184         get_input_message() = 0;
00185         
00192         virtual ReadableMessage & 
00193         get_output_message() = 0;
00194 
00201         virtual ContextContainer*
00202         request_contexts() = 0;
00203 
00210         virtual ContextContainer*
00211         reply_contexts() = 0;
00212 
00217         virtual void
00218         invoke(
00219         ) throw((Exception));  
00220 
00221 
00229         virtual ClientOperationPassThrough*
00230         get_client_pass_through() = 0;
00231 
00232       protected:
00233         ClientOperation(
00234             Port&                         port,
00235             const IT_WSDL::WSDLPort&      wsdl_port,
00236             const IT_WSDL::WSDLOperation& wsdl_operation
00237         );
00238 
00239         virtual void
00240         do_invoke(
00241         ) throw((Exception)) = 0;  
00242 
00243       private:
00244 
00245         const IT_WSDL::WSDLOperation& m_wsdl_operation;
00246                      
00247         ClientOperation & 
00248         operator =(
00249             const ClientOperation& rhs
00250         );
00251         
00252         ClientOperation(
00253             const ClientOperation& rhs
00254         );
00255     };
00256 
00258     typedef unsigned long CorrelationId;
00259 
00276     class IT_BUS_API ServerOperation : public Operation
00277     {
00278       public:
00279         
00280         virtual 
00284         ~ServerOperation();
00285 
00292         virtual const IT_WSDL::WSDLOperation&
00293         get_wsdl_operation() const;
00294 
00300         virtual const String &
00301         get_name() const;
00302 
00309         virtual ReadableMessage & 
00310         get_input_message() = 0;
00311         
00318         virtual WritableMessage & 
00319         get_output_message() = 0;
00320 
00327         virtual ContextContainer*
00328         request_contexts() = 0;
00329 
00336         virtual ContextContainer*
00337         reply_contexts() = 0;
00338 
00343         virtual void
00344         read() = 0;
00345 
00350         virtual void
00351         write() = 0;
00352 
00361         virtual void
00362         exception_occured();
00363 
00369         virtual CorrelationId
00370         get_correlation_id() const = 0;
00371 
00379         virtual ServerOperationPassThrough*
00380         get_server_pass_through() = 0;
00381 
00382       protected:
00383         ServerOperation(
00384             Port&                         port,
00385             const IT_WSDL::WSDLPort&      wsdl_port,
00386             const IT_WSDL::WSDLOperation& wsdl_operation
00387         );
00388 
00389       private:
00390         const IT_WSDL::WSDLOperation& m_wsdl_operation;
00391         
00392         ServerOperation & 
00393         operator = (
00394             const ServerOperation& rhs
00395         );
00396         
00397         ServerOperation(
00398             const ServerOperation& rhs
00399         );
00400     };
00401 }
00402 
00403 #endif  

Generated on Wed Mar 22 12:23:03 2006 for Artix by  doxygen 1.3.9.1