Runtime

Inclusion code:

Service Deployment
Port NameLocationProtocolInterfaces
Runtime documentation:
Runtime--RuntimeInterface

List of Available Interfaces

RuntimeInterface

Interface documentation:

Operation Description

getVersion

Operation documentation: Returns the version of the Jolie interpreter running this service.

Invocation template:

getVersion@Runtime( request )( response )

Request type

Type: void

void : void

Response type

Type: string

string : string

loadLibrary

Operation documentation: Dynamically loads an external (jar) library.

Invocation template:

loadLibrary@Runtime( request )( response )

Request type

Type: string

string : string

Response type

Type: void

void : void

Possible faults thrown

Fault IOException with type IOExceptionType

Fault-handling install template:

install ( IOException => /* error-handling code */ )
type IOExceptionType: JavaExceptionType

removeOutputPort

Operation documentation: Removes the output port with the requested name.

Invocation template:

removeOutputPort@Runtime( request )( response )

Request type

Type: string

string : string

Response type

Type: void

void : void

setRedirection

Operation documentation: Set a redirection at an input port. If the redirection with this name does not exist already, this operation creates it. Otherwise, the redirection is replaced with this one.

Invocation template:

setRedirection@Runtime( request )( response )

Request type

Type: SetRedirectionRequest

type SetRedirectionRequest: void {
    .inputPortName: string
    .outputPortName: string
    .resourceName: string
}

SetRedirectionRequest : void

  • inputPortName : string : The target input port
  • outputPortName : string : The target output port
  • resourceName : string : The target resource name

Response type

Type: void

void : void

Possible faults thrown

Fault RuntimeException with type RuntimeExceptionType

Fault-handling install template:

install ( RuntimeException => /* error-handling code */ )
type RuntimeExceptionType: JavaExceptionType

getOutputPorts

Operation documentation: Returns all the output ports used by this service.

Invocation template:

getOutputPorts@Runtime( request )( response )

Request type

Type: void

void : void

Response type

Type: GetOutputPortsResponse

type GetOutputPortsResponse: void {
    .port*: void {
        .protocol: string
        .name: string
        .location: string
    }
}

GetOutputPortsResponse : void

  • port : void : The output ports used by this interpreter
    • protocol : string : The protocol name of the output port
    • name : string : The name of the output port
    • location : string : The location of the output port

loadEmbeddedService

Operation documentation: Load an embedded service.

Invocation template:

loadEmbeddedService@Runtime( request )( response )

Request type

Type: LoadEmbeddedServiceRequest

type LoadEmbeddedServiceRequest: void {
    .filepath: string
    .type: string
}

LoadEmbeddedServiceRequest : void

  • filepath : string : The path to the service to load
  • type : string : The type of the service, e.g., Jolie, Java, or JavaScript

Response type

Type: any

any : any

Possible faults thrown

Fault RuntimeException with type RuntimeExceptionType

Fault-handling install template:

install ( RuntimeException => /* error-handling code */ )
type RuntimeExceptionType: JavaExceptionType

getOutputPort

Operation documentation: Returns the definition of output port definition. @throws OutputPortDoesNotExist if the requested output port does not exist.

Invocation template:

getOutputPort@Runtime( request )( response )

Request type

Type: GetOutputPortRequest

type GetOutputPortRequest: void {
    .name: string
}

GetOutputPortRequest : void

  • name : string : The name of the output port

Response type

Type: GetOutputPortResponse

type GetOutputPortResponse: void {
    .protocol: string
    .name: string
    .location: string
}

GetOutputPortResponse : void

  • protocol : string : The protocol name of the output port
  • name : string : The name of the output port
  • location : string : The location of the output port

Possible faults thrown

Fault OutputPortDoesNotExist with type undefined

Fault-handling install template:

install ( OutputPortDoesNotExist => /* error-handling code */ )

dumpState

Operation documentation: Returns a pretty-printed string representation of the local state of the invoking Jolie process and the global state of this service.

Invocation template:

dumpState@Runtime( request )( response )

Request type

Type: void

void : void

Response type

Type: string

string : string

getLocalLocation

Operation documentation: Get the local in-memory location of this service.

Invocation template:

getLocalLocation@Runtime( request )( response )

Request type

Type: void

void : void

Response type

Type: any

any : any

getRedirection

