box.system.ioc.config.concurrent.Callable interface">
|
ColdBox Platform Version 3.0.0 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
coldbox.system.ioc.config.Binder
public class Binder
This is a WireBox configuration binder object. You can use it to configure a WireBox injector instance using our WireBox Mapping DSL
| Constructor Summary | |
|---|---|
init(any<Injector> injector, [any config], [any<struct> properties='[runtime expression]'])
Constructor: You can pass a data CFC instance, data CFC path or nothing at all for purely programmatic configuration |
|
| Method Summary | |
|---|---|
any |
asEagerInit()
If this method is called, the mapped object will be created once the injector starts up |
any |
asSingleton()
Map as a singleton, shortcut to using 'in( this |
any |
cacheBox([any configFile=''], [any cacheFactory=''], [any<Boolean> enabled='true'], [any classNamespace='[runtime expression]'])
Integrate with CacheBox |
any |
configure()
The main configuration method that must be overriden by a specific WireBox Binder configuration object |
any |
constructor(any constructor)
You can choose what method will be treated as the constructor |
any |
getAppMapping()
Get the ColdBox app mapping variable if context linked |
any<Struct> |
getCacheBoxConfig()
Get the CacheBox Configuration Integration structure |
any<Controller> |
getColdBox()
Get the bounded ColdBox context for this binder, if any |
any |
getCurrentMapping()
Get the current set mapping (UTILITY method) |
any<struct> |
getCustomDSL()
Get the custom dsl namespace registration structure |
struct |
getCustomScopes()
Get the registered custom scopes |
any<Struct> |
getDefaults()
Get the default WireBox settings structure |
any<Injector> |
getInjector()
Get the bounded injector for this binder |
any<Array> |
getListeners()
Get the configured listeners array |
any |
getLogBoxConfig()
Get the logBox Configuration file to use |
any<Mapping> |
getMapping(any name)
Get a specific object mapping: coldbox |
any<struct> |
getMappings()
Get all the registered object mappings structure |
any<Struct> |
getMemento()
Get the instance data structure |
any |
getParentInjector()
Get the parent injector reference this binder is linked to |
any<struct> |
getProperties()
Get the binded properties structure |
any |
getProperty(any name, [any default])
Get a binded property |
any<java.util.LinkedHashMap> |
getScanLocations()
Get the linked map of package scan locations for CFCs |
any<Struct> |
getScopeRegistration()
Get the scope registration details structure |
any<Array> |
getStopRecursions()
Get all the stop recursion classes array |
any |
inCacheBox([any key=''], [any timeout=''], [any lastAccessTimeout=''], [any provider='default'])
Map an object into CacheBox |
any |
initArg([any name], [any ref], [any dsl], [any value], [any javaCast])
Map a constructor argument to a mapping |
any |
initWith()
Positional or named value arguments to use when initializing the mapping |
any |
into(any scope)
Map an object into a specific persistence scope |
any |
listener(any class, [any<Struct> properties='[runtime expression]'], [any name=''])
Add a new listener configuration |
void |
loadDataDSL([any<struct> rawDSL])
Load a data configuration CFC data DSL |
any |
logBoxConfig(any config)
Set the logBox Configuration to use |
any |
map(any alias)
Create a mapping to an object |
any |
mapDSL(any namespace, any path)
Register a new custom dsl namespace |
any |
mapDirectory(any packagePath)
Maps an entire instantiation path directory, please note that the unique name of each file will be used and also processed for alias inspection |
any |
mapPath(any path)
Directly map to a path by using the last part of the path as the alias |
any |
mapScope(any annotation, any path)
Register a new WireBox custom scope |
any<Boolean> |
mappingExists(any name)
Check if an object mapping exists |
any |
methodArg([any name], [any ref], [any dsl], [any value], [any javaCast])
Map a method argument to a factory method |
any |
noAutowire()
If you call this method on an object mapping, the object will NOT be inspected for injection/wiring metadata, it will use ONLY whatever you define in the mapping |
any |
noInit()
If you call this method on an object mapping, the object's constructor will not be called |
any |
onDIComplete(any methods)
The methods to execute once DI completes on the mapping |
any |
parentInjector(any injector)
Link a parent injector to this configuration binder |
any |
processMappings()
Process all registered mappings, called by injector when ready to start serving requests |
any |
property(any name, [any ref], [any dsl], [any value], [any javaCast], [any scope='variables'])
Map a cfproperty to a mapping |
boolean |
propertyExists(any name)
Checks if a property exists |
void |
removeScanLocations(any locations)
Try to remove all the scan locations passed in |
void |
reset()
Reset the configuration back to the original binder defaults |
any |
scanLocations(any locations)
Register one or more package scan locations for CFC lookups |
any |
scopeRegistration([any<Boolean> enabled='[runtime expression]'], [any scope='[runtime expression]'], [any key='[runtime expression]'])
Use to define injector scope registration |
any |
setProperties(any<struct> properties)
Set the binded properties structure |
void |
setProperty(any name, any value)
Create a new binding property |
any |
setter(any name, [any ref], [any dsl], [any value], [any javaCast])
Map a setter function to a mapping |
any |
stopRecursions(any classes)
Configure the stop recursion classes |
any |
to(any path)
Map to a destination CFC class path |
any |
toDSL(any dsl)
Map to a dsl that will be used to create the mapped object |
any |
toFactoryMethod(any factory, any method)
Map to a factory and its executing method |
any |
toJava(any path)
Map to a java destination class path |
any |
toProvider(any provider)
Map to a provider object that must implement coldbox |
any |
toRSS(any path)
Map to a rss destination class path |
any |
toValue(any value)
Map to a constant value |
any |
toWebservice(any path)
Map to a webservice destination class path |
any |
with(any alias)
Used to set the current working mapping name in place for the maping DSL |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init(any<Injector> injector, [any config], [any<struct> properties='[runtime expression]'])
injector - The Injector this binder is bound toconfig - The WireBox Injector Data Configuration CFC instance or instantiation path to it. Leave blank if using this configuration object programaticallyproperties - A structure of binding properties to passthrough to the Binder Configuration CFC| Method Detail |
|---|
public any asEagerInit()
public any asSingleton()
public any cacheBox([any configFile=''], [any cacheFactory=''], [any<Boolean> enabled='true'], [any classNamespace='[runtime expression]'])
configFile - The configuration file to use for loading CacheBox if creating it.cacheFactory - The CacheBox cache factory instance to link WireBox toenabled - Enable or Disable CacheBox Integration, if you call this method then enabled is set to true as most likely you are trying to enable itclassNamespace - The package namespace to use for creating or connecting to CacheBox. Defaults to: coldbox.system.cachepublic any configure()
public any constructor(any constructor)
constructor - The constructor method to use for the mapped objectpublic any getAppMapping()
public any<Struct> getCacheBoxConfig()
public any<Controller> getColdBox()
public any getCurrentMapping()
public any<struct> getCustomDSL()
public struct getCustomScopes()
public any<Struct> getDefaults()
public any<Injector> getInjector()
public any<Array> getListeners()
public any getLogBoxConfig()
public any<Mapping> getMapping(any name)
name - The name of the mapping to retrievepublic any<struct> getMappings()
public any<Struct> getMemento()
public any getParentInjector()
public any<struct> getProperties()
public any getProperty(any name, [any default])
name - The name of the propertydefault - A default value if property does not existpublic any<java.util.LinkedHashMap> getScanLocations()
public any<Struct> getScopeRegistration()
public any<Array> getStopRecursions()
public any inCacheBox([any key=''], [any timeout=''], [any lastAccessTimeout=''], [any provider='default'])
key - You can override the key it will use for storing in cache. By default it uses the name of the mapping.timeout - Object Timeout, else defaults to whatever the default is in the choosen cachelastAccessTimeout - Object Timeout, else defaults to whatever the default is in the choosen cacheprovider - Uses the 'default' cache provider by defaultpublic any initArg([any name], [any ref], [any dsl], [any value], [any javaCast])
name - The name of the constructor argument. NA: JAVA-WEBSERVICEref - The reference mapping id this constructor argument maps todsl - The construction dsl this argument references. If used, the name value must be used.value - The value of the constructor argument, if passed.javaCast - The type of javaCast() to use on the value of the argument. Only used if using dsl or ref argumentspublic any initWith()
public any into(any scope)
scope - The scope to map to, use a valid WireBox Scope by using binder.SCOPES.* or a custom scopepublic any listener(any class, [any<Struct> properties='[runtime expression]'], [any name=''])
class - The class of the listenerproperties - The structure of properties for the listnername - The name of the listenerpublic void loadDataDSL([any<struct> rawDSL])
rawDSL - The data configuration DSL structure to load, else look internallypublic any logBoxConfig(any config)
config - The configuration file to usepublic any map(any alias)
alias - A single alias or a list or an array of aliases for this mapping. Remember an object can be refered by many namespublic any mapDSL(any namespace, any path)
namespace - The namespace you would like to registerpath - The instantiation path to the CFC that implements this scope, it must have an init() method and implement: coldbox.system.ioc.dsl.IDSLBuilderpublic any mapDirectory(any packagePath)
packagePath - The instantiation packagePath to mappublic any mapPath(any path)
path - The class path to the object to mappublic any mapScope(any annotation, any path)
annotation - The unique scope name to register. This translates to an annotation value on CFCspath - The path to the CFC that implements this scope, it must have an init() method and implement: coldbox.system.ioc.scopes.IScopepublic any<Boolean> mappingExists(any name)
name - The name of the mapping to verifypublic any methodArg([any name], [any ref], [any dsl], [any value], [any javaCast])
name - The name of the argumentref - The reference mapping id this method argument maps todsl - The construction dsl this argument references. If used, the name value must be used.value - The value of the constructor argument, if passed.javaCast - The type of javaCast() to use on the value of the argument. Only used if using dsl or ref argumentspublic any noAutowire()
public any noInit()
public any onDIComplete(any methods)
methods - A list or an array of methods to execute once the mapping is created, inited and DI has happened.public any parentInjector(any injector)
injector - A parent injector to configure linkpublic any processMappings()
public any property(any name, [any ref], [any dsl], [any value], [any javaCast], [any scope='variables'])
name - The name of the cfproperty to inject intoref - The reference mapping id this property maps todsl - The construction dsl this property references. If used, the name value must be used.value - The value of the property, if passed.javaCast - The type of javaCast() to use on the value of the property. Only used if using dsl or ref argumentsscope - The scope in the CFC to inject the property to. By default it will inject it to the variables scopepublic boolean propertyExists(any name)
name - The name of the propertypublic void removeScanLocations(any locations)
locations - Locations to remove from the lookup. A list or array of locationspublic void reset()
public any scanLocations(any locations)
locations - A list or array of locations to add to package scanning.e.g.: ['coldbox','com.myapp','transfer']public any scopeRegistration([any<Boolean> enabled='[runtime expression]'], [any scope='[runtime expression]'], [any key='[runtime expression]'])
enabled - Enable registration or not (defaults=false) Booleanscope - The scope to register on, defaults to application scopekey - The key to use in the scope, defaults to wireBoxpublic any setProperties(any<struct> properties)
propertiespublic void setProperty(any name, any value)
name - The name of the propertyvalue - The value of the propertypublic any setter(any name, [any ref], [any dsl], [any value], [any javaCast])
name - The name of the setter method (without 'set').ref - The reference mapping object this setter method will receivedsl - The construction dsl this setter method will receivevalue - The value to pass into the setter method.javaCast - The type of javaCast() to use on the value. Only used if using dsl or ref argumentspublic any stopRecursions(any classes)
classes - A list or array of classes to use so the injector can stop when looking for dependencies in inheritance chainspublic any to(any path)
path - The class path to the object to mappublic any toDSL(any dsl)
dsl - The DSL string to usepublic any toFactoryMethod(any factory, any method)
factory - The mapping factory reference namemethod - The method to executepublic any toJava(any path)
path - The class path to the object to mappublic any toProvider(any provider)
provider - The provider to map topublic any toRSS(any path)
path - The class path to the object to mappublic any toValue(any value)
value - The value to bind topublic any toWebservice(any path)
path - The class path to the object to mappublic any with(any alias)
alias - The name of the maping to set as current for working with it via the mapping DSL
|
ColdBox Platform Version 3.0.0 | ||||
| FRAMES | |||||