Class Instance Events
Interception points announced when a BoxLang class instance is created and initialized
These events fire when a BoxLang class is instantiated through new, createObject(), deserialization, or any other path that bootstraps a BoxLang class. They are announced on the global interceptor pool and are available starting in BoxLang 1.18.0.
Use them for dependency injection, auditing, observability, and AOP-style decoration of class instances.
afterBoxClassCreation
No
The instance is fully defined (pseudo-constructor ran, interfaces and abstract methods validated) but init() has not run.
afterBoxClassInit
No
init() (or the implicit constructor) has completed.
afterBoxClassCreation
Fired after the class instance is fully defined but before init() is called. The pseudo-constructor has run, and interfaces and abstract methods have been validated.
It also fires for
noInitcreations such ascreateObject()and deserialization, whereinit()is never called. Check thenoInitkey to tell them apart.It never fires for super classes in an
extendschain, only for the concrete instance being created.
Data Structure
instance
IClassRunnable
The BoxLang class instance.
className
String
The name of the class.
noInit
Boolean
true when init() will be skipped for this instance.
context
IBoxContext
The context the class is being created in.
Example
afterBoxClassInit
Fired after init() (or the implicit constructor) completes.
It does not fire for
noInitcreations, sinceinit()never runs.It does not fire when
init()throws an exception.
Data Structure
instance
IClassRunnable
The BoxLang class instance.
result
Object
What construction returned: the instance, or whatever a non-null init() returned.
className
String
The name of the class.
context
IBoxContext
The context the class is being created in.
Example
Last updated
Was this helpful?
