ServiceContext

Defines service context.

Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def addService(definition: ServiceDefinition): Unit

Adds service to service context.

Adds service to service context.

Value Params
definition

service definition

Throws
ServiceAlreadyExists

if service already exists

def classLoader: ClassLoader

Gets class loader.

Gets class loader.

def getServiceDefinition(name: String): Option[ServiceDefinition]

Gets service definition.

Gets service definition.

Value Params
name

service name

def getServiceState(name: String): Option[ServiceState]

Gets service state.

Gets service state.

Value Params
name

service name

def removeService(name: String): Unit

Removes service from service context.

Removes service from service context.

Value Params
name

service name

Throws
ServiceNotFound

if service does not exist

ServiceStateError

if service is active

def restartService(name: String): Unit

Restarts service in service context.

Restarts service in service context.

Value Params
name

service name

Throws
ServiceNotFound

if service does not exist

def serviceNames: Set[String]

Gets services names.

Gets services names.

def startService(name: String): Boolean

Starts service in service context.

Starts service in service context.

Value Params
name

service name

Returns

true if service is started or false if service was already active

Throws
ServiceNotFound

if service does not exist

def stopService(name: String): Boolean

Stops service in service context.

Stops service in service context.

Value Params
name

service name

Returns

true if service is stopped or false if service was already inactive

Throws
ServiceNotFound

if service does not exist

Concrete methods

def addService(name: String, className: String, configuration: JsonObject): Unit

Adds service to service context.

Adds service to service context.

Value Params
className

fully qualified service class name

configuration

service configuration

name

service name

Throws
ServiceAlreadyExists

if service already exists