Operation documentation: Get the output port name that a redirection points to.

Invocation template:

getRedirection@Runtime( request )( response )

Request type

Type: GetRedirectionRequest

type GetRedirectionRequest: void {
    .inputPortName: string
    .resourceName: string
}

GetRedirectionRequest : void

  • inputPortName : string : The target input port
  • resourceName : string : The resource name of the redirection to get

Response type

Type: MaybeString

type MaybeString: void | string

MaybeString :

  • : void
  • : string

setOutputPort

Operation documentation: Set an output port. If an output port with this name does not exist already, this operation creates it. Otherwise, the output port is replaced with this one.

Invocation template:

setOutputPort@Runtime( request )( response )

Request type

Type: SetOutputPortRequest

type SetOutputPortRequest: void {
    .protocol?: undefined
    .name: string
    .location: any
}

SetOutputPortRequest : void

  • protocol : string : The name of the protocol (e.g., sodep, http)
  • name : string : The name of the output port
  • location : any : The location of the output port

Response type

Type: void

void : void

halt

Operation documentation: Halts non-gracefully the execution of this service.

Invocation template:

halt@Runtime( request )( response )

Request type

Type: HaltRequest

type HaltRequest: void {
    .status?: int
}

HaltRequest : void

  • status : int : The status code to return to the execution environment

Response type

Type: void

void : void

callExit

Operation documentation: Stops gracefully the execution of this service. Calling this operation is equivalent to invoking the exit statement.

Invocation template:

callExit@Runtime( request )( response )

Request type

Type: any

any : any

Response type

Type: void

void : void

stats

Operation documentation: Returns information on the runtime state of the VM.

Invocation template:

stats@Runtime( request )( response )

Request type

Type: void

void : void

Response type

Type: Stats

type Stats: void {
    .os: void {
        .availableProcessors: int
        .systemLoadAverage: double
        .name: string
        .arch: string
        .version: string
    }
    .files: void {
        .openCount?: long
        .maxCount?: long
    }
}

Stats : void : Information on the interpreter execution so far

  • os : void : OS-related information
    • availableProcessors : int : Number of available processors
    • systemLoadAverage : double : System load average
    • name : string : Name of the OS
    • arch : string : Architecture
    • version : string : OS version
  • files : void : Information on file descriptors
    • openCount : long : Number of open files
    • maxCount : long : Maximum number of open files allowed for this VM

removeRedirection

Operation documentation: Remove a redirection at an input port

Invocation template:

removeRedirection@Runtime( request )( response )

Request type

Type: GetRedirectionRequest

type GetRedirectionRequest: void {
    .inputPortName: string
    .resourceName: string
}

GetRedirectionRequest : void

  • inputPortName : string : The target input port
  • resourceName : string : The resource name of the redirection to get

Response type

Type: void

void : void

Possible faults thrown

Fault RuntimeException with type RuntimeExceptionType

Fault-handling install template:

install ( RuntimeException => /* error-handling code */ )
type RuntimeExceptionType: JavaExceptionType

setMonitor

Operation documentation: Set the monitor for this service.

Invocation template:

setMonitor@Runtime( request )( response )

Request type

Type: SetMonitorRequest

type SetMonitorRequest: void {
    .protocol?: undefined
    .location: any
}

SetMonitorRequest : void

  • protocol : string : The protocol configuration for the monitor
  • location : any : The location of the monitor

Response type

Type: void

void : void

getProcessId

Operation documentation: Returns the internal identifier of the executing Jolie process.

Invocation template:

getProcessId@Runtime( request )( response )

Request type

Type: void

void : void

Response type

Type: string

string : string

getIncludePaths

Operation documentation: Get the include paths used by this interpreter

Invocation template:

getIncludePaths@Runtime( request )( response )

Request type

Type: void

void : void

Response type

Type: GetIncludePathResponse

type GetIncludePathResponse: void {
    .path*: string
}

GetIncludePathResponse : void

  • path : string : The include paths of the interpreter

getenv

Operation documentation: Returns the value of an environment variable.

Invocation template:

getenv@Runtime( request )( response )

Request type

Type: string

string : string

Response type

Type: MaybeString

type MaybeString: void | string

MaybeString :

  • : void
  • : string

Subtypes

JavaExceptionType

type JavaExceptionType: string { .stackTrace: string }