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 #include <it_wsdl/wsdl_port.h>
00012
00013
00014 namespace IT_Bus
00015 {
00019 class IT_BUS_API EndpointReference : public ObjectBase
00020 {
00021 public:
00022
00027 String
00028 get_id() const
00029 {
00030 return m_id;
00031 }
00032
00036 String
00037 get_wsdl_location() const
00038 {
00039 if (m_wsdl_location.empty())
00040 {
00041 resolve();
00042 }
00043 return m_wsdl_location;
00044 }
00045
00049 const IT_WSDL::WSDLPort*
00050 get_wsdl_port() const
00051 {
00052 if (m_wsdl_port == 0)
00053 {
00054 resolve();
00055 }
00056 return m_wsdl_port;
00057 }
00058
00064 String
00065 get_resolve_error() const
00066 {
00067 return m_resolve_error;
00068 }
00069
00070 private:
00071
00075 EndpointReference(
00076 const EndpointReference&
00077 );
00078
00079 EndpointReference&
00080 operator=(
00081 const EndpointReference&
00082 );
00083
00084 protected:
00085
00089 EndpointReference(String id) :
00090 m_id(id),
00091 m_wsdl_port(0)
00092 {
00093 }
00094
00095 virtual void
00096 resolve() const = 0;
00097
00098 IT_Bus::String m_id;
00099 mutable IT_Bus::String m_resolve_error;
00100 mutable IT_Bus::String m_wsdl_location;
00101 mutable const IT_WSDL::WSDLPort* m_wsdl_port;
00102 };
00103
00104 typedef Registry<String, EndpointReference> EndpointReferenceRegistry;
00105 }
00106
00107 #endif