### Table of Contents - [constructor](#constructor) - [send](#send) - [getActor](#getactor) - [createActor](#createactor) - [createStateRoot](#createstateroot) - [registerContainer](#registercontainer) ## constructor [index.js:10-15](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/index.js#L10-L15 "Source code on GitHub") The Hypervisor manages the container instances by instantiating them and destorying them when possible. It also facilitates localating Containers **Parameters** - `tree` **Tree** a [radix tree](https://github.com/dfinity/js-dfinity-radix-tree) to store the state ## send [index.js:23-27](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/index.js#L23-L27 "Source code on GitHub") sends a message **Parameters** - `cap` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the capabilitly used to send the message - `message` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the [message](https://github.com/primea/js-primea-message) to send Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** a promise that resolves once the receiving container is loaded ## getActor [index.js:52-63](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/index.js#L52-L63 "Source code on GitHub") gets an existsing actor **Parameters** - `id` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the actor's ID Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## createActor [index.js:71-94](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/index.js#L71-L94 "Source code on GitHub") creates an instance of an Actor **Parameters** - `type` **Integer** the type id for the container - `message` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** an intial [message](https://github.com/primea/js-primea-message) to send newly created actor - `id` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the id for the actor (optional, default `{nonce:this.nonce++,parent:null}`) ## createStateRoot [index.js:107-110](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/index.js#L107-L110 "Source code on GitHub") creates a state root starting from a given container and a given number of ticks **Parameters** - `ticks` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of ticks at which to create the state root Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## registerContainer [index.js:118-123](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/index.js#L118-L123 "Source code on GitHub") regirsters a container with the hypervisor **Parameters** - `Constructor` **Class** a Class for instantiating the container - `args` **any** any args that the contructor takes - `typeId` **Integer** the container's type identification ID (optional, default `Constructor.typeId`)