MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //usr/share/gtk-doc/html/bonobo-activation/bonobo-activation-Registration.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Registration</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="Bonobo Activation API Reference Manual">
<link rel="up" href="api-reference.html" title="API Reference">
<link rel="prev" href="bonobo-activation-Utilities.html" title="Utilities">
<link rel="next" href="bonobo-activation-Debugging.html" title="Debugging">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="tutorial.html" title="Bonobo Activation tutorial">
<link rel="chapter" href="configuring.html" title="Configuring Bonobo Activation">
<link rel="chapter" href="architecture.html" title="Bonobo Activation Architecture">
<link rel="chapter" href="query-langage.html" title="Bonobo Activation Query Langage">
<link rel="chapter" href="server-xml-reference.html" title=".server file format reference">
<link rel="chapter" href="migrating.html" title="Migrating from gnorba to Bonobo-activation">
<link rel="chapter" href="api-reference.html" title="API Reference">
<link rel="article" href="lgpl.html" title="GNU Lesser General Public License">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="bonobo-activation-Utilities.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="api-reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Bonobo Activation API Reference Manual</th>
<td><a accesskey="n" href="bonobo-activation-Debugging.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2979419" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2979697" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="bonobo-activation-Registration"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2979419"></a><span class="refentrytitle">Registration</span>
</h2>
<p>Registration &#8212; Registering CORBA objects to Bonobo Activation.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;bonobo-activation/bonobo-activation.h&gt;


enum        <a href="bonobo-activation-Registration.html#Bonobo-RegistrationResult">Bonobo_RegistrationResult</a>;
void        <a href="bonobo-activation-Registration.html#bonobo-activation-unregister-active-server">bonobo_activation_unregister_active_server</a>
                                            (const char *iid,
                                             CORBA_Object obj);
void        <a href="bonobo-activation-Registration.html#bonobo-activation-registration-env-free">bonobo_activation_registration_env_free</a>
                                            (<a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a> *reg_env);
<a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a>*     <a href="bonobo-activation-Registration.html#bonobo-activation-registration-env-set">bonobo_activation_registration_env_set</a>
                                            (<a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a> *reg_env,
                                             const char *name,
                                             const char *value);
void        <a href="bonobo-activation-Registration.html#bonobo-activation-registration-env-set-global">bonobo_activation_registration_env_set_global</a>
                                            (<a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a> *reg_env,
                                             <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> append_if_existing);
<a href="bonobo-activation-Registration.html#Bonobo-RegistrationResult">Bonobo_RegistrationResult</a> <a href="bonobo-activation-Registration.html#bonobo-activation-register-active-server">bonobo_activation_register_active_server</a>
                                            (const char *iid,
                                             CORBA_Object obj,
                                             <a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a> *reg_env);
const char* <a href="bonobo-activation-Registration.html#bonobo-activation-iid-get">bonobo_activation_iid_get</a>       (void);
            <a href="bonobo-activation-Registration.html#BonoboActivationPlugin">BonoboActivationPlugin</a>;
            <a href="bonobo-activation-Registration.html#BonoboActivationPluginObject">BonoboActivationPluginObject</a>;
void        <a href="bonobo-activation-Registration.html#bonobo-activation-plugin-use">bonobo_activation_plugin_use</a>    (PortableServer_Servant servant,
                                             <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> impl_ptr);
void        <a href="bonobo-activation-Registration.html#bonobo-activation-plugin-unuse">bonobo_activation_plugin_unuse</a>  (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> impl_ptr);

</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2979697"></a><h2>Description</h2>
<p>
When writing a component which can be activated through
Bonobo Activation by clients, you need to be register your component
to Bonobo Activation once it is created.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2979714"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2979725"></a><h3>
<a name="Bonobo-RegistrationResult"></a>enum Bonobo_RegistrationResult</h3>
<a class="indexterm" name="id2979738"></a><pre class="programlisting">typedef enum {
  Bonobo_ACTIVATION_REG_SUCCESS,
  Bonobo_ACTIVATION_REG_NOT_LISTED,
  Bonobo_ACTIVATION_REG_ALREADY_ACTIVE,
  Bonobo_ACTIVATION_REG_ERROR
} Bonobo_RegistrationResult;
</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2979756"></a><h3>
<a name="bonobo-activation-unregister-active-server"></a>bonobo_activation_unregister_active_server ()</h3>
<a class="indexterm" name="id2979770"></a><pre class="programlisting">void        bonobo_activation_unregister_active_server
                                            (const char *iid,
                                             CORBA_Object obj);</pre>
