coldbox.system.ioc.scopes

Class Singleton

lucee.Component
    extended by coldbox.system.ioc.scopes.Singleton
All Implemented Interfaces:
IScope

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- Tracking of single instance objects: Singletons

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any injector
          Injector linkage.

    • access = public
    • returntype = any
    true false
    any log
          Log Reference.

    • access = public
    • returntype = any
    true false
    any singletons
          Track singletons as a concurrent hash map.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init(any<Injector> injector)
          Configure the scope for operation and returns itself.
    Method Summary
    any clear()
         Clear the singletons scopes.
    boolean exists(any<Mapping> mapping)
         Indicates whether an object exists in scope.
    any getFromScope(any<Mapping> mapping, [any initArguments])
         Retrieve an object from scope or create it if not found in scope.
    string getInjector()
    string getLog()
    string getSingletons()
    any setInjector(any injector)
    any setLog(any log)
    any setSingletons(any singletons)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any<Injector> injector)

    Configure the scope for operation and returns itself

    Parameters:
    injector - The linked WireBox injector

    Property Detail

    injector

    property any injector

    Injector linkage

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    log

    property any log

    Log Reference

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    singletons

    property any singletons

    Track singletons as a concurrent hash map

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    clear

    public any clear()

    Clear the singletons scopes


    exists

    public boolean exists(any<Mapping> mapping)

    Indicates whether an object exists in scope

    Specified by:
    exists in interface IScope
    Parameters:
    mapping - The linked WireBox injector
    Returns:
    coldbox.system.ioc.scopes.IScope

    getFromScope

    public any getFromScope(any<Mapping> mapping, [any initArguments])

    Retrieve an object from scope or create it if not found in scope

    Specified by:
    getFromScope in interface IScope
    Parameters:
    mapping - The linked WireBox injector
    initArguments - The constructor struct of arguments to passthrough to initialization

    getInjector

    public string getInjector()


    getLog

    public string getLog()


    getSingletons

    public string getSingletons()


    setInjector

    public any setInjector(any injector)

    Parameters:
    injector

    setLog

    public any setLog(any log)

    Parameters:
    log

    setSingletons

    public any setSingletons(any singletons)

    Parameters:
    singletons