/* * OrbServerImpl.hh * * Created on: Aug 11, 2010 * Author: lamikr */ #ifndef ORBSERVERIMPL_HH_ #define ORBSERVERIMPL_HH_ #include #include #include "RequestResponseBus.hh" #include "IServerListener.hh" namespace plpbus { class OrbServerImpl { public: OrbServerImpl(); virtual ~OrbServerImpl(); virtual void send_message_and_request_response(plpbus_orb::OrbClient_ptr response_listener_param, const char* msg_req_param); virtual void send_dataitem_message_and_request_response(plpbus_orb::OrbClient_ptr response_listener_param, const ::plpbus_orb::DataItemSequence& req_seq_param); virtual char *send_message_and_wait_response(const char* msg_req_param, ::CORBA::Long& err_flg); virtual CORBA::Long send_dataitem_message_and_wait_response(const ::plpbus_orb::DataItemSequence& req_seq_param, ::plpbus_orb::DataItemSequence_out rsp_seq_param); virtual void add_event_listener(plpbus_orb::OrbClient_ptr client_param, const char *msg, CORBA::UShort period_secs); virtual void shutdown(); virtual int init(); virtual int launch(const char *server_name); virtual int is_shutdown_pending(); virtual void server_thread_closed(); virtual int add_server_listener(IServerListener *listener_param); private: PortableServer::POA_var _poa; CORBA::ORB_var _orb; IServerListener *_listener; int _server_thread_count; int _shutdown_pending; virtual PortableServer::POA_var create_poa(CORBA::ORB_var orb); /** * Gets naming context from the name service. If the naming context does not yet exist, create it. */ CosNaming::NamingContext_var get_service_naming_context(const char *leafcontext_name, const char *leafcontext_kind); /** * Bind service to naming context. * If service with same name has already been binded, replace the existing service with the new one. */ bool bind_naming_context_and_service(CosNaming::NamingContext_var service_context_param, CORBA::Object_ptr service_ref_param, const char *service_name_param, const char *service_kind_param); }; } #endif /* ORBSERVERIMPL_HH_ */