GNOME CORBA Framework | |||
---|---|---|---|
<<< Previous Page | Home | Up |
const char* goad_server_activation_id (void); int goad_server_register (CORBA_Object name_server, CORBA_Object server, const char *name, const char *kind, CORBA_Environment *ev); int goad_server_unregister (CORBA_Object name_server, const char *name, const char *kind, CORBA_Environment *ev); enum GoadServerType; enum GoadActivationFlags; struct GoadServer; struct GoadServerList; GoadServerList* goad_server_list_get (void); void goad_server_list_free (GoadServerList *server_list); CORBA_Object goad_server_activate (GoadServer *sinfo, GoadActivationFlags flags, const char **params); CORBA_Object goad_server_activate_with_repo_id (GoadServerList *server_list, const char *repo_id, GoadActivationFlags flags, const char **params); CORBA_Object goad_server_activate_with_id (GoadServerList *server_list, const char *server_id, GoadActivationFlags flags, const char **params); |
GOAD is the GNOME Object Activation Directory. It keeps track of the CORBA object implementations available on the system, and allows applications to activate these implementations or access currently running ones.
const char* goad_server_activation_id (void); |
When an application that implements a GOAD-registered object is started, it should call this function to check if it was started to create one of those objects.
int goad_server_register (CORBA_Object name_server, CORBA_Object server, const char *name, const char *kind, CORBA_Environment *ev); |
Registers server in the name_server with name.
name_server : | points to a running name_server |
server : | the server object we want to register. |
name : | The GOAD id of the server that is being registered |
kind : | "object" for now. |
ev : | CORBA_Environment to return errors |
Returns : | zero upon success, non-zero if registration failed or another registration for this name already exists. |
int goad_server_unregister (CORBA_Object name_server, const char *name, const char *kind, CORBA_Environment *ev); |
Removes the registration of server in the name_server.
typedef enum { GOAD_SERVER_SHLIB = 1, GOAD_SERVER_EXE = 2, GOAD_SERVER_RELAY = 3, GOAD_SERVER_FACTORY = 4 } GoadServerType; |
GOAD_SERVER_SHLIB - implementation is in a shared library plugin
GOAD_SERVER_EXE - implementation is in a separate program
GOAD_SERVER_RELAY - implementation is accessable via a relay object (not yet implemented)
GOAD_SERVER_FACTORY - implementation is started by talking to a GNOME::GenericFactory object
typedef enum { /* these two are mutually exclusive */ GOAD_ACTIVATE_SHLIB = 1 << 0, /* prefer shlib activation */ GOAD_ACTIVATE_REMOTE = 1 << 1, /* prefer remote activation */ /* these two are mutually exclusive */ GOAD_ACTIVATE_EXISTING_ONLY = 1 << 2, /* Only do lookup in name * service for currently running * version. */ GOAD_ACTIVATE_NEW_ONLY = 1 << 3, /* No lookup in name service. */ GOAD_ACTIVATE_ASYNC = 1 << 4 /* Just make sure that the object is running */ } GoadActivationFlags; |
GOAD_ACTIVATE_SHLIB - indicates activation from a shared library plugin is preferred
GOAD_ACTIVATE_REMOTE - indicates activation from an executable or factory is preferred
GOAD_ACTIVATE_EXISTING_ONLY - Don't create a new object, simply access the currently running implementation if available.
GOAD_ACTIVATE_NEW_ONLY - Don't look for a currently running implementation, just create a new one (mutually exclusive with GOAD_ACTIVATE_EXISTING_ONLY)
GOAD_ACTIVATE_ASYNC - just start the object implementation, but don't worry about getting a reference to it.
typedef struct { GoadServerType type; GoadActivationFlags flags; /* only GOAD_ACTIVATE_NEW_ONLY currently parsed in */ char **repo_id; char *server_id; char *description; /* * Executable/shlib path, relayer IOR, whatever. * This field may disappear at any time. You have been warned ;-) */ char *location_info; } GoadServer; |
'type' - The GoadServerType of the implementation being listed
'flags' - The bitwise OR of all the GoadActivationFlags that are enforced for this GoadServer
'repo_id' - An array of strings giving all the interfaces supported by this implementation
'server_id' - The GOAD ID of this implementation. A GOAD ID is a unique global identifier of a particular object implementation.
'description' - A human-readable description of this object, if applicable
'location_info' - Information on how to activate the object. The meaning varies depending on the 'type'
typedef struct { GoadServer *list; GHashTable *by_goad_id; } GoadServerList; |
'list' is an array of GoadServer structures. 'by_goad_id' is a hash table with the GOAD ID of each implementation as the key, and the GoadServer structure for that implementation as the value.
GoadServerList* goad_server_list_get (void); |
Returns an array listing all the servers available for activation.
void goad_server_list_free (GoadServerList *server_list); |
Frees up all the memory associated with server_list (which should have been received from goad_server_list_get())
Side effects: Invalidates the memory pointed to by 'server_list'.
CORBA_Object goad_server_activate (GoadServer *sinfo, GoadActivationFlags flags, const char **params); |
Activates a CORBA server specified by 'sinfo', using the 'flags' hints on how to activate that server.
CORBA_Object goad_server_activate_with_repo_id (GoadServerList *server_list, const char *repo_id, GoadActivationFlags flags, const char **params); |
Activates a CORBA server specified by 'repo_id', using the 'flags' hints on how to activate that server. Picks the first one on the list that meets criteria.
This is done by possibly making three passes through the list, the first pass checking for existing objects only, the second pass taking into account any activation method preferences, and the last pass just doing "best we can get" service.
server_list : | a server listing returned by goad_server_list_get. If NULL, we will call the function ourself and use that. |
repo_id : | the repository ID of the interface that we want to activate a server for. |
flags : | information on how the application wants the server to be activated. |
params : | NULL for normal applications. |
Returns : | the activated object. |
CORBA_Object goad_server_activate_with_id (GoadServerList *server_list, const char *server_id, GoadActivationFlags flags, const char **params); |
Activates a CORBA server specified by 'repo_id', using the 'flags' hints on how to activate that server. Picks the first one on the list that matches.
server_list : | a server listing returned by goad_server_list_get. If NULL, we will call that function ourself and use that. |
server_id : | the GOAD ID of the server that we want to activate. |
flags : | information on how the application wants the server to be activated. |
params : | NULL for now. |
Returns : | the newly activated object. |