A commore::Service is an object that mimics an object in an object oriented system : it has a class name (its type) and a name (instance name). It provides callable methods (with call and #send), and has an internal state. A commore::Service is designed for being used via an AutoRef (it inherits from RefObject). However, Service doesn't use RefFactory, but ServiceFactory. This is because RefFactory interface is not suitable for the kind of arguments that is required in create methods. An service has a list of Interfaces (interface_list_ defined in Interface). These interfaces are the one that the object implements.
More...
#include <Service.h>
|
ListAString & | get_addresses (ListAString &addresses) const |
|
AString | get_address () const |
|
PService | get_service () |
|
const AString & | get_name () const |
|
void | set_name (const AChar *name) |
|
const AString & | get_class_name () const |
|
virtual long | connect (const AChar *user_name, const AChar *password) |
|
AString | get_session_id () const |
|
void | set_session_id (const AChar *session_id) |
|
Tuple * | get_session_context_ptr (bool createIfNeeded=false) |
|
virtual bool | get_session_context (Tuple &t) |
|
virtual void | set_session_context (const Tuple &sessionContext) |
|
virtual bool | get_self_session_context (Tuple &t) const |
|
virtual void | set_self_session_context () |
|
long | publish (PServiceManager &manager) |
|
long | unpublish (PServiceManager &manager) |
|
long | unpublish () |
|
long | get_managers (List< PServiceManager > &managers) const |
|
virtual long | call (const Tuple &inArgs, Tuple &outArgs) |
|
virtual long | call (const AChar *interface_name, const Tuple &inArgs, Tuple &outArgs) |
|
virtual long | call (const AChar *interface_name, const Tuple &inArgs, Tuple &outArgs, const Tuple *param) |
|
long | call (Tuple &sessionContext, const AChar *interface_name, const Tuple &inArgs, Tuple &outArgs) |
|
long | get_interface (const AChar *name, PInterface &inter) |
|
bool | add_interface (const PInterface &inter) |
|
| Interface (const AChar *name) |
|
virtual | ~Interface () |
|
virtual bool | is_proxy () const |
|
virtual long | call (const Tuple &in_args, Tuple &out_args, const Tuple *param) |
|
const AString & | get_name () const |
|
virtual PService | get_service () const |
|
CriticalSection * | get_cs () const |
|
| RefObject () |
|
virtual | ~RefObject () |
|
virtual void | attach () |
|
virtual void | release () |
|
virtual void | nested_attach () |
|
virtual void | nested_release () |
|
virtual void | interface_release () |
|
virtual void | Run () |
|
virtual CriticalSection * | get_cs () |
|
A commore::Service is an object that mimics an object in an object oriented system : it has a class name (its type) and a name (instance name). It provides callable methods (with call and #send), and has an internal state. A commore::Service is designed for being used via an AutoRef (it inherits from RefObject). However, Service doesn't use RefFactory, but ServiceFactory. This is because RefFactory interface is not suitable for the kind of arguments that is required in create methods. An service has a list of Interfaces (interface_list_ defined in Interface). These interfaces are the one that the object implements.
Service::Service |
( |
const AChar * |
class_name | ) |
|
|
protected |
Service::Service |
( |
const AChar * |
class_name, |
|
|
const AChar * |
name, |
|
|
const AChar * |
address |
|
) |
| |
|
protected |
commore::Service::Service |
( |
const AChar * |
class_name, |
|
|
const Tuple & |
init |
|
) |
| |
|
protected |
bool Service::add_interface |
( |
const PInterface & |
inter | ) |
|
Add interface implementation to service
Create a proxy service or bind to an existig published service This is the bind method used by AutoRef::bind
- Parameters
-
spec | direct service specification or remote service specification |
- Returns
- return a proxy service if spec match <CLASS name>="">:<INSTANCE name>=""><ADDRESS> an existing published service if spec match <CLASS name>="">:<INSTANCE name>="">
long Service::call |
( |
const Tuple & |
inArgs, |
|
|
Tuple & |
outArgs |
|
) |
| |
|
virtual |
long Service::call |
( |
const AChar * |
strInterfaceName, |
|
|
const Tuple & |
inArgs, |
|
|
Tuple & |
outArgs |
|
) |
| |
|
virtual |
Call method with interface name
Default implementation with interface name
Reimplemented in commore::ProxyService.
long Service::call |
( |
const AChar * |
interface_name, |
|
|
const Tuple & |
inArgs, |
|
|
Tuple & |
outArgs, |
|
|
const Tuple * |
param |
|
) |
| |
|
virtual |
long Service::call |
( |
Tuple & |
sessionContext, |
|
|
const AChar * |
interface_name, |
|
|
const Tuple & |
inArgs, |
|
|
Tuple & |
outArgs |
|
) |
| |
Call entry method called by listener callback
- Note
- not a virtual function !
long Service::connect |
( |
const AChar * |
user_name, |
|
|
const AChar * |
password |
|
) |
| |
|
virtual |
Default Authentication Method (to be implemented)
Create a service using a registered factory This is the create method used by AutoRef::create
Create a service using an explicit factory
AString Service::get_address |
( |
| ) |
const |
Recover addresses on which the services of service manager can be contacted
- Returns
- a string address list
- Deprecated:
Get the addresses on which the services can be contacted
const AString & Service::get_class_name |
( |
| ) |
const |
- Returns
- service class name
Get interface Using default InterfaceFactory
- Parameters
-
name | interface name |
inter | reference to retrieved interface |
- Returns
- CMR_OK if succeed
Get associated ServiceManager (if service has been published)
- Returns
- number of ServiceManager where service is published,
const AString & Service::get_name |
( |
| ) |
const |
bool Service::get_self_session_context |
( |
Tuple & |
t | ) |
const |
|
virtual |
Specific for use on the server side, when using direct call inside a call get the session context directly attached to service
Reimplemented from commore::Interface.
PService commore::Service::get_service |
( |
| ) |
|
|
inline |
- Returns
- a service reference
bool Service::get_session_context |
( |
Tuple & |
t | ) |
|
|
virtual |
Get a copy of tuple session context
- Returns
- true if tuple sesion context exist
Reimplemented from commore::Interface.
Tuple * Service::get_session_context_ptr |
( |
bool |
createIfNeeded = false | ) |
|
- Returns
- pointer to tuple session context
- Warning
- pointer not thread safe
AString Service::get_session_id |
( |
| ) |
const |
- Returns
- current session id
Publish service in a service manager
void Service::set_name |
( |
const AChar * |
name | ) |
|
void Service::set_self_session_context |
( |
| ) |
|
|
virtual |
void Service::set_session_context |
( |
const Tuple & |
sessionContext | ) |
|
|
virtual |
void Service::set_session_id |
( |
const AChar * |
session_id | ) |
|
Unpublish from a service manager
long Service::unpublish |
( |
| ) |
|
Unpublish from all service manager
The documentation for this class was generated from the following files: