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.
For more information on applications domains see the AppDomain FAQ.
The MonoDomain is the unmanaged representation of the System.AppDomain managed type, while the MonoAppDomain type represents the managed version (MonoAppDomain has a pointer to a MonoDomain).
mono_domain_assembly_open
domain | the application domain |
name | file name of the assembly |
fixme: maybe we should integrate this with mono_assembly_open ??
mono_domain_create
Creates a new application domain, the unmanaged representation of the actual domain. Usually you will want to create the
Application domains provide an isolation facilty for assemblies. You can load assemblies and execute code in them that will not be visible to other application domains. This is a runtime-based virtualization technology.
It is possible to unload domains, which unloads the assemblies and data that was allocated in that domain.
When a domain is created a mempool is allocated for domain-specific structures, along a dedicated code manager to hold code that is associated with the domain.
mono_domain_create_appdomain
friendly_name | The friendly name of the appdomain to create |
configuration_file | The configuration file to initialize the appdomain with |
Returns a MonoDomain initialized with the appdomain
mono_domain_finalize
domain | the domain to finalize |
timeout | msects to wait for the finalization to complete, -1 to wait indefinitely |
TRUE
if succeeded, FALSE
if there was a timeout
Request finalization of all finalizable objects inside domain. Wait timeout msecs for the finalization to complete.
mono_domain_foreach
func | function to invoke with the domain data |
user_data | user-defined pointer that is passed to the supplied func fo reach domain |
Use this method to safely iterate over all the loaded application domains in the current runtime. The provided func is invoked with a pointer to the MonoDomain and is given the value of the user_data parameter which can be used to pass state to your called routine.
mono_domain_free
domain | the domain to release |
force | if true, it allows the root domain to be released (used at shutdown only). |
This releases the resources associated with the specific domain. This is a low-level function that is invoked by the AppDomain infrastructure when necessary.
mono_domain_from_appdomain
mono_domain_get_by_id
domainid | the ID |
mono_domain_get_friendly_name
mono_domain_get_id
mono_domain_get
This method returns the value of the current MonoDomain that this thread and code are running under. To obtain the root domain use mono_get_root_domain() API.
mono_domain_has_type_resolve
domain | application domains being looked up |
TRUE
if the AppDomain.TypeResolve field has been
set.
mono_domain_is_unloading
mono_domain_owns_vtable_slot
Returns whenever VTABLE_SLOT is inside a vtable which belongs to DOMAIN.
mono_domain_set_config
domain | MonoDomain initialized with the appdomain we want to change |
base_dir | new base directory for the appdomain |
config_file_name | path to the new configuration for the app domain |
Used to set the system configuration for an appdomain
Without using this, embedded builds will get 'System.Configuration.ConfigurationErrorsException: Error Initializing the configuration system. ---> System.ArgumentException: The 'ExeConfigFilename' argument cannot be null.' for some managed calls.
mono_domain_set_internal
domain | the new domain |
Sets the current domain to domain.
mono_domain_set
domain | domain |
force | force setting. |
TRUE
on success;
FALSE
if the domain is unloadedSet the current appdomain to domain. If force is set, set it even if it is being unloaded.
mono_domain_try_type_resolve
domain | application domainwhere the name where the type is going to be resolved |
name | the name of the type to resolve or NULL . |
tb | A System.Reflection.Emit.TypeBuilder, used if name is NULL . |
NULL
if not found
This routine invokes the internal System.AppDomain.DoTypeResolve and returns the assembly that matches name.
If name is null, the value of ((TypeBuilder)tb).FullName is used instead
mono_domain_try_unload
mono_domain_unload
mono_context_init
domain | The domain where the System.Runtime.Remoting.Context.Context is initialized |
Initializes the domain's default System.Runtime.Remoting's Context.
mono_context_get
mono_context_get_domain_id
context | the context to operate on. |
mono_context_get_id
context | the context to operate on. |
Context IDs are guaranteed to be unique for the duration of a Mono process; they are never reused.
mono_context_set