5 #ifndef CMR_SERVICE_INCLUDED
6 #define CMR_SERVICE_INCLUDED
20 typedef AutoRef<Service> PService;
23 typedef ServiceFactory* PServiceFactory;
24 class InterfaceFactory;
25 typedef InterfaceFactory* PInterfaceFactory;
50 Impl*
get()
const {
return impl_; }
54 long publish(
const PService& service);
58 long unpublish(
const PService& service);
62 bool add_listener(
const AChar* spec);
66 bool add_listener(
const PListener& listener);
71 bool remove_listener(
const AChar* spec);
76 bool remove_listener(
const PListener& listener);
83 ListAString& get_addresses(ListAString& addresses)
const;
89 PService getMyService(
const char* className,
const char* name);
96 static long get_managers_of(
const PService& service, List<PServiceManager>& managers);
101 static PService getService(
const char* className,
const char* name);
140 CallMethod(
const AChar* interface_name,
const AChar* method_name);
161 static CallMethod*
get(
const AChar* interface_name,
const AChar* method_name);
191 const AString& get_name()
const;
195 void set_name(
const AChar* name);
199 const AString& get_class_name()
const;
203 virtual long connect(
const AChar* user_name,
const AChar* password);
209 AString get_session_id()
const;
213 void set_session_id(
const AChar* session_id);
219 Tuple* get_session_context_ptr(
bool createIfNeeded =
false);
225 virtual bool get_session_context(
Tuple& t);
229 virtual void set_session_context(
const Tuple& sessionContext);
235 virtual bool get_self_session_context(
Tuple& t)
const;
236 virtual void set_self_session_context();
263 virtual long call(
const Tuple& inArgs,
Tuple& outArgs);
267 virtual long call(
const AChar* interface_name,
const Tuple& inArgs,
Tuple& outArgs);
271 virtual long call(
const AChar* interface_name,
const Tuple& inArgs,
Tuple& outArgs,
const Tuple* param);
276 long call(
Tuple& sessionContext,
const AChar* interface_name,
const Tuple& inArgs,
Tuple& outArgs);
285 long get_interface(
const AChar* name,
PInterface& inter);
316 Service(
const AChar* class_name);
322 Service(
const AChar* class_name,
const AChar* name,
const AChar* address);
332 PInterface find_interface(
const AChar* name);
341 ProxyService(
const AChar* class_name,
const AChar* name,
const AChar* args);
345 virtual long call(
const Tuple& inArgs,
Tuple& outArgs);
346 virtual long call(
const AChar* interface_name,
const Tuple& inArgs,
Tuple& outArgs);
347 virtual long call(
const AChar* interface_name,
const Tuple& inArgs,
Tuple& outArgs,
const Tuple* param);
357 bool check_connection();
359 typedef AutoRef<ProxyService> PProxyService;
378 const AString& get_class_name()
const {
return class_name_; }
385 virtual PService create(
const AChar* class_name,
const AChar* name,
const AChar* args) = 0;
415 service->set_name(name);
ServiceFactory(const AChar *class_name, bool noregister=false)
Definition: Service.h:133
A commore::Service is an object that mimics an object in an object oriented system : it has a class n...
Definition: Service.h:122
Definition: Interface.h:31
bool is_proxy() const
Definition: Service.h:343
Definition: Service.h:405
virtual bool is_oneway()
Definition: Service.h:147
Definition: AutoRefBase.h:18
Impl * get_impl() const
Definition: Service.h:49
Definition: Service.h:338
PService create(const AChar *class_name, const AChar *name, const AChar *args)
Definition: Service.h:412
Definition: Service.h:365
PService get_service()
Definition: Service.h:187