00001 #ifndef _IT_BUS_PDK_ENDPOINT_H_
00002 #define _IT_BUS_PDK_ENDPOINT_H_
00003
00004
00005
00006
00007 #include <it_bus/api_defines.h>
00008
00009 namespace IT_WSDL
00010 {
00011 class WSDLPort;
00012 class WSDLOperation;
00013 class WSDLExtensionElement;
00014 }
00015
00016 namespace WS_Addressing_2004
00017 {
00018 class AttributedURI;
00019 }
00020
00021 namespace IT_Bus
00022 {
00023 class String;
00024 class Port;
00025 class SendMessageContext;
00026 class ReceiveMessageContext;
00027 class AnyType;
00028 class SoftStopEndpoint;
00029 class TransactionalEndpoint;
00030 class TransportReadableMessage;
00031 class TransportWritableMessage;
00032 class MessageReader;
00033 class MessageWriter;
00034 class ContextContainer;
00035 class DispatchInfo;
00036
00037
00038
00039
00040
00041
00042
00043 class IT_BUS_API Endpoint
00044 {
00045 public:
00046
00047 virtual const WS_Addressing_2004::AttributedURI&
00048 get_address() = 0;
00049
00050 virtual const IT_WSDL::WSDLExtensionElement&
00051 get_configuration() = 0;
00052
00053
00054
00055
00056
00057
00058
00059
00060 virtual AnyType*
00061 send_message(
00062 SendMessageContext*
00063 ) = 0;
00064
00065
00066
00067
00068 virtual void
00069 close() = 0;
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 virtual SoftStopEndpoint*
00080 get_underlying_softstop_endpoint() = 0;
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 virtual TransactionalEndpoint*
00091 get_underlying_transactional_endpoint() = 0;
00092
00093 Endpoint() {}
00094 virtual ~Endpoint();
00095 };
00096
00097
00098
00099
00100
00101 class IT_BUS_API EndpointHandler
00102 {
00103 public:
00104
00105
00106
00107
00108
00109 virtual void
00110 endpoint_created(
00111 Endpoint*
00112 ) = 0;
00113
00114
00115
00116
00117
00118
00119
00120 virtual void
00121 message_received(
00122 AnyType*,
00123 ReceiveMessageContext*
00124 ) = 0;
00125
00126
00127
00128
00129
00130 virtual void
00131 remote_endpoint_closed(
00132 const IT_Bus::String& endpoint_id
00133 ) = 0;
00134
00135
00136
00137
00138
00139 virtual void
00140 endpoint_closed() = 0;
00141
00142 protected:
00143
00144 EndpointHandler() {}
00145 virtual ~EndpointHandler();
00146 };
00147
00148
00149
00150
00151
00152 class IT_BUS_API SyncEndpoint
00153 : public Endpoint
00154 {
00155 public:
00156
00157
00158
00159
00160
00161
00162 virtual void
00163 invoke(
00164 SendMessageContext*,
00165 ReceiveMessageContext&
00166 ) = 0;
00167
00168 protected:
00169
00170 SyncEndpoint() {}
00171 virtual ~SyncEndpoint();
00172 };
00173
00174
00175
00176
00177
00178 class IT_BUS_API SoftStopEndpoint
00179 : public Endpoint
00180 {
00181 public:
00182
00183
00184
00185
00186
00187
00188
00189 virtual void
00190 deactivate() = 0;
00191
00192
00193
00194
00195 virtual void
00196 reactivate() = 0;
00197
00198 virtual void
00199 get_reference_with_id(
00200 const IT_Bus::String& instance_id,
00201 IT_WSDL::WSDLPort& wsdl_port
00202 ) = 0;
00203
00204 protected:
00205
00206 SoftStopEndpoint() {}
00207 virtual ~SoftStopEndpoint();
00208 };
00209
00210
00211
00212
00213
00214 class IT_BUS_API TransactionalEndpoint
00215 : public Endpoint
00216 {
00217 public:
00218
00219 virtual bool
00220 supports_transactions() = 0;
00221
00222 virtual void
00223 begin() = 0;
00224
00225 virtual void
00226 commit() = 0;
00227
00228 virtual void
00229 rollback() = 0;
00230
00231 protected:
00232
00233 TransactionalEndpoint() {}
00234 virtual ~TransactionalEndpoint();
00235 };
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245 class IT_BUS_API EndpointManager
00246 {
00247 public:
00248
00249 virtual void
00250 initialize() = 0;
00251
00252 virtual SyncEndpoint*
00253 create_sync_endpoint(
00254 const IT_WSDL::WSDLPort& wsdl_port,
00255 ContextContainer* context_container
00256 ) = 0;
00257
00258 virtual SyncEndpoint*
00259 create_sync_endpoint(
00260 const IT_WSDL::WSDLPort& wsdl_port,
00261 const WS_Addressing_2004::AttributedURI& to_address,
00262 ContextContainer* context_container
00263 ) = 0;
00264
00265 virtual Endpoint*
00266 create_async_endpoint(
00267 const IT_WSDL::WSDLPort& wsdl_port,
00268 EndpointHandler* endpoint_handler,
00269 ContextContainer* context_container
00270 ) = 0;
00271
00272 virtual Endpoint*
00273 create_async_endpoint(
00274 const IT_WSDL::WSDLPort& wsdl_port,
00275 const WS_Addressing_2004::AttributedURI& listento_address,
00276 EndpointHandler* endpoint_handler,
00277 ContextContainer* context_container
00278 ) = 0;
00279
00280 virtual SendMessageContext*
00281 create_send_message_context(
00282 IT_WSDL::WSDLOperation*,
00283 TransportWritableMessage*,
00284 MessageWriter*,
00285 ContextContainer*,
00286 DispatchInfo*,
00287 bool is_request,
00288 bool passthru_enabled
00289 ) = 0;
00290
00291 virtual ReceiveMessageContext*
00292 create_receive_message_context(
00293 MessageReader*,
00294 ContextContainer*,
00295 DispatchInfo*
00296 ) = 0;
00297
00298 virtual void
00299 close() = 0;
00300
00301 virtual bool
00302 transport_acknowledgement_required(
00303 ContextContainer*
00304 ) = 0;
00305
00306 virtual IT_Bus::String
00307 get_replyto_endpoint_correlation_id(
00308 ContextContainer* incoming_container,
00309 ContextContainer* outgoing_container
00310 ) = 0;
00311
00312 protected:
00313
00314 EndpointManager() {}
00315 virtual ~EndpointManager();
00316 };
00317
00318 class IT_BUS_API EndpointManagerFactory
00319 {
00320 public:
00321
00322 virtual const IT_Bus::String&
00323 get_name() = 0;
00324
00325 virtual EndpointManager*
00326 create_endpoint_manager(
00327 IT_Bus::Port&
00328 ) = 0;
00329
00330 protected:
00331
00332 EndpointManagerFactory() {}
00333 virtual ~EndpointManagerFactory();
00334 };
00335 }
00336
00337 #endif