00001 /*---------------------------------------------------------------------------- 00002 Name: DefaultCallback.h 00003 Project: xmlBlaster.org 00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file 00005 Comment: Default implementation of the POA_serverIdl::BlasterCallback. 00006 -----------------------------------------------------------------------------*/ 00007 00008 #ifndef _CLIENT_PROTOCOL_CORBA_DEFAULTCALLBACK_H 00009 #define _CLIENT_PROTOCOL_CORBA_DEFAULTCALLBACK_H 00010 00011 #include <string> 00012 #include <util/lexical_cast.h> 00013 #include <client/I_Callback.h> 00014 #include <client/key/UpdateKey.h> 00015 #include <client/qos/UpdateQos.h> 00016 #include <util/key/MsgKeyFactory.h> 00017 #include <util/qos/MsgQosFactory.h> 00018 #define SERVER_HEADER 1 // does #include <generated/xmlBlasterS.h> with CompatibleCorba.h, OMNIORB: use -Wbh=.h to force this extension 00019 #include <client/protocol/corba/CompatibleCorba.h> 00020 #include COSNAMING 00021 00022 namespace org { 00023 namespace xmlBlaster { 00024 namespace client { 00025 namespace protocol { 00026 namespace corba { 00027 00034 class Dll_Export DefaultCallback : public virtual POA_clientIdl::BlasterCallback { 00035 00036 protected: 00037 org::xmlBlaster::util::Global& global_; 00038 org::xmlBlaster::util::I_Log& log_; 00039 org::xmlBlaster::util::key::MsgKeyFactory msgKeyFactory_; 00040 org::xmlBlaster::util::qos::MsgQosFactory msgQosFactory_; 00041 00042 private: 00043 std::string me() { 00044 return "DefaultCallback-" + loginName_; 00045 } 00046 00047 org::xmlBlaster::client::I_Callback *boss_; 00048 std::string loginName_; 00049 // BlasterCache cache_; 00050 00051 00052 void copy(const DefaultCallback &el) 00053 { 00054 boss_ = el.boss_; 00055 loginName_ = el.loginName_; 00056 } 00057 00058 00062 public: 00063 DefaultCallback(org::xmlBlaster::util::Global& global, const std::string &name="", org::xmlBlaster::client::I_Callback *boss=0, 00064 /*BlasterCache*/ void* /*cache*/=0); 00065 00066 DefaultCallback(const DefaultCallback &el) 00067 : global_(el.global_), log_(el.log_), msgKeyFactory_(el.global_), msgQosFactory_(el.global_) 00068 { 00069 copy(el); 00070 } 00071 00072 DefaultCallback& operator =(const DefaultCallback &el) { 00073 copy(el); 00074 return *this; 00075 } 00076 00077 ~DefaultCallback() { 00078 //log_.trace(me(), "DEBUG ONLY: entering ~DefaultCallback"); 00079 // delete boss_; MUST BE DELETED OUTSIDE 00080 // BECAUSE IT IS NOT OWNED BY THIS OBJECT 00081 } 00082 00083 00100 serverIdl::XmlTypeArr* update(const char* sessionId, 00101 const serverIdl::MessageUnitArr& msgUnitArr) 00102 UPDATE_THROW_SPECIFIER; 00103 00108 void updateOneway(const char* sessionId, const serverIdl::MessageUnitArr& msgUnitArr) PING_THROW_SPECIFIER; 00109 00114 char *ping(const char *qos) PING_THROW_SPECIFIER; 00115 00116 }; // class DefaultCallback 00117 }}}}} // namespace 00118 00119 00120 #endif