Package ortus.boxlang.runtime.config
Class Configuration
java.lang.Object
ortus.boxlang.runtime.config.Configuration
- All Implemented Interfaces:
IConfigSegment
The BoxLang configuration object representing the core configuration.
This object is responsible for processing the configuration struct and returning a new configuration object based on the overrides.
Each segment is processed individually from the initial configuration struct.
The configuration object can be converted to a struct for serialization.
It also contains the original configuration struct for reference.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe application timeout0
means no timeout and is the defaultCache registrationsThe directory where the generated classes will be placed The default is the system temp directory +/boxlang
An array of directories where custom tags are located and loaded from.Global datasource registrationsThe debug mode flag which turns on all kinds of debugging informationfalse
by defaultDefault cache registrationDefault datasource registrationA collection of all the registered global executorsInvoke implicit getters and setters when using the implicit accessortrue
by defaultAn array of directories where jar files will be loaded from at runtime.The default locale to use for the runtime Uses the default system locale if not setThe default logs directory for the runtimeA sorted struct of mappingsThe modules configurationAn array of directories where modules are located and loaded from.The last config struct loadedThe request timeout0
means no timeout and is the defaultThis flag enables/disables session management in the runtime for all applications by default.The default session storage cache.The session timeout30
minutes by defaultThis determines whether to send CFID and CFTOKEN cookies to the client browser.Sets CFID and CFTOKEN cookies for a domain (not a host) Required, for applications running on clusterstrue
by defaultThe Timezone to use for the runtime; Uses the Java Timezone format:America/New_York
Uses the default system timezone if not set -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasStruct()
Returns the configuration as a struct with all the static typed segments and theoriginalConfig
as a segment as well.URL[]
Get the java library paths as an array of URLs of Jar files This is usually called by the runtime to load all the JARs in the paths to the runtime classloaderString[]
Get all the mappings back as an array of strings in their length orderboolean
hasMapping
(String mapping) Verify if a mapping existsboolean
hasMapping
(Key mapping) Verify if a mapping existsNavigate the configuration with our cool DataNavigator! For example, if you want to navigate the original config:Processes a configuration struct and returns a new configuration object based on the overrides.registerMapping
(String mapping, String path) Register a mapping in the runtime configurationregisterMapping
(Key mapping, String path) Register a mapping in the runtime configurationboolean
unregisterMapping
(String mapping) Unregister a mapping in the runtime configurationboolean
unregisterMapping
(Key mapping) Unregister a mapping in the runtime configuration using aKey
void
Helper method to validate datasource drivers configured in the runtime configuration This makes sure all declared drivers are registered with the datasource service
-
Field Details
-
classGenerationDirectory
The directory where the generated classes will be placed The default is the system temp directory +/boxlang
-
debugMode
The debug mode flag which turns on all kinds of debugging informationfalse
by default -
timezone
The Timezone to use for the runtime; Uses the Java Timezone format:America/New_York
Uses the default system timezone if not set -
locale
The default locale to use for the runtime Uses the default system locale if not set -
invokeImplicitAccessor
Invoke implicit getters and setters when using the implicit accessortrue
by default -
applicationTimeout
The application timeout0
means no timeout and is the default -
requestTimeout
The request timeout0
means no timeout and is the default -
sessionTimeout
The session timeout30
minutes by default -
sessionManagement
This flag enables/disables session management in the runtime for all applications by default.false
by default -
sessionStorage
The default session storage cache. This has to be the name of a registered cache or the keyword "memory" which indicates our internal cache.memory
is the default -
setClientCookies
This determines whether to send CFID and CFTOKEN cookies to the client browser.true
by default -
setDomainCookies
Sets CFID and CFTOKEN cookies for a domain (not a host) Required, for applications running on clusterstrue
by default -
mappings
A sorted struct of mappings -
modulesDirectory
An array of directories where modules are located and loaded from.[ /{boxlang-home}/modules ]
-
logsDirectory
The default logs directory for the runtime -
customTagsDirectory
An array of directories where custom tags are located and loaded from.[ /{boxlang-home}/customTags ]
-
javaLibraryPaths
An array of directories where jar files will be loaded from at runtime. -
caches
Cache registrations -
defaultDatasource
Default datasource registration -
datasources
Global datasource registrations -
defaultCache
Default cache registration -
modules
The modules configuration -
originalConfig
The last config struct loaded -
executors
A collection of all the registered global executors
-
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
process
Processes a configuration struct and returns a new configuration object based on the overrides. This method makes sure all elements in the incoming configuration struct are processed and applied to the configuration object.- Specified by:
process
in interfaceIConfigSegment
- Parameters:
config
- the configuration struct- Returns:
- The new configuration object based on the core + overrides
-
getRegisteredMappings
Get all the mappings back as an array of strings in their length order- Returns:
- The mappings as an array of strings
-
hasMapping
Verify if a mapping exists- Parameters:
mapping
- The mapping to verify:/myMapping
, please note the leading slash- Returns:
- True if the mapping exists, false otherwise
-
hasMapping
Verify if a mapping exists- Parameters:
mapping
- The mapping to verify:/myMapping
, please note the leading slash- Returns:
- True if the mapping exists, false otherwise
-
registerMapping
Register a mapping in the runtime configuration- Parameters:
mapping
- The mapping to register:/myMapping
, please note the leading slashpath
- The absolute path to the directory to map to the mapping- Returns:
- The runtime configuration
- Throws:
BoxRuntimeException
- If the path does not exist
-
registerMapping
Register a mapping in the runtime configuration- Parameters:
mapping
- The mapping to register:/myMapping
, please note the leading slashpath
- The absolute path to the directory to map to the mapping- Returns:
- The runtime configuration
- Throws:
BoxRuntimeException
- If the path does not exist
-
unregisterMapping
Unregister a mapping in the runtime configuration- Parameters:
mapping
- The String mapping to unregister:/myMapping
, please note the leading slash- Returns:
- True if the mapping was removed, false otherwise
-
unregisterMapping
Unregister a mapping in the runtime configuration using aKey
- Parameters:
mapping
- The Key mapping to unregister:/myMapping
, please note the leading slash- Returns:
- True if the mapping was removed, false otherwise
-
getJavaLibraryPaths
Get the java library paths as an array of URLs of Jar files This is usually called by the runtime to load all the JARs in the paths to the runtime classloader- Returns:
- The java library paths as an array of Jar/class URLs
- Throws:
BoxIOException
- If a path is not a valid path
-
validateDatsourceDrivers
public void validateDatsourceDrivers()Helper method to validate datasource drivers configured in the runtime configuration This makes sure all declared drivers are registered with the datasource service- Throws:
BoxRuntimeException
- If a datasource driver is not registered with the datasource service
-
asStruct
Returns the configuration as a struct with all the static typed segments and theoriginalConfig
as a segment as well.- Specified by:
asStruct
in interfaceIConfigSegment
- Returns:
- A struct representation of the configuration segment
-