<p>
Unregisters <em class="parameter"><code>obj</code></em> with <em class="parameter"><code>iid</code></em> with the local bonobo-activation-server
daemon.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iid</code></em>&#160;:</span></td>
<td> IID of the server to unregister.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>obj</code></em>&#160;:</span></td>
<td> CORBA::Object to unregister.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2979855"></a><h3>
<a name="bonobo-activation-registration-env-free"></a>bonobo_activation_registration_env_free ()</h3>
<a class="indexterm" name="id2979869"></a><pre class="programlisting">void        bonobo_activation_registration_env_free
                                            (<a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a> *reg_env);</pre>
<p>
Frees the registration environment list, <em class="parameter"><code>reg_env</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>reg_env</code></em>&#160;:</span></td>
<td> a GSList pointer.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2979926"></a><h3>
<a name="bonobo-activation-registration-env-set"></a>bonobo_activation_registration_env_set ()</h3>
<a class="indexterm" name="id2979940"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a>*     bonobo_activation_registration_env_set
                                            (<a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a> *reg_env,
                                             const char *name,
                                             const char *value);</pre>
<p>
Sets the environment variable <em class="parameter"><code>name</code></em> to <em class="parameter"><code>value</code></em> in the
registration environment list <em class="parameter"><code>reg_env</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>reg_env</code></em>&#160;:</span></td>
<td> a GSList pointer.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></td>
<td> the name of the env variable (must not be <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></td>
<td> the value of the env variable (may be <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> the new start of <em class="parameter"><code>reg_env</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2980090"></a><h3>
<a name="bonobo-activation-registration-env-set-global"></a>bonobo_activation_registration_env_set_global ()</h3>
<a class="indexterm" name="id2980104"></a><pre class="programlisting">void        bonobo_activation_registration_env_set_global
                                            (<a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a> *reg_env,
                                             <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> append_if_existing);</pre>
<p>
Sets the global registration environment list with the
contents of <em class="parameter"><code>reg_env</code></em>. If <em class="parameter"><code>append_if_existing</code></em> is set to
<a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a>, the an existing global list will be overwritten.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>reg_env</code></em>&#160;:</span></td>
<td> a GSList pointer.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>append_if_existing</code></em>&#160;:</span></td>
<td> whether or not to append to the global list.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2980203"></a><h3>
<a name="bonobo-activation-register-active-server"></a>bonobo_activation_register_active_server ()</h3>
<a class="indexterm" name="id2980216"></a><pre class="programlisting"><a href="bonobo-activation-Registration.html#Bonobo-RegistrationResult">Bonobo_RegistrationResult</a> bonobo_activation_register_active_server
                                            (const char *iid,
                                             CORBA_Object obj,
                                             <a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a> *reg_env);</pre>
<p>
Registers <em class="parameter"><code>obj</code></em> with <em class="parameter"><code>iid</code></em> with the local bonobo-activation-server
daemon.
</p>
<p>
If <em class="parameter"><code>reg_env</code></em> is not <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>, <em class="parameter"><code>obj</code></em> will be registered in such a
way that if a client who's environment differs from the
environment specified in <em class="parameter"><code>reg_env</code></em>, then another attempt
to activate <em class="parameter"><code>iid</code></em> will not result in a reference to <em class="parameter"><code>obj</code></em>
being returned, but rather another instance of <em class="parameter"><code>iid</code></em> being
activated.
</p>
<p>
So, for example, you can ensure that a seperate instance
of the component is activated for each distinct X display
(and screen) by:
</p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
  display_name = gdk_display_get_name (<a
href="/usr/share/gtk-doc/html/gdk/GdkDisplay.html#gdk-display-get-default"
><code class="function">gdk_display_get_default()</code></a>);
  reg_env = bonobo_activation_registration_env_set (
                             reg_env, "DISPLAY", display_name);
  bonobo_activation_register_active_server (iid, active_server, reg_env);
  bonobo_activation_registration_env_free (reg_env);
</pre></div>
<p>
</p>
<p>
If <em class="parameter"><code>reg_env</code></em> is <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>, the global registration environment
list will be used if it is set. See
<a href="bonobo-activation-Registration.html#bonobo-activation-registration-env-set-global"><code class="function">bonobo_activation_registration_env_set_global()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>iid</code></em>&#160;:</span></td>
<td> IID of the server to register.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>obj</code></em>&#160;:</span></td>
<td> CORBA::Object to register.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>reg_env</code></em>&#160;:</span></td>
<td> the registration environment.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> status of the registration.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2980452"></a><h3>
<a name="bonobo-activation-iid-get"></a>bonobo_activation_iid_get ()</h3>
<a class="indexterm" name="id2980465"></a><pre class="programlisting">const char* bonobo_activation_iid_get       (void);</pre>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2980502"></a><h3>
<a name="BonoboActivationPlugin"></a>BonoboActivationPlugin</h3>
<a class="indexterm" name="id2980514"></a><pre class="programlisting">typedef struct {
	const BonoboActivationPluginObject *plugin_object_list;
	const char *description;
        gpointer dummy[8];
} BonoboActivationPlugin;
</pre>
<p>
Components which want to be activated as 
shared libraries must export an BonoboActivationPlugin
structure of name <span class="structname">Bonobo_Plugin_info</span>.
An exmaple of how to use it folows:
</p>
<pre class="programlisting">
static CORBA_Object
hi_shlib_make_object (PortableServer_POA poa,
                      const char *iid,
                      gpointer impl_ptr,
                      CORBA_Environment *ev)
{
        CORBA_Object object_ref;

        object_ref = impl_Hi__create (poa, ev);
        if (object_ref == CORBA_OBJECT_NIL 
            || ev-&gt;_major != CORBA_NO_EXCEPTION) {
                printf ("Server cannot get objref\n");
                return CORBA_OBJECT_NIL;
        }

        bonobo_activation_plugin_use (poa, impl_ptr);

        return object_ref;
}

static const BonoboActivationPluginObject hi_plugin_list[] = {
        {
                "OAFIID:Hi:20000923",
                hi_shlib_make_object
        },
        {
                NULL
  	}
};

const BonoboActivationPlugin Bonobo_Plugin_info = {
        hi_plugin_list,
        "Hi example"
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2980559"></a><h3>
<a name="BonoboActivationPluginObject"></a>BonoboActivationPluginObject</h3>
<a class="indexterm" name="id2980572"></a><pre class="programlisting">typedef struct {
	const char *iid;

	/* This routine should call bonobo_activation_plugin_use(servant, impl_ptr), 
         * as should all routines which activate CORBA objects
	 * implemented by this shared library. This needs to be done 
         * before making any CORBA calls on the object, or
	 * passing that object around. First thing after servant creation 
         * always works. :) 
         */

        CORBA_Object (*activate) (PortableServer_POA poa,
                                  const char *iid, 
                                  gpointer impl_ptr,	/* This pointer should be stored by the implementation
                                                         * to be passed to bonobo_activation_plugin_unuse() in the 
                                                         * implementation's destruction routine. */
				  CORBA_Environment *ev);
        gpointer dummy[4];
} BonoboActivationPluginObject;
</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2980602"></a><h3>
<a name="bonobo-activation-plugin-use"></a>bonobo_activation_plugin_use ()</h3>
<a class="indexterm" name="id2980616"></a><pre class="programlisting">void        bonobo_activation_plugin_use    (PortableServer_Servant servant,
                                             <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> impl_ptr);</pre>
<p>
You should call this routine to activate a shared library-based 
CORBA Object. It will be called by OAF if the component exports 
correctly an <a href="bonobo-activation-Registration.html#BonoboActivationPlugin"><code class="literal">BonoboActivationPlugin</code></a> structure named "Bonobo_Plugin_info".</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>servant</code></em>&#160;:</span></td>
<td> The servant that was created
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>impl_ptr</code></em>&#160;:</span></td>
<td> The impl_ptr that was passed to the original activation routine
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2980704"></a><h3>
<a name="bonobo-activation-plugin-unuse"></a>bonobo_activation_plugin_unuse ()</h3>
<a class="indexterm" name="id2980717"></a><pre class="programlisting">void        bonobo_activation_plugin_unuse  (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> impl_ptr);</pre>
<p>
Side effects: May arrange for the shared library that the
implementation is in to be unloaded.
</p>
<p>
When a shlib plugin for a CORBA object is destroying an
implementation, it should call this function to make sure that the
shared library is unloaded as needed.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>impl_ptr</code></em>&#160;:</span></td>
<td> The impl_ptr that was passed to the activation routine
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>