coldbox.system.ioc

Interface IInjector

coldbox.system.ioc.IInjector
Class Attributes:
None
All Known Implementing Classes:
Injector

An interface that enables any CFC to act like a parent injector within WireBox

Method Summary
any<boolean> containsInstance(any name)
     Checks if this injector can locate a model instance or not.
any getInstance([any name], [any dsl], [any<struct> initArguments], [any targetObject])
     Locates, Creates, Injects and Configures an object model instance.
any<Injector> getParent()
     Get a reference to the parent injector instance, else an empty simple string meaning nothing is set.
void setParent(any<Injector> injector)
     Link a parent Injector with this injector.
void shutdown()
     Shutdown the injector gracefully by calling the shutdown events internally.

Method Detail

containsInstance

public any<boolean> containsInstance(any name)

Checks if this injector can locate a model instance or not

Parameters:
name - The object name or alias to search for if this container can locate it or has knowledge of it

getInstance

public any getInstance([any name], [any dsl], [any<struct> initArguments], [any targetObject])

Locates, Creates, Injects and Configures an object model instance

Parameters:
name - The mapping name or CFC instance path to try to build up
dsl - The dsl string to use to retrieve the instance model object, mutually exclusive with 'name'
initArguments - The constructor structure of arguments to passthrough when initializing the instance
targetObject - The object requesting the dependency, usually only used by DSL lookups

getParent

public any<Injector> getParent()

Get a reference to the parent injector instance, else an empty simple string meaning nothing is set


setParent

public void setParent(any<Injector> injector)

Link a parent Injector with this injector

Parameters:
injector - A WireBox Injector to assign as a parent to this Injector

shutdown

public void shutdown()

Shutdown the injector gracefully by calling the shutdown events internally.