00001 #ifndef _IT_BUS_BUS_H_
00002 #define _IT_BUS_BUS_H_
00003
00004
00005
00006
00007 #include <it_bus/bus_type_alias.h>
00008 #include <it_wsdl/wsdl_type_alias.h>
00009 #include <it_bus/api_defines.h>
00010 #include <it_bus/types.h>
00011 #include <it_bus/service.h>
00012 #include <it_bus/client_service.h>
00013 #include <it_bus/wsaddressing_xsdTypes.h>
00014
00015 #ifndef IT_MINIMISE_INCLUDES
00016 #include <it_wsdl/wsdl_definitions.h>
00017 #include <it_bus/qname.h>
00018 #endif
00019
00020 namespace CORBA
00021 {
00022 class ORB;
00023 }
00024
00025 namespace IT_WSDL
00026 {
00027 class WSDLDefinitions;
00028 class WSDLService;
00029 class WSDLFactory;
00030 }
00031
00032 namespace IT_Bus
00033 {
00034 class ContextRegistry;
00035 class PDKBus;
00036 class Reference;
00037 class TransactionSystem;
00038
00053 class IT_BUS_API Bus : public RefCountedBase
00054 {
00055 protected:
00056
00073 Bus();
00074
00088 virtual ~Bus();
00089
00090 public:
00091
00099 static Bus*
00100 create_reference(
00101 CORBA::ORB* orb = 0
00102 );
00103
00107 static void
00108 release_reference(
00109 Bus* bus
00110 );
00111
00120 static
00121 Bus*
00122 _duplicate(
00123 Bus * bus
00124 );
00125
00135 virtual void
00136 run() = 0;
00137
00144 virtual void
00145 shutdown(
00146 IT_Bool wait_for_completion
00147 ) throw((IT_Bus::Exception)) = 0;
00148
00149
00150
00151
00165 virtual IT_Bus::TransactionSystem&
00166 transactions() throw((IT_Bus::Exception)) = 0;
00167
00168
00169
00170
00176 virtual ContextRegistry*
00177 get_context_registry() = 0;
00178
00179
00180
00192 virtual void
00193 register_servant(
00194 Servant & servant,
00195 IT_WSDL::WSDLService & wsdl_service,
00196 const String & port_name = IT_BUS_ALL_PORTS
00197 ) throw((IT_Bus::Exception)) = 0;
00198
00210 virtual void
00211 register_servant(
00212 Servant & servant,
00213 const String & wsdl_location,
00214 const QName & service_name,
00215 const String & port_name = IT_BUS_ALL_PORTS
00216 ) throw((Exception)) = 0;
00217
00230 virtual Service_ptr
00231 register_transient_servant(
00232 Servant & servant,
00233 IT_WSDL::WSDLService & wsdl_service,
00234 const String & port_name = IT_BUS_ALL_PORTS
00235 ) throw((IT_Bus::Exception)) = 0;
00236
00249 virtual Service_ptr
00250 register_transient_servant(
00251 Servant & servant,
00252 const String & wsdl_location,
00253 const QName & service_name,
00254 const String & port_name = IT_BUS_ALL_PORTS
00255 ) throw((Exception)) = 0;
00256
00268 virtual Service_ptr
00269 add_service(
00270 IT_WSDL::WSDLService & wsdl_service
00271 ) throw((IT_Bus::Exception)) = 0;
00272
00285 virtual Service_ptr
00286 add_service(
00287 const String & wsdl_location,
00288 const QName & service_name
00289 ) throw((Exception)) = 0;
00290
00302 virtual Service_ptr
00303 add_transient_service(
00304 IT_WSDL::WSDLService & wsdl_service
00305 ) throw((IT_Bus::Exception)) = 0;
00306
00319 virtual Service_ptr
00320 add_transient_service(
00321 const String & wsdl_location,
00322 const QName & service_name
00323 ) throw((Exception)) = 0;
00324
00332 virtual Service_ptr
00333 get_service(
00334 const QName & service_name
00335 ) = 0;
00336
00342 virtual void
00343 remove_service(
00344 const QName & service_name
00345 ) = 0;
00346
00355 virtual void
00356 populate_endpoint_reference(
00357 const IT_WSDL::WSDLService & service,
00358 Reference & endpoint_reference
00359 ) = 0;
00360
00367 virtual IT_Bus::Boolean
00368 register_initial_reference(
00369 const Reference & service_reference
00370 ) throw((Exception)) = 0;
00371
00379 virtual IT_Bus::Boolean
00380 unregister_initial_reference(
00381 const QName & service_name
00382 ) throw((Exception)) = 0;
00383
00392 virtual IT_Bus::Boolean
00393 resolve_initial_reference(
00394 const QName & service_name,
00395 Reference & endpoint_reference
00396 ) throw((Exception)) = 0;
00397
00407 virtual void
00408 populate_endpoint_reference(
00409 const IT_WSDL::WSDLService & service,
00410 WS_Addressing::EndpointReferenceType & epr_reference
00411 ) = 0;
00412
00422 virtual IT_Bus::Boolean
00423 resolve_initial_reference(
00424 const QName & service_name,
00425 WS_Addressing::EndpointReferenceType & epr_reference
00426 ) throw((Exception)) = 0;
00427
00434 virtual IT_Bus::Boolean
00435 register_initial_reference(
00436 const WS_Addressing::EndpointReferenceType & service_epr
00437 ) throw((Exception)) = 0;
00438
00450 virtual IT_WSDL::WSDLDefinitions_ptr
00451 get_wsdl_model(
00452 const String & wsdl_location
00453 ) throw((IT_WSDL::WSDLException)) = 0;
00454
00463 virtual IT_WSDL::WSDLService*
00464 get_service_contract(
00465 const QName& service_name
00466 ) throw((Exception)) = 0;
00467
00477 virtual PDKBus*
00478 get_pdk_bus() = 0;
00479
00480 protected:
00481 Bus & operator= (const Bus & rhs);
00482 Bus(const Bus & rhs);
00483 };
00484
00494 Bus_var IT_BUS_API init(
00495 int& argc,
00496 char* argv[],
00497 const char* orb_identifier = ""
00498 );
00499
00500
00510 void IT_BUS_API run();
00511
00518 void
00519 IT_BUS_API shutdown(
00520 IT_Bool wait_for_completion = true
00521 ) throw((IT_Bus::Exception));
00522 }
00523
00524 #endif