00001 #ifndef _IT_BUS_ENDPOINT_REFERENCE_H_
00002 #define _IT_BUS_ENDPOINT_REFERENCE_H_
00003
00004
00005
00006
00007 #include <it_bus/api_defines.h>
00008 #include <it_bus/types.h>
00009 #include <it_bus/var.h>
00010 #include <it_bus_pdk/registry.h>
00011 #ifndef IT_MINIMISE_INCLUDES
00012 #include <it_wsdl/wsdl_port.h>
00013 #endif
00014
00015 namespace IT_WSDL
00016 {
00017 class WSDLPort;
00018 }
00019
00020 namespace IT_Bus
00021 {
00025 class IT_BUS_API EndpointReference : public ObjectBase
00026 {
00027 public:
00028
00033 String
00034 get_id() const
00035 {
00036 return m_id;
00037 }
00038
00042 String
00043 get_wsdl_location() const
00044 {
00045 if (m_wsdl_location.empty())
00046 {
00047 resolve();
00048 }
00049 return m_wsdl_location;
00050 }
00051
00055 const IT_WSDL::WSDLPort*
00056 get_wsdl_port() const
00057 {
00058 if (m_wsdl_port == 0)
00059 {
00060 resolve();
00061 }
00062 return m_wsdl_port;
00063 }
00064
00070 String
00071 get_resolve_error() const
00072 {
00073 return m_resolve_error;
00074 }
00075
00076 private:
00077
00081 EndpointReference(
00082 const EndpointReference&
00083 );
00084
00085 EndpointReference&
00086 operator=(
00087 const EndpointReference&
00088 );
00089
00090 protected:
00091
00095 EndpointReference(String id) :
00096 m_id(id),
00097 m_wsdl_port(0)
00098 {
00099 }
00100
00101 virtual void
00102 resolve() const = 0;
00103
00104 IT_Bus::String m_id;
00105 mutable IT_Bus::String m_resolve_error;
00106 mutable IT_Bus::String m_wsdl_location;
00107 mutable const IT_WSDL::WSDLPort* m_wsdl_port;
00108 };
00109
00110 typedef Registry<String, EndpointReference> EndpointReferenceRegistry;
00111 }
00112
00113 #endif