00001 #ifndef _IT_BUS_PORT_H_
00002 #define _IT_BUS_PORT_H_
00003
00004
00005
00006
00007 #include <it_bus/api_defines.h>
00008 #include <it_bus/types.h>
00009 #include <it_bus/service_exception.h>
00010 #include <it_bus/named_attributes.h>
00011 #include <it_bus/threading_model.h>
00012 #ifndef IT_MINIMISE_INCLUDES
00013 #include <it_wsdl/wsdl_port.h>
00014 #include <it_bus/port_factory.h>
00015 #endif
00016
00017 namespace IT_WSDL
00018 {
00019 class WSDLPort;
00020 class WSDLExtensionElement;
00021 }
00022 namespace IT_Bus
00023 {
00024 class ClientOperation;
00025 class ClientBinding;
00026 class ServerBinding;
00027 class Servant;
00028 class ServantProvider;
00029 class ServiceBase;
00030 class PortFactory;
00031
00032 class IT_BUS_API MessageAttributes : public NamedAttributes
00033 {
00034 public:
00035 MessageAttributes() {}
00036 };
00037
00038 class IT_BUS_API PortAttributes : public NamedAttributes
00039 {
00040 public:
00041 PortAttributes() {}
00042
00043 virtual void update();
00044 };
00045
00046 class IT_BUS_API NonTransactionalException :
00047 public Exception
00048 {
00049 public:
00050 NonTransactionalException(const String& message);
00051
00052 virtual ~NonTransactionalException();
00053
00057 virtual Exception*
00058 clone() const;
00059
00063 virtual void
00064 rethrow() const;
00065 };
00066
00070 class IT_BUS_API TransactionInterface
00071 {
00072 public:
00073 virtual ~TransactionInterface();
00074
00085 virtual bool
00086 supports_transactions();
00087
00096 virtual void
00097 begin();
00098
00107 virtual void
00108 commit();
00109
00118 virtual void
00119 rollback();
00120 };
00121
00133 class IT_BUS_API Port : public TransactionInterface
00134 {
00135 public:
00136 Port() {}
00137
00138 virtual ClientOperation *
00139 create_operation(
00140 const String & operation_name
00141 ) IT_THROW_DECL((ServiceException)) = 0;
00142
00143 virtual void
00144 activate() = 0;
00145
00146 virtual void
00147 deactivate() = 0;
00148
00149 virtual void
00150 shutdown() = 0;
00151
00152 virtual void
00153 wait() = 0;
00154
00162 virtual const IT_WSDL::WSDLPort&
00163 get_wsdl_port() const = 0;
00164
00165 virtual void
00166 set_threading_model(ThreadingModel threading_model) = 0;
00167
00181 virtual IT_WSDL::WSDLExtensionElement&
00182 get_configuration() = 0;
00183
00187 virtual ClientBinding*
00188 get_client_binding() = 0;
00189
00190 virtual ServerBinding*
00191 get_server_binding() = 0;
00192
00201 virtual void
00202 register_servant(
00203 Servant & servant
00204 )= 0;
00205
00211 virtual Servant*
00212 get_servant() = 0;
00213
00214 virtual void
00215 register_servant_manager(
00216 ServantProvider & servant_manager
00217 )= 0;
00218
00219 virtual ServantProvider *
00220 get_servant_manager() = 0;
00221
00222 virtual const PortFactory *
00223 get_port_factory() const = 0;
00224
00234 virtual ServiceBase *
00235 get_service() = 0;
00236
00247 virtual void
00248 register_default_servant(
00249 Servant & servant
00250 ) = 0;
00251
00265 virtual void
00266 get_reference_with_id(
00267 const String & instance_id,
00268 IT_WSDL::WSDLPort & wsdl_port
00269 ) = 0;
00270
00271 private:
00272
00273 Port &
00274 operator =(
00275 const Port& rhs
00276 );
00277
00278 Port(
00279 const Port& rhs
00280 );
00281 };
00282 }
00283
00284 #endif