00001 #ifndef _IT_BUS_SERVICE_FACTORY_H_
00002 #define _IT_BUS_SERVICE_FACTORY_H_
00003
00004
00005
00006
00007 #include <it_bus/api_defines.h>
00008 #include <it_bus/service.h>
00009 #include <it_bus/service_exception.h>
00010 #include <it_bus/types.h>
00011 #include <it_bus/qname.h>
00012 #include <it_bus/bus.h>
00013 #include <it_bus_pdk/service_listener.h>
00014 #include <it_dsa/vector.h>
00015
00016 namespace IT_Bus
00017 {
00018 class IT_BUS_API ServiceFactory
00019 {
00020 public:
00021 typedef IT_Vector<ServiceListener*> ServiceListenerList;
00022
00023 virtual Service*
00024 create_service(
00025 const String& wsdl_url,
00026 const QName& service_name
00027 ) throw((ServiceException)) = 0;
00028
00029 virtual Service*
00030 create_service(
00031 const IT_WSDL::WSDLService& wsdl_service,
00032 const QName& base_service_name = QName::EMPTY_QNAME
00033 ) throw((ServiceException)) = 0;
00034
00035 virtual ClientService*
00036 create_client_service(
00037 const String& wsdl_url,
00038 const QName& service_name
00039 ) throw((ServiceException)) = 0;
00040
00041 virtual ClientService*
00042 create_client_service(
00043 const IT_WSDL::WSDLService& wsdl_service
00044 ) throw((ServiceException)) = 0;
00045
00046 virtual void
00047 destroy_service(
00048 ServerService* service
00049 ) = 0;
00050
00051 virtual void
00052 destroy_client_service(
00053 ClientService* service
00054 ) = 0;
00055
00056 static ServiceFactory&
00057 get_instance(Bus_ptr bus = 0);
00058
00059 virtual void
00060 register_listener(
00061 ServiceListener* listener
00062 ) = 0;
00063
00064 virtual void
00065 unregister_listener(
00066 ServiceListener* listener
00067 ) = 0;
00068
00069 virtual const ServiceListenerList&
00070 get_service_listeners() const = 0;
00071
00072 protected:
00073 ServiceFactory() {}
00074 virtual ~ServiceFactory();
00075
00076 private:
00077
00078 ServiceFactory(const ServiceFactory&);
00079 void operator=(const ServiceFactory&);
00080 };
00081 }
00082
00083 #endif