ColdBox Platform Version 2.6.3

coldbox.system.extras.lightwire
Class BaseConfigObject

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

public class BaseConfigObject
extends WEB-INF.cftags.component

A base configuration object for lightwire


Constructor Summary
init()
          I initialize default LightWire config properties.
 
Method Summary
 void addBean(string FullClassPath, [string BeanName=''], boolean Singleton, [string InitMethod=''], [boolean Lazy='[runtime expression]'], [string BeanType=''], [string Aliases=''])
          I add the configuration properties for a Singleton or Transient.
 void addBeanFromFactory(string FactoryBean, string FactoryMethod, string BeanName, any Singleton, [boolean Lazy='[runtime expression]'], [string BeanType=''])
          I add the configuration properties for a Singleton or Transient that is created by a factory to the config file.
 void addConstructorDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''])
          I add a constructor object dependency for a bean.
 void addConstructorProperty(string BeanName, string PropertyName, any PropertyValue, [string CastTo=''])
          I add a constructor property of any type to a bean.
 void addMixinDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''], [string Scope='variables'])
          I add a mixin dependency for a bean.
 void addMixinProperty(string BeanName, string PropertyName, any PropertyValue, [string Scope='variables'])
          I add a mixin property of any type to a bean.
 void addSetterDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''])
          I add a setter dependency for a bean.
 void addSetterProperty(string BeanName, string PropertyName, any PropertyValue, [string CastTo=''])
          I add a setter property of any type to a bean.
 void addSingleton(string FullClassPath, [string BeanName=''], [string InitMethod=''], [boolean Lazy='[runtime expression]'], [string BeanType=''], [string Aliases=''])
          I add the configuration properties for a Singleton.
 void addSingletonFromFactory(string FactoryBean, string FactoryMethod, string BeanName, [boolean Lazy='[runtime expression]'], [string BeanType=''])
          Adds the definition for a given Singleton that is created by a factory to the config file.
private void addToNonLazyBeans(any beanName)
          Add to non lazy beans struct
 void addTransient(string FullClassPath, [string BeanName=''], [string InitMethod=''], [string BeanType=''], [string Aliases=''])
          I add the configuration properties for a Transient.
 void addTransientFromFactory(string FactoryBean, string FactoryMethod, string BeanName, [string BeanType=''])
          Adds the definition for a given Transient that is created by a factory to the config file.
 struct getAliasStruct()
          Get the AliasStruct
private struct getBeanDefinition()
          Get a structure with a bean's definitions by default.
 struct getConfigStruct()
          I provide LightWire with the properly configured configuration struct to operate on.
 boolean getLazyLoad()
          I return whether Singletons should or shouldn't be lazy loaded.
 struct getNonLazyBeans()
          Get the non Lazy Beans
private any getUtil()
          Get the LightWire utility object: coldbox.system.extras.lightwire.util.Utility
private any nameResolution(any name)
          Get a bean name via alias or bean name
 void parseXMLConfigFile(string XMLFilePath, [struct properties='[runtime expression]'])
          I take the path to a ColdSpring XML config file and use it to set all of the necessary LightWire config properties.
 void parseXMLObj(xml XMLObj, [struct properties='[runtime expression]'])
          Parse an xml object definition, replacement of placeholders are done in the Raw or ConfiFile Methods Only
 void parseXMLRaw(string rawXML, [struct properties='[runtime expression]'])
          Parse an xml raw string
 void setConfigStruct(struct ConfigStruct)
          Set or override the configuration struct.
 void setLazyLoad(boolean LazyLoad)
          I set whether Singletons should or shouldn't be laxy loaded.
private void translateBean(any bean, struct properties)
          I translate ColdSpring XML bean definitiions to LightWire config.
private void translateBeanChildren(any bean, string childTagName, struct properties)
private string validateBeanType(string BeanType)
          Validate an incoming bean type
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init()

Method Detail

addBean

public void addBean(string FullClassPath, [string BeanName=''], boolean Singleton, [string InitMethod=''], [boolean Lazy='[runtime expression]'], [string BeanType=''], [string Aliases=''])
I add the configuration properties for a Singleton or Transient.

