3c6daee652
Former-commit-id: f069081cc0821095435a845c961ae61cbbc95121
307 lines
9.6 KiB
HTML
307 lines
9.6 KiB
HTML
<?xml version="1.0" encoding="utf-8"?><span>
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>mono-api-domains.html</title>
|
|
<style type="text/css">
|
|
|
|
|
|
h3 {
|
|
font-size: 18px;
|
|
padding-bottom: 4pt;
|
|
border-bottom: 2px solid #dddddd;
|
|
}
|
|
|
|
.api {
|
|
border: 1px solid;
|
|
padding: 10pt;
|
|
margin: 10pt;
|
|
}
|
|
|
|
.api-entry {
|
|
border-bottom: none;
|
|
font-size: 18px;
|
|
}
|
|
|
|
.prototype {
|
|
border: 1px solid;
|
|
background-color: #f2f2f2;
|
|
padding: 5pt;
|
|
margin-top: 5pt;
|
|
margin-bottom: 5pt;
|
|
}
|
|
|
|
.header {
|
|
border: 1px solid;
|
|
padding: 0 0 5pt 5pt;
|
|
margin: 10pt;
|
|
white-space: pre;
|
|
font-family: monospace;
|
|
}
|
|
|
|
.code {
|
|
border: 1px solid;
|
|
padding: 0 0 5pt 5pt;
|
|
margin: 10pt;
|
|
white-space: pre;
|
|
font-family: monospace;
|
|
}
|
|
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h2>Application Domains</h2>
|
|
|
|
<h3>Synopsis</h3>
|
|
|
|
<div class="header">
|
|
#include <metadata/appdomain.h>
|
|
|
|
/* Managed AppDomain */
|
|
typedef struct _MonoAppDomain MonoAppDomain;
|
|
|
|
/* Unmanaged representation */
|
|
typedef struct _MonoDomain MonoDomain;
|
|
|
|
/* Represents System.Runtime.Remoting.Contexts.Context */
|
|
typedef struct _MonoAppContext MonoAppContext
|
|
MonoAssembly* <a href="#api:mono_domain_assembly_open">mono_domain_assembly_open</a> (MonoDomain *domain,
|
|
const char *name);
|
|
<a href="#api:mono_domain_create"></a>
|
|
gboolean <a href="#api:mono_domain_finalize">mono_domain_finalize</a> (MonoDomain *domain,
|
|
guint32 timeout) ;
|
|
<a href="#api:mono_domain_foreach"></a>
|
|
<a href="#api:mono_domain_free"></a>
|
|
<a href="#api:mono_domain_get_by_id"></a>
|
|
MonoDomain* <a href="#api:mono_domain_get_id">mono_domain_get_by_id</a> (gint32 domainid) ;
|
|
MonoDomain* <a href="#api:mono_domain_get">mono_domain_get</a> ();
|
|
gboolean <a href="#api:mono_domain_has_type_resolve">mono_domain_has_type_resolve</a> (MonoDomain *domain);
|
|
<a href="#api:mono_domain_is_unloading"></a>
|
|
void <a href="#api:mono_domain_set_internal">mono_domain_set_internal</a> (MonoDomain *domain);
|
|
gboolean <a href="#api:mono_domain_set">mono_domain_set</a> (MonoDomain *domain,
|
|
gboolean force);
|
|
MonoReflectionAssembly* <a href="#api:mono_domain_try_type_resolve">mono_domain_try_type_resolve</a> (MonoDomain *domain,
|
|
char *name,
|
|
MonoObject *tb);
|
|
gboolean <a href="#api:mono_domain_owns_vtable_slot">mono_domain_owns_vtable_slot</a> (MonoDomain *domain,
|
|
gpointer vtable_slot);
|
|
<a href="#api:mono_context_get"></a>
|
|
<a href="#api:mono_context_set"></a>
|
|
|
|
</div>
|
|
|
|
<p />Application domains are used to isolate multiple
|
|
applications on a single Mono virtual machine. They are
|
|
conceptually similiar to processes, the difference is that
|
|
processes are managed by the operating system, while
|
|
application domains are managed by the Mono virtual machine.
|
|
|
|
<p />For more information on applications domains see the <a href="http://www.gotdotnet.com/team/clr/AppdomainFAQ.aspx">AppDomain FAQ</a>.
|
|
|
|
<p />The <tt>MonoDomain</tt> is the unmanaged representation of
|
|
the <a href="http://www.mono-project.com/monodoc/T:System.AppDomain">System.AppDomain</a>
|
|
managed type, while the <tt>MonoAppDomain</tt> type represents
|
|
the managed version (<tt>MonoAppDomain</tt> has a pointer to
|
|
a <tt>MonoDomain</tt>).
|
|
|
|
<a name="api:mono_domain_assembly_open"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_assembly_open</div>
|
|
|
|
<div class="prototype">MonoAssembly*
|
|
mono_domain_assembly_open (MonoDomain *domain, const char *name)
|
|
|
|
</div>
|
|
<p />
|
|
<b>Parameters</b>
|
|
<blockquote><dt><i>domain:</i></dt><dd> the application domain</dd><dt><i>name:</i></dt><dd> file name of the assembly</dd></blockquote>
|
|
<b>Remarks</b>
|
|
<p />
|
|
fixme: maybe we should integrate this with mono_assembly_open ??
|
|
|
|
</div> <a name="api:mono_domain_create"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_create</div>
|
|
|
|
<div class="prototype">Prototype: mono_domain_create</div>
|
|
<p />
|
|
|
|
</div> <a name="api:mono_domain_finalize"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_finalize</div>
|
|
|
|
<div class="prototype">
|
|
gboolean
|
|
mono_domain_finalize (MonoDomain *domain, guint32 timeout)
|
|
|
|
</div>
|
|
<p />
|
|
<b>Parameters</b>
|
|
<blockquote><dt><i>domain:</i></dt><dd> the domain to finalize</dd><dt><i>timeout:</i></dt><dd> msects to wait for the finalization to complete, -1 to wait indefinitely</dd></blockquote>
|
|
<b>Returns</b>
|
|
<blockquote> TRUE if succeeded, FALSE if there was a timeout
|
|
</blockquote>
|
|
<b>Remarks</b>
|
|
<p />
|
|
Request finalization of all finalizable objects inside <i>domain</i>. Wait
|
|
<i>timeout</i> msecs for the finalization to complete.
|
|
|
|
|
|
</div> <a name="api:mono_domain_foreach"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_foreach</div>
|
|
|
|
<div class="prototype">Prototype: mono_domain_foreach</div>
|
|
<p />
|
|
|
|
</div> <a name="api:mono_domain_free"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_free</div>
|
|
|
|
<div class="prototype">Prototype: mono_domain_free</div>
|
|
<p />
|
|
|
|
</div> <a name="api:mono_domain_get_by_id"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_get_by_id</div>
|
|
|
|
<div class="prototype">Prototype: mono_domain_get_by_id</div>
|
|
<p />
|
|
|
|
</div> <a name="api:mono_domain_get_id"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_get_id</div>
|
|
|
|
<div class="prototype">MonoDomain*
|
|
mono_domain_get_by_id (gint32 domainid)
|
|
|
|
</div>
|
|
<p />
|
|
<b>Parameters</b>
|
|
<blockquote><dt><i>domainid:</i></dt><dd> the ID</dd></blockquote>
|
|
<b>Returns</b>
|
|
<blockquote> the a domain for a specific domain id.
|
|
</blockquote>
|
|
|
|
</div> <a name="api:mono_domain_get"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_get</div>
|
|
|
|
<div class="prototype">MonoDomain*
|
|
mono_domain_get ()
|
|
|
|
</div>
|
|
<p />
|
|
<b>Returns</b>
|
|
<blockquote> the current domain, to obtain the root domain use
|
|
|
|
mono_get_root_domain().</blockquote>
|
|
|
|
</div> <a name="api:mono_domain_has_type_resolve"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_has_type_resolve</div>
|
|
|
|
<div class="prototype">gboolean
|
|
mono_domain_has_type_resolve (MonoDomain *domain)
|
|
|
|
</div>
|
|
<p />
|
|
<b>Parameters</b>
|
|
<blockquote><dt><i>domain:</i></dt><dd> application domains being looked up</dd></blockquote>
|
|
<b>Remarks</b>
|
|
<p />
|
|
Returns true if the AppDomain.TypeResolve field has been
|
|
set.
|
|
|
|
</div> <a name="api:mono_domain_is_unloading"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_is_unloading</div>
|
|
|
|
<div class="prototype">Prototype: mono_domain_is_unloading</div>
|
|
<p />
|
|
|
|
</div> <a name="api:mono_domain_set_internal"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_set_internal</div>
|
|
|
|
<div class="prototype">void
|
|
mono_domain_set_internal (MonoDomain *domain)
|
|
|
|
</div>
|
|
<p />
|
|
<b>Parameters</b>
|
|
<blockquote><dt><i>domain:</i></dt><dd> the new domain</dd></blockquote>
|
|
<b>Remarks</b>
|
|
<p />
|
|
Sets the current domain to <i>domain</i>.
|
|
|
|
</div> <a name="api:mono_domain_set"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_set</div>
|
|
|
|
<div class="prototype">gboolean
|
|
mono_domain_set (MonoDomain *domain, gboolean force)
|
|
|
|
</div>
|
|
<p />
|
|
<b>Parameters</b>
|
|
<blockquote><dt><i>domain:</i></dt><dd> domain</dd><dt><i>force:</i></dt><dd> force setting.</dd></blockquote>
|
|
<b>Returns</b>
|
|
<blockquote>
|
|
|
|
TRUE on success;
|
|
FALSE if the domain is unloaded</blockquote>
|
|
<b>Remarks</b>
|
|
<p />
|
|
Set the current appdomain to <i>domain</i>. If <i>force</i> is set, set it even
|
|
if it is being unloaded.
|
|
|
|
|
|
</div> <a name="api:mono_domain_try_type_resolve"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_try_type_resolve</div>
|
|
|
|
<div class="prototype">MonoReflectionAssembly*
|
|
mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb)
|
|
|
|
</div>
|
|
<p />
|
|
<b>Parameters</b>
|
|
<blockquote><dt><i>domain:</i></dt><dd> application domainwhere the name where the type is going to be resolved</dd><dt><i>name:</i></dt><dd> the name of the type to resolve or NULL.</dd><dt><i>tb:</i></dt><dd> A System.Reflection.Emit.TypeBuilder, used if name is NULL.</dd></blockquote>
|
|
<b>Returns</b>
|
|
<blockquote> A MonoReflectionAssembly or NULL if not found
|
|
</blockquote>
|
|
<b>Remarks</b>
|
|
<p />
|
|
This routine invokes the internal System.AppDomain.DoTypeResolve and returns
|
|
the assembly that matches name.
|
|
|
|
If <i>name</i> is null, the value of ((TypeBuilder)tb).FullName is used instead
|
|
|
|
|
|
</div> <a name="api:mono_domain_owns_vtable_slot"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_domain_owns_vtable_slot</div>
|
|
|
|
<div class="prototype">gboolean
|
|
mono_domain_owns_vtable_slot (MonoDomain *domain, gpointer vtable_slot)
|
|
|
|
</div>
|
|
<p />
|
|
<b>Remarks</b>
|
|
<p />
|
|
Returns whenever VTABLE_SLOT is inside a vtable which belongs to DOMAIN.
|
|
|
|
|
|
</div><h3>Contexts</h3>
|
|
|
|
<a name="api:mono_context_get"></a>
|
|
<div class="api">
|
|
<div class="api-entry">mono_context_get</div>
|
|
|
|
<div class="prototype">Prototype: mono_context_get</div>
|
|
<p />
|
|
|
|
</div></body>
|
|
</html>
|
|
</span> |