it_bus_pdk/message_context.h

00001 #ifndef _IT_BUS_PDK_MESSAGE_CONTEXT_H_
00002 #define _IT_BUS_PDK_MESSAGE_CONTEXT_H_
00003 
00004 // @Copyright 2005 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_bus/api_defines.h>
00008 
00009 namespace IT_WSDL
00010 {
00011     class WSDLOperation;
00012     class WSDLPort;
00013 }
00014 
00015 namespace IT_Bus
00016 {
00017     class TransportWritableMessage;
00018     class MessageReader;
00019     class MessageWriter;
00020     class ContextContainer;
00021     class DispatchInfo;
00022     class BinaryBuffer;
00023  
00024     /*
00025      * The following interface represents an outgoing message that's passed
00026      * on to an Endpoint in a call to invoke() or send_message().
00027      * It also holds all the necessary context information required.
00028      */ 
00029     class IT_BUS_API SendMessageContext
00030     {
00031       public:
00032 
00033         virtual void
00034         recycle() = 0;
00035 
00036         /*
00037          * The passthru attribute is used to notify the underlying
00038          * endpoint to *passthru* the message with the assumption
00039          * that the message has already been marshalled to a
00040          * BinaryBuffer and that no further processing is required.
00041          * So, an implementation of Endpoint::send_message() will
00042          * query for the passthru flag via call to is_passthru_enabled().
00043          * If set, it would simply call the underlying Endpoint::send_message().
00044          * An implementation of Endpoint::invoke() will
00045          * query for the passthru flag via call to is_passthru_enabled().
00046          * If set, it would simply call the underlying Endpoint::invoke().
00047          */
00048         virtual bool
00049         is_passthru_enabled() = 0;
00050 
00051         virtual IT_WSDL::WSDLOperation&
00052         get_wsdl_operation() = 0;
00053 
00054         virtual TransportWritableMessage*
00055         get_writable_message() = 0;
00056 
00057         virtual MessageWriter*
00058         get_message_writer() = 0;
00059 
00060         virtual ContextContainer*
00061         get_context_container() = 0;
00062 
00063         virtual void
00064         set_data(
00065             BinaryBuffer*,
00066             bool take_ownership = false
00067         ) = 0;
00068 
00069         virtual BinaryBuffer*
00070         get_data(
00071             bool relinquish_ownership = false
00072         ) = 0;
00073 
00074         virtual DispatchInfo*
00075         get_dispatch_context() = 0;
00076 
00077         virtual bool
00078         is_request() = 0;
00079 
00080         virtual void
00081         set_wsdl_port(
00082             const IT_WSDL::WSDLPort*
00083         ) = 0;
00084 
00085         virtual const IT_WSDL::WSDLPort*
00086         get_wsdl_port() = 0;
00087     };
00088 
00089     /*
00090      * The following interface represents an incoming message that's passed
00091      * on to an EndpointHandler in a call to message_received() or is an output
00092      * parameter in a call to SyncEndpoint::invoke(). It also holds all the
00093      * necessary context information required.
00094      */ 
00095     class IT_BUS_API ReceiveMessageContext
00096     {
00097       public:
00098 
00099         virtual void
00100         recycle() = 0;
00101 
00102         virtual MessageReader*
00103         get_message_reader() = 0;
00104 
00105         virtual ContextContainer*
00106         get_context_container() = 0;
00107 
00108         virtual void
00109         set_data(
00110             BinaryBuffer*,
00111             bool take_ownership = false
00112         ) = 0;
00113 
00114         virtual BinaryBuffer*
00115         get_data(
00116             bool relinquish_ownership = false
00117         ) = 0;
00118 
00119         virtual DispatchInfo*
00120         get_dispatch_context() = 0;
00121 
00122         /*
00123          * On server-side, ReceiveMessageContext is associated with
00124          * an instance of DispatchInfo, so that it's used when the response
00125          * is sent synchronously. But if the response is going to be
00126          * asynchronous (sent on a wsa:ReplyTo endpoint or wsrm:AcksTo endpoint),
00127          * then the lifecycles of ReceiveMessageContext and DispatchInfo are
00128          * going to be different, so the following API is used to decouple
00129          * the DispatchInfo from the ReceiveMessageContext.
00130          */
00131         virtual void
00132         decouple_dispatch_context() = 0;
00133     };
00134 }
00135 
00136 #endif  

Generated on Tue Mar 20 15:27:52 2007 for Artix by  doxygen 1.5.1-p1