Parameters:
FullClassPath - The full class path to the bean including its name. E.g. for com.UserService.cfc it would be com.UserService.
BeanName - An optional name to be able to use to refer to this bean. If you don't provide this, the name of the bean will be used as a default. E.g. for com.UserService, it'll be named UserService unless you put something else here. If you put UserS, it'd be available as UserS, but NOT as UserService.
Singleton - Whether the bean is a Singleton (1) or Transient(0).
InitMethod - A default custom initialization method for LightWire to call on the bean after constructing it fully (including setter and mixin injection) but before returning it.
Lazy - Whether to construct at startup or not.
BeanType - The bean type: cfc, java, webservice
Aliases - A comma-delimmitted list of aliases for this bean

addBeanFromFactory

public void addBeanFromFactory(string FactoryBean, string FactoryMethod, string BeanName, any Singleton, [boolean Lazy='[runtime expression]'], [string BeanType=''])
I add the configuration properties for a Singleton or Transient that is created by a factory to the config file.

Parameters:
FactoryBean - The name of the factory to use to create this bean (the factory must also have been defined as a Singleton in the LightWire config file).
FactoryMethod - The name of the method to call on the factory bean to create this bean.
BeanName - The required name to use to refer to this bean.
Singleton - Whether the bean is a Singleton (1) or Transient(0).
Lazy - Whether to construct at startup or not.
BeanType - The bean type: cfc, java, webservice

addConstructorDependency

public void addConstructorDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''])
I add a constructor object dependency for a bean.

Parameters:
BeanName - The name of the bean to set the constructor dependencies for.
InjectedBeanName - The name of the bean to inject.
PropertyName - The optional property name to pass the bean into. Defaults to the bean name if not provided.

addConstructorProperty

public void addConstructorProperty(string BeanName, string PropertyName, any PropertyValue, [string CastTo=''])
I add a constructor property of any type to a bean.

Parameters:
BeanName - The name of the bean to add the property to.
PropertyName - The name of the property to set.
PropertyValue - The value of the property to set.
CastTo - Used for java objects. Cast this property using javacast(): boolean,int,long,float,double,string,null

addMixinDependency

public void addMixinDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''], [string Scope='variables'])
I add a mixin dependency for a bean.

Parameters:
BeanName - The name of the bean to set the mixin dependencies for.
InjectedBeanName - The name of the bean to inject.
PropertyName - The optional property name to pass the bean into. Defaults to the bean name if not provided.
Scope - The scope this dependency will be injected into. The default is variables scope

addMixinProperty

public void addMixinProperty(string BeanName, string PropertyName, any PropertyValue, [string Scope='variables'])
I add a mixin property of any type to a bean.

Parameters:
BeanName - The name of the bean to add the property to.
PropertyName - The name of the property to set.
PropertyValue - The value of the property to set.
Scope - The scope this property will be injected into. The default is variables scope

addSetterDependency

public void addSetterDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''])
I add a setter dependency for a bean.

Parameters:
BeanName - The name of the bean to set the setter dependencies for.
InjectedBeanName - The name of the bean to inject.
PropertyName - The optional property name to pass the bean into. Defaults to the bean name if not provided.

addSetterProperty

public void addSetterProperty(string BeanName, string PropertyName, any PropertyValue, [string CastTo=''])
I add a setter property of any type to a bean.

Parameters:
BeanName - The name of the bean to add the property to.
PropertyName - The name of the property to set.
PropertyValue - The value of the property to set.
CastTo - Used for java objects. Cast this property using javacast(): boolean,int,long,float,double,string,null

addSingleton

public void addSingleton(string FullClassPath, [string BeanName=''], [string InitMethod=''], [boolean Lazy='[runtime expression]'], [string BeanType=''], [string Aliases=''])
I add the configuration properties for a Singleton.

Parameters:
FullClassPath - The full class path to the bean including its name. E.g. for com.UserService.cfc it would be com.UserService.
BeanName - An optional name to be able to use to refer to this bean. If you don't provide this, the name of the bean will be used as a default. E.g. for com.UserService, it'll be named UserService unless you put something else here. If you put UserS, it'd be available as UserS, but NOT as UserService.
InitMethod - A default custom initialization method for LightWire to call on the bean after constructing it fully (including setter and mixin injection) but before returning it.
Lazy - Whether to construct at startup or not.
BeanType - The bean type: cfc, java, webservice
Aliases - A comma-delimmitted list of aliases for this bean

addSingletonFromFactory

