lucee.Componentcommandbox.system.services.ServerService
Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I manage servers
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
CR
|
true
|
false
|
|
any
|
JSONService
|
true
|
false
|
|
any
|
ansiFormater
|
true
|
false
|
|
any
|
configService
|
true
|
false
|
|
any
|
consoleLogger
|
true
|
false
|
|
any
|
customServerDirectory
Where custom servers are stored.
|
true
|
false
|
|
any
|
interceptorService
|
true
|
false
|
|
any
|
jarPath
Where the Run War jar path is.
|
true
|
false
|
|
any
|
javaCommand
Where the Java Command Executable is.
|
true
|
false
|
|
any
|
javaService
|
true
|
false
|
|
any
|
libDir
Where the server libs are located.
|
true
|
false
|
|
any
|
packageService
|
true
|
false
|
|
any
|
parser
|
true
|
false
|
|
any
|
printUtil
|
true
|
false
|
|
any
|
rewritesDefaultConfig
|
true
|
false
|
|
any
|
serverConfig
Where the server configuration file is.
|
true
|
false
|
|
any
|
serverEngineService
|
true
|
false
|
|
any
|
systemSettings
|
true
|
false
|
|
any
|
wirebox
|
true
|
false
|
Constructor Summary | |
---|---|
init(any shell, any formatter, any fileSystem, any homeDir, any consoleLogger, any logger)
Constructor. |
Method Summary | |
---|---|
array
|
appendMenuItems([array trayOptions], [any relativePath], [array parentOptions])
allows to iterate on a tray menu item recursively. |
any
|
completeProperty(any directory, [any all='false'], [any asSet='false'])
Dynamic completion for property name based on contents of server. |
any
|
convertHeapToMB([any heapSize])
Convert heap in format like 1G to 1024. |
any
|
fixBinaryPath([any command], [any fullPath])
|
any
|
forget(struct serverInfo)
Forget server from the configurations. |
string
|
getAnsiFormater()
|
string
|
getCR()
|
string
|
getConfigService()
|
string
|
getConsoleLogger()
|
string
|
getCustomServerDirectory()
|
any
|
getCustomServerFolder(struct serverInfo)
Get a custom server folder name according to our naming convention to avoid collisions with name. |
any
|
getDefaultServerJSON()
|
string
|
getInterceptorService()
|
string
|
getJSONService()
|
string
|
getJarPath()
|
string
|
getJavaCommand()
|
string
|
getJavaService()
|
string
|
getLibDir()
|
string
|
getPackageService()
|
string
|
getParser()
|
string
|
getPrintUtil()
|
any
|
getRandomPort([any host='127.0.0.1'])
Get a random port for the specified host. |
string
|
getRewritesDefaultConfig()
|
string
|
getServerConfig()
|
string
|
getServerEngineService()
|
struct
|
getServerInfo(any webroot, any name)
Get server info for webroot. |
struct
|
getServerInfoByDiscovery(any directory='', any name='', [any serverConfigFile=''])
Get a server information struct by name or directory. |
struct
|
getServerInfoByName(any name)
Get a server information struct by name, if not found it returns an empty struct. |
struct
|
getServerInfoByServerConfigFile(any serverConfigFile)
Get a server information struct by serverConfigFile if not found it returns an empty struct. |
struct
|
getServerInfoByWebroot(any webroot)
Get a server information struct by webrot, if not found it returns an empty struct. |
array
|
getServerNames()
Get all servers registered as an array of names. |
struct
|
getServers()
get servers struct from config file on disk. |
string
|
getSystemSettings()
|
string
|
getWirebox()
|
any
|
initServers()
Create initial server JSON. |
any
|
isHeapLarger([any heapSize1], [any heapSize2])
Detects if the first heap size is larger than the second. |
any
|
isPortAvailable([any host='127.0.0.1'], any port)
Find out if a given host/port is already bound. |
any
|
isServerRunning(struct serverInfo)
Logic to tell if a server is running. |
struct
|
newServerInfoStruct()
Returns a new server info structure. |
any
|
normalizeWebroot(string webroot)
|
any
|
onDIComplete()
|
any
|
prepareMenuItem([any menuItem], [any relativePath])
checks for the default image and default shell. |
struct
|
readServerJSON(string path)
Read a server. |
any
|
resolveServerDetails(struct serverProps)
Unified logic to resolve a server given an optional name, directory, and server. |
any
|
saveServerJSON(string configFilePath, struct data)
Save a server. |
any
|
setAnsiFormater(any ansiFormater)
|
any
|
setCR(any CR)
|
any
|
setConfigService(any configService)
|
any
|
setConsoleLogger(any consoleLogger)
|
any
|
setCustomServerDirectory(any customServerDirectory)
|
any
|
setInterceptorService(any interceptorService)
|
any
|
setJSONService(any JSONService)
|
any
|
setJarPath(any jarPath)
|
any
|
setJavaCommand(any javaCommand)
|
any
|
setJavaService(any javaService)
|
any
|
setLibDir(any libDir)
|
any
|
setPackageService(any packageService)
|
any
|
setParser(any parser)
|
any
|
setPrintUtil(any printUtil)
|
any
|
setRewritesDefaultConfig(any rewritesDefaultConfig)
|
any
|
setServerConfig(any serverConfig)
|
any
|
setServerEngineService(any serverEngineService)
|
any
|
setServerInfo(struct serverInfo)
persist server info. |
ServerService
|
setServers(Struct servers)
persist servers. |
any
|
setSystemSettings(any systemSettings)
|
any
|
setWirebox(any wirebox)
|
any
|
start([Struct serverProps])
Start a server instance. |
struct
|
stop(struct serverInfo)
Stop server. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
shell
formatter
fileSystem
homeDir
consoleLogger
logger
Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyinject
- CR@constantsserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- JSONServiceserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- AnsiFormaterserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- ConfigServiceserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- logbox:logger:consoleserializable
- trueWhere custom servers are stored
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- interceptorServiceserializable
- trueWhere the Run War jar path is
access
- publicrequired
- falsereturntype
- anyserializable
- trueWhere the Java Command Executable is
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- provider:javaServiceserializable
- trueWhere the server libs are located
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- packageServiceserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- parserserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- printserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- rewritesDefaultConfig@constantsserializable
- trueWhere the server configuration file is
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- serverEngineServiceserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- SystemSettingsserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- wireboxserializable
- trueMethod Detail |
---|
allows to iterate on a tray menu item recursively and checks for the default image and default shell
trayOptions
relativePath
parentOptions
Dynamic completion for property name based on contents of server.json
directory
- web rootall
- Pass false to ONLY suggest existing setting names. True will suggest all possible settings.asSet
- Pass true to add = to the end of the optionsConvert heap in format like 1G to 1024 Will always return MB, but without the "m"
heapSize
command
fullPath
Forget server from the configurations
serverInfo
- struct of server info (ports, etc.)Get a custom server folder name according to our naming convention to avoid collisions with name
serverInfo
- The server informationGet a random port for the specified host
host
- host to get port on, defaults 127.0.0.1Get server info for webroot
webroot
- root directory for served contentname
Get a server information struct by name or directory. Returns empty struct if not found.
directory
- the directory to findname
- The name to findserverConfigFile
Get a server information struct by name, if not found it returns an empty struct
name
- The name to findGet a server information struct by serverConfigFile if not found it returns an empty struct
serverConfigFile
Get a server information struct by webrot, if not found it returns an empty struct
webroot
- The webroot to findGet all servers registered as an array of names
get servers struct from config file on disk
Create initial server JSON
Detects if the first heap size is larger than the second
heapSize1
- Specified as 1024m, 2G, or 512kheapSize2
- Specified as 1024m, 2G, or 512kFind out if a given host/port is already bound
host
- host to test port on, defaults 127.0.0.1port
Logic to tell if a server is running
serverInfo
- Struct of server informationReturns a new server info structure
webroot
checks for the default image and default shell
menuItem
relativePath
Read a server.json file. If it doesn't exist, returns an empty struct This only returns properties specifically set in the file.
path
Unified logic to resolve a server given an optional name, directory, and server.json path. Returns resolved name, webroot, serverConfigFile, serverInfo from the last start and serverJSON Use this for all 'server' commands that let a user specify the server they want by convention (CWD), name, directory, or server.json path. - defaultName - defaultwebroot - defaultServerConfigFile - serverJSON - serverInfo - serverIsNew
serverProps
- A struct that can contains name, directory, and/or serverConfigFileSave a server.json file.
configFilePath
data
ansiFormater
CR
configService
consoleLogger
customServerDirectory
interceptorService
JSONService
jarPath
javaCommand
javaService
libDir
packageService
parser
printUtil
rewritesDefaultConfig
serverConfig
serverEngineService
persist server info
serverInfo
- struct of server info (ports, etc.)persist servers
servers
- struct of serverInfossystemSettings
wirebox
Start a server instance
serverProps
- A struct of settings to influence how to start the server. Params not provided by the user are null.Stop server
serverInfo
- The server information struct: [ webroot, name, port, stopSocket, logDir, status, statusInfo ]