Libraries anvil system

namespace system
Provides access to system related operations, such as server's resources and configuration.

Classes

class Configurable
extends anvil.lang.object
Configurable represents entities declared in server's configuration. These entities form a tree which can be investigated and modified through this class.

class Envelope
extends anvil.lang.object
Envelope represents compiled script in server's cache.

class Resource
extends anvil.lang.object
Resource represents resources stored in zone's containers. Resources may be obtained through anvil.system.rawImport().


Functions

void formatScript(File file [, object handler] )
void formatScript(InputStream inputStream [, object handler] )
void formatScript(string script [, object handler] )
Assumes data pointed by given parameter is an anvil script and formats and outputs it accordingly. If optional handler is given it may contain any number of predefined callbacks, which should output representation of element they reflect.

Handler may be:


void formatTemplate(File file [, object handler] )
void formatTemplate(InputStream inputStream [, object handler] )
void formatTemplate(string script [, object handler] )
Assumes data pointed by given parameter is an anvil template and formats and outputs it accordingly. If optional handler is given it may contain any number of predefined callbacks, which should output representation of element they reflect.

Handler may be:


Configurable getApplicationProperties()

string getBuild()
Returns the build id of Anvil software.

int getFreeMemory()
Returns the amount of free memory at JVM heap, in bytes.

string getFullVersion()
Returns the full version of Anvil software.

array getProperties()
Returns an array containing all the properties from application configuration section.

string getProperty(string propertyName)
Returns a named property from application configuration section, or undefined if property does not exist.

Configurable getServer()
Returns the root configuration.

array getSystemProperties()
Returns an array of system properties from underlying JVM.

string getSystemProperty(string propertyName)
Returns a system property from underlying JVM.

int getTotalMemory()
Returns the total size of memory allocated for JVM heap, in bytes.

string getVersion()
Returns the version of Anvil software.

Resource rawImport(string pathinfo)
Imports resource pointed at given path 'as is'.
Throws ImportError -  If import failed