public void addSingletonFromFactory(string FactoryBean, string FactoryMethod, string BeanName, [boolean Lazy='[runtime expression]'], [string BeanType=''])
Adds the definition for a given Singleton that is created by a factory to the config file.

Parameters:
FactoryBean - The name of the factory to use to create this bean (the factory must also have been defined as a Singleton in the LightWire config file).
FactoryMethod - The name of the method to call on the factory bean to create this bean.
BeanName - The required name to use to refer to this bean.
Lazy - Whether to construct at startup or not.
BeanType - The bean type: cfc, java, webservice

addToNonLazyBeans

private void addToNonLazyBeans(any beanName)
Add to non lazy beans struct

Parameters:
beanName - The bean name to add to the non lazy beans

addTransient

public void addTransient(string FullClassPath, [string BeanName=''], [string InitMethod=''], [string BeanType=''], [string Aliases=''])
I add the configuration properties for a Transient.

Parameters:
FullClassPath - The full class path to the bean including its name. E.g. for com.User.cfc it would be com.User.
BeanName - An optional name to be able to use to refer to this bean. If you don't provide this, the name of the bean will be used as a default. E.g. for com.User, it'll be named User unless you put something else here. If you put UserBean, it'd be available as UserBean, but NOT as User.
InitMethod - A default custom initialization method for LightWire to call on the bean after constructing it fully (including setter and mixin injection) but before returning it.
BeanType - The bean type: cfc, java, webservice
Aliases - A comma-delimmitted list of aliases for this bean

addTransientFromFactory

public void addTransientFromFactory(string FactoryBean, string FactoryMethod, string BeanName, [string BeanType=''])
Adds the definition for a given Transient that is created by a factory to the config file.

Parameters:
FactoryBean - The name of the factory to use to create this bean (the factory must also have been defined as a Singleton in the LightWire config file).
FactoryMethod - The name of the method to call on the factory bean to create this bean.
BeanName - The required name to use to refer to this bean.
BeanType - The bean type: cfc, java, webservice

getAliasStruct

public struct getAliasStruct()
Get the AliasStruct


getBeanDefinition

private struct getBeanDefinition()
Get a structure with a bean's definitions by default.


getConfigStruct

public struct getConfigStruct()
I provide LightWire with the properly configured configuration struct to operate on.


getLazyLoad

public boolean getLazyLoad()
I return whether Singletons should or shouldn't be lazy loaded.


getNonLazyBeans

public struct getNonLazyBeans()
Get the non Lazy Beans


getUtil

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


nameResolution

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

Parameters:
name - Bean name or alias to resolve.

parseXMLConfigFile

public void parseXMLConfigFile(string XMLFilePath, [struct properties='[runtime expression]'])
I take the path to a ColdSpring XML config file and use it to set all of the necessary LightWire config properties.

Parameters:
XMLFilePath - The path to the XML config file.
properties - A struct of default properties to be used in place of ${key} in XML config file.

parseXMLObj

public void parseXMLObj(xml XMLObj, [struct properties='[runtime expression]'])
Parse an xml object definition, replacement of placeholders are done in the Raw or ConfiFile Methods Only

Parameters:
XMLObj - The XML Object to parse.
properties - A struct of default properties to be used in place of ${key} in XML config file.

parseXMLRaw

public void parseXMLRaw(string rawXML, [struct properties='[runtime expression]'])
Parse an xml raw string

Parameters:
rawXML - A raw string of xml bean definitions
properties - A struct of default properties to be used in place of ${key} in XML config file.

setConfigStruct

public void setConfigStruct(struct ConfigStruct)
Set or override the configuration struct.

Parameters:
ConfigStruct

setLazyLoad

public void setLazyLoad(boolean LazyLoad)
I set whether Singletons should or shouldn't be laxy loaded.

Parameters:
LazyLoad - Whether or not to use lazy loading of Singletons.

translateBean

private void translateBean(any bean, struct properties)
I translate ColdSpring XML bean definitiions to LightWire config.

Parameters:
bean - The xml bean definition. This is an XML object
properties - The properties structure

translateBeanChildren

private void translateBeanChildren(any bean, string childTagName, struct properties)

Parameters:
bean - The xml bean definition object
childTagName - The child tag name to parse
properties - The properties structure

validateBeanType

private string validateBeanType(string BeanType)
Validate an incoming bean type

Parameters:
BeanType - The bean type: cfc, java, webservice

ColdBox Platform Version 2.6.3