Interface Assembly
access this type via: pal.Assembly (provides, requires or uses)
This interface offers support for deriving a set of compositional options for a given software system, by searching for all implementation variants of each interface. It also supports runtime adaptation between compositions and the injection of proxy and intercept components.
Functions
Assembly(char main[], storeAppParam params[], storeIDC perceptionModule, optional storeString interfaceExcludeList[], storeString componentExcludeList[])
String[] getConfigs()
bool setConfig(char conf[], optional ProxyLoaderInfo loaders[])
char[] getConfig()
bool runApp(char launchPath[])
String[] addComponent(char path[])
String[] remComponent(char path[])
UpdateInfo updComponent(char path[], optional ProxyLoaderInfo loaders[])
String[] addProxy(char forInterface[], char proxyComponent[], char tag[], char parameters[])
String[] remProxy(char forInterface[], char proxyComponent[], char tag[], char parameters[])
bool addIntercept(char intf[], char cmp[])
bool remIntercept(char intf[], char cmp[])
InterceptInfo[] getIntercepts()
void disableExceptions(storeString paths[])
Assembly(char main[], storeAppParam params[], storeIDC perceptionModule, optional storeString interfaceExcludeList[], storeString componentExcludeList[])
Constructor function which discovers the set of possible assemblies for a given 'main' component.
main Path to a compiled Dana component which implements the App interface.
perceptionModule A loaded Dana component which implements the pal.Perception interface.
String[] getConfigs()
Gets a list of all valid assemblies of the software system being managed, where each assembly is identified with a unique string.
bool setConfig(char conf[], optional ProxyLoaderInfo loaders[])
Changes the current assembly. The 'main' method of the assembled program is called the first time setConfig is called.
conf Identifier of the assembly to adapt to, which must be one previously returned by getConfigs()
loaders A set of proxy component loaders, to which the loading of a proxy is delegated during adaptation (see addProxy).
returns: Returns true if adaptation was successful, false otherwise.
char[] getConfig()
Get the current config (the caller would usually already have this information, but may not do if setConfig() fails).
bool runApp(char launchPath[])
Launches the main method of the program, blocking until that function completes.
String[] addComponent(char path[])
Adds a new component to the pool of available alternatives. The component being added, and any new dependencies, must already be in the appropriate directory relative to the system it is being added to.
String[] remComponent(char path[])
Removes an existing component from the pool of available alternatives. The currently selected composition must not be using this component).
UpdateInfo updComponent(char path[], optional ProxyLoaderInfo loaders[])
Updates an existing component to a new version. The component passed into this function must support the same provided interface type as its current version, but otherwise can have both implementation and sub-architecture changes. No other components that already exist in the running system, besides that passed as a parameter to this function, can have architecture changes of their own. The component being updated, and any new dependencies, must already be in the appropriate directory relative to the system being updated. The list of all configurations may be re-ordered following this operation, even if dependencies have not changed within the updated component.
path The specific component for which a new compiled version is now in the appropriate directory relative to the managed system.
returns: Returns the configuration identifier that is now active (or null if the operation failed).
String[] addProxy(char forInterface[], char proxyComponent[], char tag[], char parameters[])
Adds a proxy component for the given interface (which should be specified using its full package). New configuration options are generated which include the proxy component as an implementation of that interface. The actual loading of a proxy component is delegated to a proxy loader, and the 'proxyComponent', 'tag', and 'parameters' arguments to this function are all passed in to the proxy loader.
returns: True if successful, false otherwise.
String[] remProxy(char forInterface[], char proxyComponent[], char tag[], char parameters[])
Remove a previously-addedproxy component for the given interface (which should be specified using its full package). Configuration options which included this proxy component are removed from the set of available options.
returns: True if successful, false otherwise.
bool addIntercept(char intf[], char cmp[])
Adds an intercepting component at every instance of the given interface (which should be specified using its full package). A new instance of the intercepting component is loaded at each injection site. The intercepting component can either provide the same interface type as that being intercepted, or can provide the dynamic proxy interfaces lang.Proxy and lang.Morph. The intercepting component can also optionally implement pal.ProxyInfo to receive information about its injection site.
returns: True if successful, false otherwise.
bool remIntercept(char intf[], char cmp[])
Removes an existing interception rule, and all active interceptors of that rule.
returns: True if successful, false otherwise.
InterceptInfo[] getIntercepts()
Gets the list of currently installed intercept rules.
returns: True if successful, false otherwise.
void disableExceptions(storeString paths[])
Disable printing of exceptions for the given components (specified as absolute paths).