Home Reference Source Test
public class | source

Sandbox

Extends:

BusMiniBus → Sandbox

Constructor Summary

Public Constructor
public

constructor(capabilities: *)

Method Summary

Public Methods
public

deployComponent(componentSourceCode: string, componentURL: URL, configuration: Config): Promise<string>

Deploy an instance of the component into the sandbox.

public

matches(constraints: RuntimeCapabilities): boolean

Matches Sandbox capabilities against provided capabilities.

public

removeComponent(componentURL: URL): Promise<string>

Remove the instance of a previously deployed component.

Inherited Summary

From class Bus
public

addListener(url: URL, listener: Listener): MsgListener

Register listener to receive message when "msg.to === url".

public

addResponseListener(url: URL, msgId: number, responseListener: Function)

Manually add a response listener.

public

bind(outUrl: URL, inUrl: URL, target: MiniBus): Bound

Helper method to bind listeners (in both directions) into other MiniBus target.

public

postMessage(msg: Message, responseCallback: Function): number

Send messages to local listeners, or if not exists to external listeners.

public

Remove all existent listeners for the URL

public

removeResponseListener(url: URL, msgId: number)

Remove the response listener.

From class MiniBus
public

postMessage(inMsg: Message, responseCallback: Callback): number

Post a message for routing.

Public Constructors

public constructor(capabilities: *) source

Override:

MiniBus#constructor

Params:

NameTypeAttributeDescription
capabilities *

Public Methods

public deployComponent(componentSourceCode: string, componentURL: URL, configuration: Config): Promise<string> source

Deploy an instance of the component into the sandbox.

Params:

NameTypeAttributeDescription
componentSourceCode string

Component source code (Hyperty, ProtoStub, etc)

componentURL URL

Hyperty, ProtoStub, or any other component address.

configuration Config

Config parameters of the component

Return:

Promise<string>

return deployed if successful, or any other string with an error

public matches(constraints: RuntimeCapabilities): boolean source

Matches Sandbox capabilities against provided capabilities. Used to check if sandbox provides all required capabilities

Params:

NameTypeAttributeDescription
constraints RuntimeCapabilities

set of RuntimeCapabilities to match with.

Return:

boolean

return true if constraints are matched false otherwise

public removeComponent(componentURL: URL): Promise<string> source

Remove the instance of a previously deployed component.

Params:

NameTypeAttributeDescription
componentURL URL

Hyperty, ProtoStub, or any other component address.

Return:

Promise<string>

return undeployed if successful, or any other string with an error