#include "../client/directory.h"
#include "FileInfo.h"
#include "split.h"
+#include "../client/vfs-slave.h"
static void impl_Captive_Directory_fini(impl_POA_Captive_Directory *servant,CORBA_Environment *ev);
static void impl_Captive_Directory_read
(impl_POA_Captive_Directory *servant,Captive_GnomeVFSFileInfo **file_info,CORBA_Environment *ev);
static void impl_Captive_Directory_remove(impl_POA_Captive_Directory *servant,CORBA_Environment *ev);
+static void impl_Captive_Directory_shutdown(impl_POA_Captive_Directory *servant,CORBA_Environment *ev);
static PortableServer_ServantBase__epv impl_Captive_Directory_base_epv={
NULL, /* _private */
(gpointer)&impl_Captive_Directory_read,
(gpointer)&impl_Captive_Directory_remove,
+ (gpointer)&impl_Captive_Directory_shutdown,
};
static POA_Captive_Directory__vepv impl_Captive_Directory_vepv={
&impl_Captive_Directory_base_epv,
impl_POA_Captive_Directory *retval_servant;
GnomeVFSResult errvfsresult;
+ g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(servant->captive_vfs_object),NULL); /* not yet initialized? */
+
retval=impl_Captive_Directory__create(servant->poa,ev);
if (ev->_major!=CORBA_NO_EXCEPTION)
return NULL;
impl_POA_Captive_Directory *retval_servant;
GnomeVFSResult errvfsresult;
+ g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(servant->captive_vfs_object),NULL); /* not yet initialized? */
+
retval=impl_Captive_Directory__create(servant->poa,ev);
if (ev->_major!=CORBA_NO_EXCEPTION)
return NULL;
return;
}
}
+
+
+static gboolean impl_Captive_Directory_shutdown_idle(impl_POA_Captive_Directory *servant /* data */)
+{
+ impl_Captive_Directory__destroy(servant,&captive_corba_ev);
+ g_assert(validate_CORBA_Environment(&captive_corba_ev));
+
+ return FALSE; /* remove me */
+}
+
+static void impl_Captive_Directory_shutdown(impl_POA_Captive_Directory *servant,CORBA_Environment *ev)
+{
+GSource *source;
+
+ /* Shutdown 'servant->captive_directory_object' synchronously as it may
+ * flush its buffers needed to be transferred to our parent.
+ */
+ impl_Captive_Directory_fini(servant,&captive_corba_ev);
+ g_assert(validate_CORBA_Environment(&captive_corba_ev));
+
+ /* Do not call impl_Captive_Directory__destroy() directly as we would fail
+ * to finish this CORBA method call properly.
+ * Do not call g_idle_add_full() as it would miss linc main loop.
+ * FIXME: STATUS_SHARING_VIOLATION error during batch processing.
+ * - probably exclusive access to be changed to shareable one
+ */
+ source=g_idle_source_new ();
+ g_source_set_priority(source,G_PRIORITY_LOW);
+ g_source_set_callback(
+ source, /* source */
+ (GSourceFunc)impl_Captive_Directory_shutdown_idle, /* func */
+ servant, /* data */
+ NULL); /* notify */
+ g_source_attach(source,
+ captive_corba_get_context()); /* context; NULL means 'default context' */
+ g_source_unref(source);
+}