globus_extension.h File Reference

Globus Extension Modules. More...

#include "globus_common_include.h"
#include "globus_module.h"
#include "globus_hashtable.h"

Go to the source code of this file.

Defines

#define GlobusExtensionDefineModule(name)   globus_module_descriptor_t name##_module

Functions

int globus_extension_activate (const char *extension_name)
void * globus_extension_lookup (globus_extension_handle_t *handle, globus_extension_registry_t *registry, void *symbol)
int globus_extension_register_builtin (const char *extension_name, globus_module_descriptor_t *module_descriptor)


Detailed Description

Globus Extension Modules.


Define Documentation

#define GlobusExtensionDefineModule ( name   )     globus_module_descriptor_t name##_module

Declare your module with the following.

Ex: GlobusExtensionDefineModule(my_module) = { "my_module", globus_l_my_module_activate, globus_l_my_module_deactivate, NULL, NULL, &local_version };


Function Documentation

int globus_extension_activate ( const char *  extension_name  ) 

loads the shared library 'libextension_name_flavor.so' from $GLOBUS_LOCATION/lib (or other location in LD_LIBRARY_PATH and activates the module defined within.

In the future, a configuration file will be supported allowing arbitrary extension names to be mapped to a specific library name.

Also, when builtin (compiled in) extensions are supported, this will activate those directly without needing to load the library.

Search order:

void* globus_extension_lookup ( globus_extension_handle_t *  handle,
globus_extension_registry_t *  registry,
void *  symbol 
)

Get the datum associated with symbol in this registry.

You MUST call globus_extension_release() when you are done using the data. the lookup() and release() calls handle the reference counting that prevents an extension from being unloaded while things it provides are being used. Do NOT call release() until you are done accessing the data from * the lookup() call.

release() could potentially block as a result of module deactivation and unloading. ensuring that globus_extension_deactivate() is not called with outstanding references will prevent that.

symbol is a char * by default. the key can be changed by calling globus_extension_registry_set_hashing() before it is accessed.

int globus_extension_register_builtin ( const char *  extension_name,
globus_module_descriptor_t module_descriptor 
)

hopefully in the future, these functions will only be needed by generated code


Generated on 17 Mar 2017 for globus_common by  doxygen 1.4.7