WireBox : Dependency Injection & AOP
6.x
6.x
  • Introduction
  • Intro
    • Release History
      • What's New With 6.8.2
      • What's New With 6.8.0
      • What's New With 6.7.0
      • What's New With 6.6.0
      • What's New With 6.5.0
      • What's New With 6.4.0
      • What's New With 6.3.0
      • What's New With 6.2.0
      • What's New With 6.1.0
      • What's New With 6.0.0
    • About This Book
      • Author
  • Getting Started
    • Overview
    • Installing WireBox
    • Getting Jiggy Wit It!
      • Instance Creations
      • Binder Introduction
      • Scoping
      • Eager Init
      • How WireBox Resolves Dependencies
    • Migrating From ColdSpring
  • Configuration
    • Configuring WireBox
      • Binder Configuration Properties
      • Binder Environment Properties
      • ColdBox Enhanced Binder
      • Types & Scopes
      • Data Configuration Settings
      • Programmatic Configuration
    • Mapping DSL
      • Mapping Initiators
      • Mapping Destinations
      • MapDirectory() Influence & Filters
      • Persistence DSL
      • Dependencies DSL
        • Mapping Extra Attributes
      • Mapping DSL Examples
      • Influence Instances at Runtime
      • Processing Mappings
    • Component Annotations
      • Persistence Annotations
      • CacheBox Annotations
    • Parent Object Definitions
  • Usage
    • WireBox Injector
      • Injector Constructor Arguments
      • Injection Idioms
      • Common Methods
    • Injection DSL
      • ColdBox Namespace
      • CacheBox Namespace
      • EntityService Namespace
      • Executor Namespace
      • Java Namespace
      • LogBox Namespace
      • Models Namespace
      • Provider Namespace
      • WireBox Namespace
    • WireBox Event Model
      • WireBox Events
      • WireBox Listeners
        • ColdBox Mode Listener
        • Standalone Mode Listener
  • Advanced Topics
    • Child Injectors
    • Object Persistence & Thread Safety
    • ORM Entity Injection
    • Providers
      • Custom Providers
      • toProvider() closures
      • Virtual Provider Injection DSL
      • Virtual Provider Mapping
      • Virtual Provider Lookup Methods
      • Provider onMissingMethod Proxy
      • Scope Widening Injection
    • Runtime Mixins()
    • WireBox Object Populator
      • populateFromXML
      • populateFromQuery
      • populateFromStruct
      • populateFromQueryWithPrefix
      • populateFromJSON
    • Virtual Inheritance
  • Extending WireBox
    • Custom DSL
      • The DSL Builder Interface
      • Registering a Custom DSL
    • Custom Scopes
      • The Scope Interface
      • Scoping Process
      • Registering a Custom Scope
    • WireBox Injector Interface
  • Aspect Oriented Programming
    • AOP Intro
      • Overview
        • AOP Vocabulary
      • Activate The AOP Listener
      • Create Your Aspect
        • MethodInvocation Useful Methods
        • MethodLogger Aspect
      • Aspect Registration
      • Aspect Binding
      • Auto Aspect Binding
        • ClassMatcher Annotation DSL
        • MethodMatcher Annotation DSL
      • Included Aspects
        • CFTransaction
        • HibernateTransaction
        • MethodLogger
      • Summary
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Configuration
  2. Configuring WireBox

Programmatic Configuration

PreviousData Configuration SettingsNextMapping DSL

Last updated 3 years ago

Was this helpful?

Instead of declaring data structures you can use the methods in the binder to configure WireBox for operation. All methods return an instance of the binder so you can concatenate methods.

Method Signature

Description

cacheBox([configFile],[cacheFactory],[enabled],[classNamespace])

The method used to configure the injector's CacheBox integration. Ignored in an application context

listener(class,[properties],[name])

The method used to register a new listener within the injector's event manager

logBoxConfig(config)

The method used to tell the injector which configuration file to use for logging operations. Ignored in an application context

mapDSL(namespace,path)

The method used to register a new DSL annotation namespace with a DSL Builder object

mapScope(annotation,path)

The method used to register a new custom scope in this injector

parentInjector(injector)

Register a CFC reference to be the parent injector for the configuring injector

removeScanLocations(locations)

A method used to remove one or a list (array) of scan locations from the configuration binder

reset()

Reset the entire configuration binder to factory defaults

scanLocations(locations)

A method used to add one or a list (array) of scan locations to the configuration binder. If a path already exists it will not be appended again.

scopeRegistration(enabled,scope,key)

This method is used to tell the Injector if it should auto-register itself in any ColdFusion scope automatically

stopRecursions(classes)

A method used to register one or a list (array) of class paths the injector will look out for when discovering DI metadata. If these classes are found in the inheritance chain of an object, the injector will not process that inherited chain

logBoxConfig( "config.LogBox" )
    .scanLocations( getAppMapping() & ".includes.models" )
    .stopRecursions( "model.BaseService,model.BaseModel" )
    .mapScope( "Ortus", "model.scopes.Ortus" );
LogBox