Name
Query and Activation -- Querying for components and Activating them
Synopsis
#include <liboaf/liboaf.h>
typedef OAF_ImplementationID;
typedef OAF_ActivationID;
struct OAF_ServerInfo;
typedef OAF_ActivationFlags;
OAF_ServerInfoList* oaf_query (const char *requirements,
char *const *selection_order,
CORBA_Environment *ev);
CORBA_Object oaf_activate (const char *requirements,
char *const *selection_order,
OAF_ActivationFlags flags,
OAF_ActivationID *ret_aid,
CORBA_Environment *ev);
CORBA_Object oaf_activate_from_id (const OAF_ActivationID aid,
OAF_ActivationFlags flags,
OAF_ActivationID *ret_aid,
CORBA_Environment *ev);
typedef OAFActivationCallback;
void oaf_activate_async (const char *requirements,
char *const *selection_order,
OAF_ActivationFlags flags,
OAFActivationCallback callback,
gpointer user_data,
CORBA_Environment *ev);
void oaf_activate_from_id_async (const OAF_ActivationID aid,
OAF_ActivationFlags flags,
OAFActivationCallback callback,
gpointer user_data,
CORBA_Environment *ev); |
Description
This section describes how you can query for components
and activate them.
Two set of functions are described: synchronous and
asynchronous ones. The asynchronous version of the functions
allow you to avoid blocking your application while the CORBA
servers are started.
Details
OAF_ImplementationID
typedef CORBA_char *OAF_ImplementationID; |
OAF_ActivationID
typedef CORBA_char *OAF_ActivationID; |
struct OAF_ServerInfo
typedef struct
{
OAF_ImplementationID iid;
CORBA_char *server_type;
CORBA_char *location_info;
CORBA_char *username;
CORBA_char *hostname;
CORBA_char *domain;
CORBA_sequence_OAF_Property props;
}
OAF_ServerInfo; |
OAF_ActivationFlags
typedef CORBA_long OAF_ActivationFlags;
#define OAF_FLAG_NO_LOCAL 1 /* no shared libraries */
#define OAF_FLAG_PRIVATE 2 /* start a new server and don't register it */
#define OAF_FLAG_EXISTING_ONLY 4 /* don't start the server if not started */ |
oaf_query ()
OAF_ServerInfoList* oaf_query (const char *requirements,
char *const *selection_order,
CORBA_Environment *ev); |
Executes the requirements query on the OAF daemon.
The result is sorted according to selection_order.
selection_order can safely be NULL as well as ev.
The returned list has to be freed with CORBA_free.
oaf_activate ()
Activates a given object. ret_aid can be safely NULLed as well
as ev and selection_order. flags can be set to zero if you do
not what to use.
oaf_activate_from_id ()
Activates the server corresponding to aid. ret_aid can be safely
NULLed as well as ev. flags can be zero if you do not know what
to do.
OAFActivationCallback
typedef void (*OAFActivationCallback) (CORBA_Object activated_object,
const char *error_reason,
gpointer user_data);
|
This is the signature of the function which you must pass
as a callback to the asynchrounous activation functions.
oaf_activate_async ()
This function will asynchronously try to activate a component
given the requirements query string. When the component is
activated or when the activation fails, it will call callback
with the given user_data data as parameter.
callback will be called with a CORBA_OBJECT_NIL object if the
activation fails. If the activation fails, the callback will be
given a human-readable string containing a description of the
error. In case of sucess, the error string value is undefined.
selection_order can be safely NULLed as well as ev and
user_data. flags can be set to 0 if you do not know what to
use.
oaf_activate_from_id_async ()
This function will asynchronously try to activate a component
with the given aid. When the component is
activated or when the activation fails, it will call callback
with the given user_data data as parameter.
callback will be called with a CORBA_OBJECT_NIL object if the
activation fails. If the activation fails, the callback will be
given a human-readable string containing a description of the
error. In case of sucess, the error string value is undefined.
flags can be 0 if you do not know what to set it to and
ev can be safely set to NULL.