boxlang-core-dev-runtime-architecturelisted
Install: claude install-skill ortus-boxlang/skills
# BoxLang Runtime Architecture
## Overview
BoxLang is a dynamic JVM language (JRE 21+) that compiles source to Java bytecode
at runtime. The central singleton `BoxRuntime` acts as a service locator providing
access to all core services. Understanding the architecture is essential for building
modules, BIFs, interceptors, and custom language extensions.
## BoxRuntime — The Central Singleton
```java
import ortus.boxlang.runtime.BoxRuntime;
// Get the singleton instance
BoxRuntime runtime = BoxRuntime.getInstance();
// Start programmatically (e.g., in tests or embedding scenarios)
BoxRuntime runtime = BoxRuntime.getInstance( true ); // true = start immediately
// Core service accessors
runtime.getInterceptorService() // Event system
runtime.getModuleService() // Module management
runtime.getCacheService() // Cache providers
runtime.getAsyncService() // Executors, futures
runtime.getSchedulerService() // Cron scheduling
runtime.getDataSourceService() // JDBC connections
runtime.getFunctionService() // BIF registry
runtime.getComponentService() // Component/tag registry
runtime.getClassLocator() // Class resolution
runtime.getConfiguration() // Runtime config
runtime.getTypeService() // Type system
```
## Key Services
### InterceptorService
Manages the global event bus. See `interceptors` skill for full details.
```java
InterceptorService svc = runtime.getInterceptorService();
svc.announce( Key