Libraries anvil runtime

namespace runtime
Provides access to runtime related operations, such as output redirection and type inspection.

Namespaces

namespace stack
Set of functions for investigating the contents of stack


Classes

class Doc
extends anvil.lang.object
Doc is a node in documentation tree, consisting of type, identifier and text.

Type is one of

If document is one marked with asterisk (*) then it will also contain identifier which indicates the name of documented entity.

Doc may also contain children docs.


class Function
extends anvil.lang.object
Function is a callable wrapper for functions and methods.

class Namespace
extends anvil.lang.object
Namespace is a wrapper for namespaces. There are two categories of namespaces, server namespace, declared in server's configuration and global namespace, always present thread specific namespace.

class Permission
extends anvil.lang.object
Class for representing access to a system resource.

class Scope
extends anvil.lang.object
Scope is a wrapper for modules and namespaces. It provides the contained entities with attributes or references.

class StackTraceElement
extends anvil.lang.object
Represents a single stack frame.

class Thread
extends anvil.lang.object
A thread is a thread of execution in a program. Multiple threads of execution may be running concurrently.

class ThreadPool
extends anvil.lang.object
ThreadPool is pool of re-usable threads. Re-use of threads is beneficial as the relative heavy-weight creation of thread can be avoided.

class Type
extends anvil.lang.object
Type is a generic representation of all the entities declared with anvil.


Functions

void cease()
Temporarily ceases the execution of current thread so that other can execute.

void disableTracing()
Disables stack tracing.

void enableTracing()
Enables stack tracing.

void flush()
Writes the of memory output stream to previous output stream in stack.
Throws IOError -  if an IO error occred

binary getBinaryContent()
Returns the content from memory output stream.

string getContent()
Returns the content from memory output stream.

int getContentLength()
Returns the content length in memory output stream.

string getCountry()
Returns the current country setting.

Charset getEncoding()
Returns the output stream encoding as instanceof java.nio.charset.Charset.

string getLanguage()
Returns the current language setting.

Type getLibraryRoot()
Returns the root namespace of loaded native libraries.

java.util.Locale getLocale()
Gets the default locale, as reflected instance of java.util.Locale.

Namespace getNamespace(string name)
Returns namespace with given name, or null.

OutputStream getOutput()
Returns the output stream to write to.

java.util.TimeZone getTimeZone()
Gets the default timezone, as reflected instance of java.util.TimeZone.

string getVariant()
Returns the current country variant setting.

void log(messages...)
Logs messages.

void logError(messages...)
Logs error messages.

void pop()
Removes previous execution output stream.
Throws IOError -  if an IO error occred

void push()
void push(OutputStream output)
Sets the execution output stream.
Parameters output -  Output stream where to direct the output, if omitted memory stream is used

void reset()
Clears the content in memory output stream.

void setCountry(string country)
Locale: sets the country. This setting is the default country for operations needing it.

void setEncoding(string encoding)
Sets the output stream encoding.

void setLanguage(string language)
Locale: sets the language.

void setTimeZone(string timezone)
Sets the default timezone.

void setTracing(boolean enabled)
Enables or disables stack tracing. If enabled will output notifications on log when functions are entered or leaved.

void setVariant(string variant)
Locale: sets the country variant. This setting is the default country variant for operations needing it.

void sleep(int millis)
Ceases the execution of current thread for given amount of milliseconds.
Throws Interrupted -  If sleeping was interrupted

void write(binary binary, int offset, int length)
void write(object text)
Writes (prints) data to output.