ColdBox Platform Version 2.6.3

coldbox.system.extras.lightwire
Class LightWire

WEB-INF.cftags.component
        extended by coldbox.system.extras.lightwire.LightWire

public class LightWire
extends WEB-INF.cftags.component

I am the LightWire factory that creates all singleton and transient objects, injecting them with all of their necessary dependencies as defined in the configuration file.


Constructor Summary
init(any ConfigBean, [any parentFactory='[runtime expression]'])
          I initialize the LightWire object factory.
 
Method Summary
 boolean containsBean(string beanName)
          returns true if the BeanFactory and its hierarchy contains a bean definition that matches the given name
private any createNewObject(string ObjectName)
          I create an object or get it from a factory.
 any getBean(string ObjectName)
          I return a bean with all of its dependencies loaded from the factory hierarchy.
 struct getConfig()
          Get the config structure used in this factory.
private any getObject(string ObjectName, string ObjectType)
          I return a LightWire scoped object (Singleton or Transient) with all of its dependencies loaded.
 any getSingleton(string ObjectName, [boolean verifyCheck='true'])
          I return a LightWire scoped Singleton with all of its dependencies loaded from the local factory only. Please use getBean()
 string getSingletonKeyList()
          A list of all the cached singleton keys in the factory
 any getTransient(string ObjectName, [boolean verifyCheck='true'])
          I return a transient object from the local factory only. Please use getBean()
private any getUtil()
          Get the LightWire utility object: coldbox.system.extras.lightwire.util.Utility
 any getparentFactory()
          Get the parent factory for hierarchy operations. If the parent factory is not set, this method returns an empty structure.
private any invoker(any object, string method, [struct argCollection], [string argList])
          calls private/packaged/public methods
 void lightwireMixin(string ElementName, any ElementValue, [string ElementScope='variables'])
          I add the passed elements to the scope passed within this object. I am mixed in by LightWire to support mixin injection of dependencies and properties.
 boolean localFactoryContainsBean(string beanName)
          returns true if the local BeanFactory contains a bean definition that matches the given name
private void mixinSet(any object, any name, [boolean remove='false'])
          Start or Stop the Mixin Set
private any nameResolution(any name)
          Get a bean name via alias or bean name
 void setparentFactory(any parentFactory)
          Set in a parent factory to use for hierarchy operations
private any setterandMixinInject(string ObjectName, any Object)
          I handle setter and mixing injections to a bean.
private void verifyBean(string ObjectName)
          Verify a bean definition exists in hierarchy, else throw error
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(any ConfigBean, [any parentFactory='[runtime expression]'])

Method Detail

containsBean

public boolean containsBean(string beanName)
returns true if the BeanFactory and its hierarchy contains a bean definition that matches the given name

Parameters:
beanName - name of the bean to look for

createNewObject

private any createNewObject(string ObjectName)
I create an object or get it from a factory.

Parameters:
ObjectName - I am the name of the object to create.

getBean

public any getBean(string ObjectName)
I return a bean with all of its dependencies loaded from the factory hierarchy.

Parameters:
ObjectName - I am the name of the object to try to generate.

getConfig

public struct getConfig()
Get the config structure used in this factory.


getObject

private any getObject(string ObjectName, string ObjectType)
I return a LightWire scoped object (Singleton or Transient) with all of its dependencies loaded.

Parameters:
ObjectName - I am the name of the object to return.
ObjectType - I am the type of object to return (Singleton or Transient).

getSingleton

public any getSingleton(string ObjectName, [boolean verifyCheck='true'])
I return a LightWire scoped Singleton with all of its dependencies loaded from the local factory only. Please use getBean()

Parameters:
ObjectName - I am the name of the object to generate.
verifyCheck - Verify the bean config existence or not

getSingletonKeyList

public string getSingletonKeyList()
A list of all the cached singleton keys in the factory


getTransient

public any getTransient(string ObjectName, [boolean verifyCheck='true'])
I return a transient object from the local factory only. Please use getBean()

Parameters:
ObjectName - I am the name of the object to create.
verifyCheck - Verify the bean config existence or not

getUtil

private any getUtil()
Get the LightWire utility object: coldbox.system.extras.lightwire.util.Utility


getparentFactory

public any getparentFactory()
Get the parent factory for hierarchy operations. If the parent factory is not set, this method returns an empty structure.


invoker

private any invoker(any object, string method, [struct argCollection], [string argList])
calls private/packaged/public methods

Parameters:
object - The object to call a method on
method - Name of the private method to call
argCollection - Can be called with an argument collection struct
argList - Can be called with an argument list, for simple values only: ex: 'plugin=logger,number=1'

lightwireMixin

public void lightwireMixin(string ElementName, any ElementValue, [string ElementScope='variables'])
I add the passed elements to the scope passed within this object. I am mixed in by LightWire to support mixin injection of dependencies and properties.

Parameters:
ElementName - I am the name of the element to mix in.
ElementValue - I am the value of the element to mix in.
ElementScope - The scope to which inject the property to.

localFactoryContainsBean

public boolean localFactoryContainsBean(string beanName)
returns true if the local BeanFactory contains a bean definition that matches the given name

Parameters:
beanName - name of the bean to look for

mixinSet

private void mixinSet(any object, any name, [boolean remove='false'])
Start or Stop the Mixin Set

Parameters:
object - I am the object to inject dependencies into.
name - I am the object name.
remove - Remove or Add Mixins

nameResolution

private any nameResolution(any name)
Get a bean name via alias or bean name

Parameters:
name - Bean name or alias to resolve.

setparentFactory

public void setparentFactory(any parentFactory)
Set in a parent factory to use for hierarchy operations

Parameters:
parentFactory - The lightwire parent factory

setterandMixinInject

private any setterandMixinInject(string ObjectName, any Object)
I handle setter and mixing injections to a bean.

Parameters:
ObjectName - I am the name of the object to inject dependencies into.
Object - I am the object to inject dependencies into.

verifyBean

private void verifyBean(string ObjectName)
Verify a bean definition exists in hierarchy, else throw error

Parameters:
ObjectName - I am the name of the object to validate.

ColdBox Platform Version 2.6.3