BoxLang: Our new JVM Dynamic Language made by Ortus! Check it out: https://www.boxlang.io

Issues

Select view

Select search mode

 

Wirebox - add onInjectorMissingDependency event

Fixed

Description

A new event called onInjectorMissingDependency is now registered in Wirebox. It will be called whenever a dependency cannot be located. The data will also include the following:

  • name - The name of the requested dependency

  • initArguments - The init arguments if passed

  • targetObject - The target object that requested the dependency

  • injector - The injector in use building the dependency

If you return in the data struct an element called instance we will return that back as the dependency, else the normal exception will be thrown.

Motivation:

I want to use modules in a legacy app. Several of these modules have dependencies on ColdBox for things like interceptors etc. As I'm in the context of a legacy app I would like to be able to use a convention-based bean factory hook which will be called when a dependency is not found.

My thought here is that in the Custom Binder you could have a onMissingDependency method which is called whenever the autowire fails to find a dependency. Something like this:

Hope this is the right place to log this

Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Priority

Sentry

Created December 1, 2019 at 8:38 PM
Updated March 4, 2023 at 4:34 PM
Resolved March 4, 2023 at 4:34 PM

Activity

Show:

Brad WoodDecember 2, 2019 at 7:29 PM

Moved to the WireBox project